I asked in a comment (now deleted):
Have you asked the administrators of the PhD program? They must likely have someone who handles immigration formalities and would know the answer to your question.
That's because, according to the Spanish government's brochure on family reunification, foreigners may generally sponsor relatives for family reunification only after having lived in Spain for a year.
There is an exception for "beneficiaries of the special
regime for researchers," however, and I suspect that you may be such a beneficiary.
The person most likely to know is the person who handles immigration matters on behalf of the PhD program. This would be the person responsible for arranging the documents that the program needs to provide in order to serve as your sponsor. Such a person is most likely to be familiar with immigration laws as they apply to your position, since they have probably helped others who have been in the exact same position you are now in.
As you are not married, and seem not to be in a formally registered partnership, you will have the additional burden of proving the nature of your relationship. Even if you have no problem to do it, as you assume, it will still be more work than you'd have if you were married, and the possibility of failure is probably somewhat higher. Unfortunately, I do not know the criteria by which the Spanish authorities judge unmarried partnerships, so I can't comment further. That would probably make a good question in its own right.