Lune

SC2021Top-tier venue

Efficient large-scale language model training on GPU clusters using megatron-LM

Deepak Narayanan, Mohammad Shoeybi, Jared Casper, Patrick LeGresley, Mostofa Patwary, Vijay Korthikanti, Dmitri Vainbrand, Prethvi Kashinkunti, Julie Bernauer, Bryan Catanzaro, Amar Phanishayee, Matei Zaharia

Abstract

Large language models have led to state-of-the-art accuracies across several tasks. However, training these models efficiently is challenging because: a) GPU memory capacity is limited, making it impossible to fit large models on even a multi-GPU server, and b) the number of compute operations required can result in unrealistically long training times. Consequently, new methods of model parallelism such as tensor and pipeline parallelism have been proposed. Unfortunately, naive usage of these methods leads to scaling issues at thousands of GPUs. In this paper, we show how tensor, pipeline, and data parallelism can be composed to scale to thousands of GPUs. We propose a novel interleaved pipelining schedule that can improve throughput by 10+% with memory footprint comparable to existing approaches. Our approach allows us to perform training iterations on a model with 1 trillion parameters at 502 petaFLOP/s on 3072 GPUs (per-GPU throughput of 52% of theoretical peak).

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

290 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Memory-Efficient Pipeline-Parallel DNN Training cites Language Models are Few-Shot Learners
  • Direct Preference Optimization: Your Language Model is Secretly a Reward Model cites Language Models are Few-Shot Learners
  • DeepSpeed- Inference: Enabling Efficient Inference of Transformer Models at Unprecedented Scale cites ZeRO: memory optimizations toward training trillion parameter models
  • DeepSpeed- Inference: Enabling Efficient Inference of Transformer Models at Unprecedented Scale cites ZeRO-infinity: breaking the GPU memory wall for extreme scale deep learning
  • DeepSpeed- Inference: Enabling Efficient Inference of Transformer Models at Unprecedented Scale cites Language Models are Few-Shot Learners
  • FlexGen: High-Throughput Generative Inference of Large Language Models with a Single GPU cites DeepSpeed- Inference: Enabling Efficient Inference of Transformer Models at Unprecedented Scale
  • FlexGen: High-Throughput Generative Inference of Large Language Models with a Single GPU cites ZeRO-infinity: breaking the GPU memory wall for extreme scale deep learning
  • FlexGen: High-Throughput Generative Inference of Large Language Models with a Single GPU cites Language Models are Few-Shot Learners
  • FlexGen: High-Throughput Generative Inference of Large Language Models with a Single GPU cites ZeRO-Offload: Democratizing Billion-Scale Model Training
  • Scaling Data-Constrained Language Models cites Language Models are Few-Shot Learners
  • ZeRO-infinity: breaking the GPU memory wall for extreme scale deep learning cites ZeRO: memory optimizations toward training trillion parameter models
  • ZeRO-infinity: breaking the GPU memory wall for extreme scale deep learning cites Memory-Efficient Pipeline-Parallel DNN Training
  • ZeRO-infinity: breaking the GPU memory wall for extreme scale deep learning cites Language Models are Few-Shot Learners
  • ZeRO-Offload: Democratizing Billion-Scale Model Training cites ZeRO: memory optimizations toward training trillion parameter models
  • MegaScale: Scaling Large Language Model Training to More Than 10, 000 GPUs cites ZeRO: memory optimizations toward training trillion parameter models
  • MegaScale: Scaling Large Language Model Training to More Than 10, 000 GPUs cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers290

  1. Direct Preference Optimization: Your Language Model is Secretly a Reward ModelRafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D. Manning et al.NeurIPS 2023 · 10,924 citations
  2. FlexGen: High-Throughput Generative Inference of Large Language Models with a Single GPUYing Sheng, Lianmin Zheng, Binhang Yuan, Zhuohan Li et al.ICML 2023 · 683 citations
  3. Scaling Data-Constrained Language ModelsNiklas Muennighoff, Alexander M. Rush, Boaz Barak, Teven Le Scao et al.NeurIPS 2023 · 475 citations
  4. MegaScale: Scaling Large Language Model Training to More Than 10, 000 GPUsZiheng Jiang, Haibin Lin, Yinmin Zhong, Qi Huang et al.NSDI 2024 · 415 citations
  5. DeepSpeed- Inference: Enabling Efficient Inference of Transformer Models at Unprecedented ScaleReza Yazdani Aminabadi, Samyam Rajbhandari, Ammar Ahmad Awan, Cheng Li et al.SC 2022 · 276 citations

Builds on8

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. ZeRO: memory optimizations toward training trillion parameter modelsSamyam Rajbhandari, Jeff Rasley, Olatunji Ruwase, Yuxiong HeSC 2020 · 852 citations
  3. ZeRO-Offload: Democratizing Billion-Scale Model TrainingJie Ren, Samyam Rajbhandari, Reza Yazdani Aminabadi, Olatunji Ruwase et al.USENIX ATC 2021 · 657 citations
  4. Memory-Efficient Pipeline-Parallel DNN TrainingDeepak Narayanan, Amar Phanishayee, Kaiyu Shi, Xie Chen et al.ICML 2021 · 283 citations
  5. ZeRO-infinity: breaking the GPU memory wall for extreme scale deep learningSamyam Rajbhandari, Olatunji Ruwase, Jeff Rasley, Shaden Smith et al.SC 2021 · 254 citations

Related papers

  1. BPipe: Memory-Balanced Pipeline Parallelism for Training Large Language ModelsTaebum Kim, Hyoungjoo Kim, Gyeong-In Yu, Byung-Gon ChunICML 2023 · 34 citations
  2. Synergistic Tensor and Pipeline ParallelismMengshi Qi, Jiaxuan Peng, Jie M. Zhang, Juan Zhu et al.NeurIPS 2025 · 2 citations
  3. TeraPipe: Token-Level Pipeline Parallelism for Training Large-Scale Language ModelsZhuohan Li, Siyuan Zhuang, Shiyuan Guo, Danyang Zhuo et al.ICML 2021 · 160 citations
  4. MixPipe: Efficient Bidirectional Pipeline Parallelism for Training Large-Scale ModelsWeigang Zhang, Biyu Zhou, Xuehai Tang, Zhaoxing Wang et al.DAC 2023 · 9 citations
  5. Chimera: efficiently training large-scale neural networks with bidirectional pipelinesShigang Li, Torsten HoeflerSC 2021 · 124 citations
Dusk over the sea between two cliffs drawn in fine vertical lines