If permanent magnets are rigidly mounted at a fixed distance from the IMU, they have no effect on the accelerometers and gyros inside the MPU-6050.
You can optionally connect the MPU-6050 to an external magnetometer.
(It's used to cancel out yaw drift).
That magnetometer, if you have one, will be affected by magnets.
In theory you could shield the magnetometer by wrapping it in mu-metal,
but that would also shield the magnetometer from the magnetic field of Earth, making the magnetometer useless -- better to leave out the magnetometer and the shield entirely.
Maybe you will be lucky and the magnets will merely shift the magnetometer values, without making it peg out.
If so, there are various ways of calibrating-out this fixed shift, and the IMU could work as well as it would have worked without those magnets.
(It's not clear to me if the MPU-6050 in particular supports such calibration).
I'm assuming your magnets have some purpose, yes?
Generally people use magnets in ways where the magnetic field in one small region is actually used, and any "stray" magnetic field elsewhere doesn't help.
There are several ways to "concentrate" the magnetic field,
making it stronger where it is actually useful, and making the stray fields weaker.
Counter-intuitively, it is possible to add more magnets to your system in such a way that the total magnetic field, at the magnetometer, from all the magnets is almost perfectly cancelled out, leaving only the Earth's magnetic field.
(This often makes the magnetic field elsewhere stronger).
For example, a Halbach array arranges permanent magnets in a way that makes the field stronger on one side, while cancelling the field to almost zero on the other side.