Quitting a postdoctoral fellowship I was awarded a rather prestigious postdoctoral fellowship that guarantees a generous salary, research expenses etc. for 2 years. It is in the same institution where I am working as a postdoc now, but would increase my salary by quite a bit and of course give me complete freedom over my research. I have not yet accepted the offer because I am struggling with a particular problem.

It is likely that in a year's time I will need to relocate to another country (for personal reasons). How bad is it to take the fellowship, knowing that there is a chance I will have to quit early? How frowned upon is quitting in the middle of a fellowship that explicitly specifies a 2-year tenure? Of course quitting a regular contracted postdoc job is straightforward, but I am not sure how it works with a personal fellowship—are there any additional consequences I haven't considered?

Edit: Just to provide some additional context, this is an individual fellowship (i.e. awarded directly to me) and the funding is internal (i.e. comes from the university itself).
Obviously, you need to see the contract, and preferably go over it with an attorney.  There may be a repayment agreement.  You don't know until you look.

As to whether you can leave this postdoc early, I recommend thinking about how public the info would be, and how your colleagues in your field would look at it if they knew about it.

Personally, I could never hold it against a postdoc if they left to grab a dream faculty position.  I imagine this happens with some regularity.  That said, I would personally think less of a person that accepted a two-year position with the secret intent of leaving after a year. An institution is making an investment in you, and you would be letting them down.  I would think of it as you entering an agreement in poor faith.

Needing to relocate for personal reasons after a year is a decision that only you can make. If it's important to you, you might consider honestly discussing your situation with the manager of whatever program you're involved with before you sign on the bottom line.  It may be fine with them.  They might even be amenable to some form of telecommuting! If you choose to do this, you should do it knowing that a revocation of the offer is a real possibility.