ReaderTube

AI summary

Yellow marks are automatic key passages. They aren’t personal saved highlights. Select a timestamp to follow along with the video.

Tesla’s Autopilot uses camera-only computer vision and machine learning, with shared-backbone “Hydra Nets” handling many driving tasks and recurrent networks combining camera views to predict road layouts. Building, training, validating, and deploying these models at scale requires extensive parallel computing and automation, supported by Tesla’s in-house hardware; the team’s longer-term goal is to automate the development pipeline and improve training efficiency with Dojo. These systems power features such as Navigate on Autopilot and Smart Summon, which have already seen substantial real-world use.

Introduction and Autopilot features

Andre, the director of AI at Tesla, presents how PyTorch is used to train the neural networks behind Autopilot. A show of hands in the room indicates that a few attendees own a Tesla and that some have used or experienced Autopilot. The basic functionality of Autopilot is to keep the car in its lane and away from the vehicle ahead. More advanced functionality includes Navigate on Autopilot: the driver sets a pin somewhere on the map, and as long as the route sticks to highways, the car makes all of the lane changes automatically and takes the right forks to get there. Smart Summon, released only about two weeks before the talk, lets the car come to its owner in a parking lot. The owner holds down a "come to me" button, the car pulls out of its parking spot and finds them, and they get in "like royalty". It is an amazing, magical feature. More broadly, the team is pursuing full self-driving capability, and that is what everyone on the team is focused on.

Vision-only approach and vertical integration

Famously, Tesla does not use lidar and does not use high-definition maps. Everything built for Autopilot is based on computer vision and machine learning applied to the raw video streams from the eight cameras that surround the vehicle. A single instant from those cameras is processed, as one might imagine, with a lot of convolutional networks. Tesla is a fairly vertically integrated company, and that also holds for the intelligence of Autopilot. Tesla builds its own cars and arranges the sensors around the vehicle. It also collects all of its data, labels all of it, and trains on on-premise GPU clusters. It then takes the networks through the entire stack, running them on its own custom hardware developed in-house. Tesla is also in charge of the full lifecycle of these features: they are deployed to a fleet of almost three-quarters of a million cars, and telemetry is examined to improve the features over time. In this way the loop is closed.

Multitask image networks and Hydra Nets

The bread and butter of the team is analyzing images. Driving in an environment requires understanding a great deal about it: traffic lights, lane line markings, cars and more. The work quickly becomes a massively multitask setting in which a lot must be known about the scene. Many of the networks therefore share an outline: a shared backbone with a number of tasks hanging off it. Typically these are ResNet-50-like backbones running on images of roughly 1000 by 1000 pixels, with heads attached to them. This design is partly a matter of necessity. There are almost 100 tasks, and it is unaffordable to have a separate neural network for each, so computation has to be amortized by sharing the backbones. Because of the shared backbone and multiple heads, these networks are called Hydra Nets.

Examples: lane lines, road edges and occupancy grids

Examples of Hydra Net outputs include lane line markings and road edges. Road edges matter for Smart Summon, because the car has to understand where it can be in the environment, and in this case it wants to avoid curbs. Predictions are made in the image, then cast out and stitched up across space and time to understand the layout of the scene around the car. An occupancy grid showing just the road edges illustrates how they get projected as the car winds its path around a parking lot while its owner is summoning it, trying to find its way to the goal. This is how things get stitched up.

Tasks that combine multiple images and road layout prediction

So far the networks described run on independent images. Very quickly, however, tasks arise that have to be a function of multiple images at once. Estimating depth at every pixel, for example, can benefit from access to other views of the same scene. Predicting the road layout, or steering the wheel, may likewise require borrowing features from multiple other Hydra Nets. In practice there are Hydra Nets for the different cameras, and some of their features are pulled into a second round of processing, optionally recurrent, to produce something like a road layout prediction. In one example, three cameras are plugged simultaneously into a neural network, and its predictions are no longer in image space but in a top-down space. The predictions shown relate to the corridors available in a parking lot, where the intersections are, and what the orientations of all these things are. The stitching across space and time no longer happens in a C++ code base; it happens inside the recurrent neural network.

The overall network architecture

More generally, the networks for all of these tasks are converging on a common shape. Eight Hydra Nets, one per camera, handle the per-image tasks and produce all kinds of intermediate predictions. The features from these Hydra Nets then go into a second round of processing, potentially recurrent, which yields more outputs in a top-down view. What is special is that this is a pretty large single network, and every individual task sub-samples part of it and trains only that small piece. The team can, for example, train an object detector on the cameras, a depth network, or a road layout network. All of these tasks subsample the graph and train only their portion.

Challenges of training at scale

Training recurrent neural networks on videos is not trivial. Suppose the graph is unrolled in time and backpropagated through time, with eight cameras, 16 time steps and a batch size of, say, 32. A single forward pass then holds 4096 images and all their activations in memory. A typical distributed data parallel setup breaks quickly, because that amount of activations cannot be held in the memory of a single GPU or even a single node. Much of the training therefore has to combine elements of data parallelism with model parallelism. Training many tasks is also tricky. The simplest case is round-robin training, in which all workers in the pool train task one, then task two, then task three, and so on. That gets out of hand with a hundred tasks. A better idea is a pool of workers in which some work on objects, some on road layout, some on depth, and so on. These are very heterogeneous workflows, but they coexist and train different pieces of the network at the same time. They can be arranged in a synchronous or asynchronous way, and tuned to squeeze all the juice out of the system.

Scale of training and the iteration burden

Training all of the neural networks for Autopilot is a fairly expensive task. Today the team trains 48 different networks that make 1,000 different predictions, counting the number of output tensors, and it takes 70,000 GPU hours to compile the neural network stack of Autopilot. A single node with eight GPUs would be training for a year. It is a lot of networks and a lot of predictions, a lot of them must work, and none of them can ever regress. Moreover, this is not done only once: researchers and engineers on the team have to keep improving the system, so there is a great deal of neural network training at scale.

Automation and Operation Vacation

The team is automating many workflows, covering not just the neural network training itself but everything around it. Thresholds have to be calibrated, with a process for that, and there is a lot of in-the-loop and other validation and evaluation to make sure that none of the 1,000 different predictions regress. The North Star for the team is that all of this can be automated quite well. Starting from the data set, one can train all the neural nets, do all the calibration and evaluation, and really start to see continuous integration of the whole process. Internally and somewhat jokingly, this goal is called Operation Vacation. The idea is that as long as the data labeling team is around, curating and improving the data sets, everything else can in principle be automated. The team could then go on vacation while Autopilot improves by default. This is something the team really tries to move towards.

Inference hardware and Dojo

After so much on training, a word on inference. Tesla has its own back end, developed by the hardware team, called the FSD computer. It offers about 144 trillion operations per second (TOPS) of capability, which is roughly an order-of-magnitude improvement over the GPUs used before the chip was introduced, at lower cost. It is used in all the latest cars coming out of the production line, and all the neural networks are targeted to these chips. The hardware team is also working on a project called Dojo, a neural network training computer and chip. The hope is to do for training what was done for inference, improving efficiency by roughly an order of magnitude at lower cost. More details on that project are not yet ready to be shared.

Summary

In summary, the talk covered the full lifecycle of developing neural networks for Autopilot and how everything is owned in-house. The neural network is fairly complicated and large, and there are a lot of problems to deal with if one actually wants to train the beast, but it's

Real-World Autopilot Results

Training large neural networks has produced interesting results, and those networks are deployed in real products. Navigate on Autopilot has accumulated 1 billion miles and recorded 200,000 confirmed lane changes. It is a global product available in more than 50 countries, resulting in a vast number of neural-network forward passes. Smart Summon had reached 800,000 sessions in which people tried to call their cars to them; that figure was already outdated.

Acknowledgments

The Patrasche team has been incredibly responsive and helpful, enabling the development and large-scale training of these networks before their deployment in the real world. The collaboration has been an interesting experience. Thank you.

Turn your watchlist into a reading routine

Bring your YouTube videos together, read summaries with key passages marked, and explore the full transcript. Save your own highlights with Pro.

Start with 5 free batteries. Each covers up to 30 minutes of a new summary.

New summaries depend on video availability and demand; processing may take time or require retry.