Like BMW's you car uses Bosch Injection system, two fuel pumps, and a
cold start system.
First think I would check is the intake boots. You must remove them and
check for cracks or splits. If any are found them replace them.
Second I would buy a fuel pressure gauge with a hose long enough so you
could place the gauge on the windshield. Go for a drive and note your
fuel pressure when your car starts to lose power. Pumps are about 120,
intank pumps are about $75.
A failed intake pump will make the main pump noisy (growl) and can
cause hard starts and power loss though main pump cavitation.
Check your intank pump assembly before you buy a main pump.