PipeDream: Fast and Efficient Pipeline Parallel DNN Training

Aaron Harlap, Deepak Narayanan, Amar Phanishayee, Vivek Seshadri, Nikhil R. Devanur, Gregory R. Ganger, Phillip B. GibbonsarXiv 2018

Introduction: The Communication Wall

Training large deep neural networks (DNNs) across multiple GPUs typically relies on data parallelism. In this paradigm, each GPU maintains a full copy of the model and synchronizes gradients after every step. However, as models grow in size and GPUs become faster, the time required to communicate these massive weight updates often exceeds the time spent on computation. This "communication wall" leads to significant hardware underutilization, particularly on high-performance hardware like NVIDIA V100s.

Communication overhead as a percentage of total training time across different models and GPU generations.

While model parallelism—partitioning a model's layers across multiple GPUs—offers an alternative, it frequently suffers from "pipeline bubbles" where most GPUs remain idle while waiting for a single stage to complete. PipeDream addresses these challenges by introducing pipeline parallelism, a hybrid approach that keeps all GPUs busy through aggressive pipelining without sacrificing convergence.

Pipeline Parallelism (PP)

PipeDream's core innovation is a distributed training system that combines model parallelism, data parallelism, and pipelining. The system is built on three pillars:

  1. Automated Partitioning: PipeDream uses a profiler to measure layer-wise compute times and output sizes. An optimizer then employs a dynamic programming algorithm to determine optimal split points across machines. If a specific stage is a bottleneck, the system can assign multiple machines to it using data parallelism.
  2. 1F1B Scheduling (One-Forward-One-Backward): To maximize throughput, PipeDream injects multiple minibatches into the pipeline. In a steady state, each worker alternates between a forward pass for a new minibatch and a backward pass for an earlier one. This ensures high utilization while minimizing the memory footprint of "in-flight" minibatches.
The 1F1B (One-Forward-One-Backward) pipeline schedule across four machines.
  1. Weight Stashing: Pipelining introduces potential staleness, as weights may be updated between a minibatch's forward and backward passes. PipeDream solves this through "weight stashing," which preserves the specific weight version used during the forward pass for use in the corresponding backward pass, ensuring mathematical integrity.

Key Insights and Results

The fundamental insight of PipeDream is that communicating activations and gradients between layers is often significantly cheaper than communicating full model weight updates. For models like VGG-16, this approach reduces communication overhead by up to 95%.

Evaluation across datasets like ImageNet-1K and models such as ResNet-50 and AlexNet demonstrated that PipeDream achieves up to a 5x speedup in time-to-accuracy compared to standard data-parallel training. For instance, on V100 GPUs, PipeDream improved throughput by 1.21x for ResNet-50 and 6.78x for AlexNet compared to 8-machine data-parallel setups. On a 16-GPU cluster, the system showed near-linear scaling for communication-heavy models, and the benefits were consistent across multiple GPU generations (Kepler, Pascal, and Volta).

Conclusion

PipeDream effectively breaks the communication wall by rethinking how DNN training is distributed. By intelligently partitioning models and employing the 1F1B schedule with weight stashing, it provides a high-throughput, memory-efficient alternative to traditional data parallelism. While it introduces some memory overhead and requires initial profiling, its ability to dramatically reduce communication bottlenecks makes it a vital tool for training the next generation of large-scale models.

Summary updated

BibTeX
@misc{harlap2018pipedream,
  author = {Aaron Harlap and Deepak Narayanan and Amar Phanishayee and Vivek Seshadri and Nikhil R. Devanur and Gregory R. Ganger and Phillip B. Gibbons},
  title = {{PipeDream: Fast and Efficient Pipeline Parallel DNN Training}},
  year = {2018},
  eprint = {1806.03377},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1806.03377},
}
Figure