I have a '02 M5 with 145K miles. About a month ago I started to feel the car hesitating during acceleration. At one point it felt as if the car was going to stall. Then it went into "Failsafe" mode and was smoother. But, I notice the power is reduced.

Since then this has happened 3-4 more times and seems even more frequent...the car starts out in normal mode but enters "Failsafe" after 30 to 40 minutes of driving.

What is the likely fix? I have had normal maint. up to about 120K miles, but have just had oil changes and such since.

Would changings spark plugs and fuel filter fix this?

Open to hear possible causes.