It also has a major asset for self-driving technology — a ride-hailing network picking up and dropping off passengers 10 million times a week. This provides Lyft with a customer base to introduce and test the vehicles and a way to collect information that can be used to “train” autonomous cars.

But Raj Kapoor, Lyft’s chief strategy officer, said it would be a few years before truly autonomous vehicles were ready for the road.

“I believe this relationship will get us there faster,” Mr. Kapoor said.

Magna, a Canadian auto parts maker, already supplies a wide range of driver-assist technology to its customers, including a system for staying in lanes, automatic emergency braking and rearview cameras. It also builds entire vehicles for customers like Mercedes-Benz, BMW and Jaguar — a capability that has made the company a potential partner for a new entrant like Apple.

Magna has already been working on hardware for self-driving cars, including radar and lidar — an abbreviation for light detection and ranging — that help the vehicles see the world around them.

But Magna said the partnership with Lyft would be essential to helping it push further into autonomous vehicles, combining its automotive and manufacturing experience with Lyft’s ride network to better understand the many situations that a self-driving car will encounter.

“The question isn’t whether autonomous vehicles are going to happen but how long the transition is,” said Swamy Kotagiri, Magna’s chief technology officer.