TeraPipe: Token-Level Pipeline Parallelism for Training Large-Scale Language Models

Zhuohan Li, Siyuan Zhuang, Shiyuan Guo, Danyang Zhuo, Hao Zhang +2 more
2/16/2021
cs.LGcs.CLcs.DC
transformer-attention

Official code: zhuohan123/terapipe (80 stars, Python, last commit 2021-05-04).

Abstract

Model parallelism has become a necessity for training modern large-scale deep language models. In this work, we identify a new and orthogonal dimension from existing model parallel approaches: it is possible to perform pipeline parallelism within a single training sequence for Transformer-based language models thanks to its autoregressive property.

Show full abstract

This enables a more fine-grained pipeline compared with previous work. With this key idea, we design TeraPipe, a high-performance token-level pipeline parallel algorithm for synchronous model-parallel training of Transformer-based language models. We develop a novel dynamic programming-based algorithm to calculate the optimal pipelining execution scheme given a specific model and cluster configuration. We show that TeraPipe can speed up the training by 5.0x for the largest GPT-3 model with 175 billion parameters on an AWS cluster with 48 p3.16xlarge instances compared with state-of-the-art model-parallel methods. The code for reproduction can be found at https://github.com/zhuohan123/terapipe

View on arXivView PDF

Code Implementations(1)

807Python, ShellApr 21, 20205 years ago

Similar Papers

Cite this paper

@article{li2021terapipe,
  title  = {TeraPipe: Token-Level Pipeline Parallelism for Training Large-Scale Language Models},
  author = {Zhuohan Li and Siyuan Zhuang and Shiyuan Guo and Danyang Zhuo and Hao Zhang and Dawn Song and Ion Stoica},
  year   = {2021},
  eprint = {2102.07988},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2102.07988}
}

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/2102.07988.svg)](https://codeofpaper.com/paper/2102.07988)

Discussion