Efficient large-scale language model training on GPU clusters using megatron-LM
Deepak Narayanan, Mohammad Shoeybi, Jared Casper et al. · 2012 International Conference for High Performance Computing, Networking, Storage and Analysis · 2021
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).
Cited by 574 works. doi:10.1145/3458817.3476209 Open-access PDF
Authors
- Deepak Narayanan
- Mohammad Shoeybi
- Jared Casper
- Patrick LeGresley
- Mostofa Ali Patwary
- Vijay Anand Korthikanti
- Dmitri Vainbrand
- Prethvi Kashinkunti
- Julie Bernauer
- Bryan Catanzaro
- Amar Phanishayee
- Matei Zaharia
References
- Attention Is All You Need
- BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
- HISTORIAE, History of Socio-Cultural Transformation as Linguistic Data Science. A Humanities Use Case
- PyTorch: An Imperative Style, High-Performance Deep Learning Library
- Accurate, Large Minibatch SGD: Training ImageNet in 1 Hour
- Language Models are Few-Shot Learners
- XLNet: Generalized Autoregressive Pretraining for Language Understanding
- Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism
- Training Deep Nets with Sublinear Memory Cost
- PipeDream