Skip to main content
QUICK REVIEW

[Paper Review] torchgpipe: On-the-fly Pipeline Parallelism for Training Giant Models

Chiheon Kim, Heungsub Lee|arXiv (Cornell University)|Apr 21, 2020
Advanced Neural Network ApplicationsComputer Science26 references32 citations
TL;DR

A PyTorch library implementing GPipe-style micro-batch pipeline parallelism with checkpointing and several optimization components to enable efficient training of very large models in eager execution environments.

ABSTRACT

We design and implement a ready-to-use library in PyTorch for performing micro-batch pipeline parallelism with checkpointing proposed by GPipe (Huang et al., 2019). In particular, we develop a set of design components to enable pipeline-parallel gradient computation in PyTorch's define-by-run and eager execution environment. We show that each component is necessary to fully benefit from pipeline parallelism in such environment, and demonstrate the efficiency of the library by applying it to various network architectures including AmoebaNet-D and U-Net. Our library is available at https://github.com/kakaobrain/torchgpipe .

Motivation & Objective

  • Motivate and enable training of massive neural networks beyond single-device capacity.
  • Provide a ready-to-use PyTorch library for GPipe-style pipeline parallelism with checkpointing.
  • Demonstrate the necessity of several optimization components to achieve efficient pipeline parallelism in define-by-run/eager PyTorch.
  • Show performance gains on architectures like AmoebaNet-D and U-Net.
  • Discuss handling of non-sequential models and skip connections in pipeline parallelism.

Proposed method

  • Represent the network as a sequence of partitions with disjoint parameter sets.
  • Apply micro-batch pipeline parallelism with gradient checkpointing to reduce memory usage.
  • Introduce a deterministic clock-cycle to schedule forward tasks across devices.
  • Provide backward dependency via Fork and Join to enforce correct autograd graph for backward pass.
  • Use non-default CUDA streams to enable concurrent copy and computation.
  • Introduce portals and shared-memory autograd functions for skip connections and checkpointed recomputation.

Experimental results

Research questions

  • RQ1How can GPipe-like pipeline parallelism be realized efficiently in PyTorch's define-by-run/eager mode?
  • RQ2What components are essential to achieve high throughput and memory efficiency when training giant models with pipeline parallelism?
  • RQ3How can non-sequential models and skip connections be accommodated in pipeline-parallel training?
  • RQ4What is the impact of the proposed components on throughput, device utilization, and memory usage?
  • RQ5Can torchgpipe achieve competitiveness with GPipe on large architectures like AmoebaNet-D and U-Net in PyTorch?

Key findings

  • Each optimization component (deterministic clock-cycle, backward Fork/Join dependencies, non-default streams, and portals) provides measurable speedups.
  • Combined components yield nearly a twofold speedup over the baseline in the reported U-Net experiments.
  • Non-default streams enable concurrent copy and computation, improving utilization.
  • Portals reduce unnecessary copies when skip connections are present, lowering memory pressure and improving timeline efficiency.
  • AmoebaNet-D and U‑Net benchmarks show throughput and memory characteristics consistent with effective pipeline parallelism in PyTorch.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.