XPipe: Efficient Pipeline Model Parallelism for Multi-GPU DNN Training

Lei Guan, Wotao Yin, Dongsheng Li, Xicheng LuarXiv 2019

Introduction

As Deep Neural Networks (DNNs) continue to grow in complexity and size, they frequently exceed the memory capacity of individual GPUs. To address this, researchers utilize Model Parallelism, partitioning the network across multiple devices. However, standard implementations often suffer from significant efficiency bottlenecks. Synchronous approaches like GPipe introduce "bubbles" of idle time during pipeline flushes, while asynchronous methods like PipeDream suffer from "weight staleness," where gradients are applied to updated weights, leading to accuracy degradation.

XPipe is a novel asynchronous pipeline model parallelism framework designed to bridge this gap. It achieves high throughput by keeping GPUs busy nearly 100% of the time while maintaining high accuracy through a sophisticated weight prediction strategy.

The XPipe Framework

XPipe introduces three core innovations to optimize multi-GPU training:

  1. Interleaved Micro-batches: Similar to GPipe, XPipe divides a mini-batch into $T$ micro-batches. However, it allows micro-batches from different mini-batches to overlap within the pipeline. This eliminates the need for frequent pipeline flushes, ensuring a "steady phase" of high utilization.
  2. Adam-based Weight Prediction: To mitigate weight staleness, XPipe predicts future weight values ($\hat{W}_t$) before a micro-batch begins its forward pass. Unlike previous methods that use simple momentum, XPipe utilizes a running average of both the first and second moments of gradients—mirroring the Adam optimizer—to provide more stable and accurate predictions.
  3. The Bellwether Strategy: To minimize computational overhead, XPipe designates the first micro-batch in a sequence as a "bellwether." This micro-batch calculates and caches the predicted weights, which are then reused by the subsequent $(T-1)$ micro-batches.
XPipe pipeline structure for different micro-batch counts (T=2 and T=4).

A key advantage of this architecture is its independence from the micro-batch count ($T$). As shown in the figure above, the pipeline structure remains consistent regardless of whether $T=2$ or $T=4$, allowing for easier memory tuning without impacting overall throughput.

Experimental Evaluation

The effectiveness of XPipe was evaluated using three prominent CNN architectures: VGG-16, ResNet-101, and Inception-V3. These models were tested on the CIFAR-10 and Tiny ImageNet datasets. The experiments compared XPipe against a synchronous baseline, GPipe, and other asynchronous frameworks like PipeDream and SpecTrain.

Results and Analysis

XPipe demonstrates significant improvements in both training speed and final model quality:

  • Throughput: On a 4-GPU setup training Inception-V3, XPipe achieved an average throughput increase of 88.1% over GPipe, with peaks reaching over 150%.
  • Accuracy and Convergence: XPipe consistently outperformed other asynchronous methods. On CIFAR-10, while PipeDream and SpecTrain experienced accuracy drops, XPipe achieved a 0.08% improvement over the synchronous baseline.
Validation loss and Top-1 accuracy comparison across different frameworks.

As illustrated in the convergence plots, XPipe (red line) matches or exceeds the convergence speed of the baseline while maintaining lower validation loss and higher accuracy throughout the training process compared to its asynchronous competitors.

Conclusion

XPipe proves that the trade-off between asynchronous speed and synchronous accuracy is not inevitable. By leveraging second-order gradient moments for weight prediction and an interleaved micro-batch strategy, XPipe provides a scalable solution for training massive DNNs. Future work includes developing automated partitioning algorithms to further optimize performance across diverse hardware configurations and deeper pipelines.

Summary updated

BibTeX
@misc{guan2019xpipe,
  author = {Lei Guan and Wotao Yin and Dongsheng Li and Xicheng Lu},
  title = {{XPipe: Efficient Pipeline Model Parallelism for Multi-GPU DNN Training}},
  year = {2019},
  eprint = {1911.04610},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1911.04610},
}
Figure