Pipeline Parallelism with Controllable Memory

Penghui Qi, Xinyi Wan, Nyamdavaa Amar, Min Lin
5/1/2024

No official code found. Best implementation: sail-sg/zero-bubble-pipeline-parallelism (466 stars, last commit 2025-05-07).

Abstract

Pipeline parallelism has been widely explored, but most existing schedules lack a systematic methodology. In this paper, we propose a framework to decompose pipeline schedules as repeating a building block, and show that the lifespan of the building block decides the peak activation memory of the pipeline schedule. Guided by the observations, we find that almost all existing pipeline schedules, to the best of our knowledge, are memory inefficient. To address this, we introduce a family of memory efficient building blocks with controllable activation memory, which can reduce the peak activation memory to 1/2 of 1F1B without sacrificing efficiency, and even to 1/3 with comparable throughput. We can also achieve almost zero pipeline bubbles while maintaining the same activation memory as 1F1B. Our evaluations demonstrate that in pure pipeline parallelism settings, our methods outperform 1F1B by from 7% to 55% in terms of throughput. When employing a grid search over hybrid parallelism hyperparameters in practical scenarios, our methods demonstrate a 16% throughput improvement over the 1F1B baseline for large language models. The implementation is open-sourced at https://github.com/sail-sg/zero-bubble-pipeline-parallelism.

View on arXivView PDF

Code Implementations(1)

Zero Bubble Pipeline Parallelism

46631C, C++Nov 20, 20231 years agoNOASSERTION

Similar Papers

Cite this paper

@article{qi2024pipeline,
  title  = {Pipeline Parallelism with Controllable Memory},
  author = {Penghui Qi and Xinyi Wan and Nyamdavaa Amar and Min Lin},
  year   = {2024},
  eprint = {2405.15362},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2405.15362},
  url    = {https://arxiv.org/abs/2405.15362},
  journal = {NEURIPS 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2405.15362.svg)](https://codeofpaper.com/paper/2405.15362)

Discussion