Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism

Recent work in language modeling demonstrates that training large transformer models advances the state of the art in Natural Language Processing applications. However, very large models can be quite difficult to train due to memory constraints. In this work, we present our techniques for training very large transformer models and implement a simple, efficient intra-layer model parallel approach that enables training transformer models with billions of parameters. Our approach does not require a new compiler or library changes, is orthogonal and complimentary to pipeline model parallelism, and can be fully implemented with the insertion of a few communication operations in native PyTorch. We illustrate this approach by converging transformer based models up to 8.3 billion parameters using 512 GPUs. We sustain 15.1 PetaFLOPs across the entire application with 76% scaling efficiency when compared to a strong single GPU baseline that sustains 39 TeraFLOPs, which is 30% of peak FLOPs. To demonstrate that large language models can further advance the state of the art (SOTA), we train an 8.3 billion parameter transformer language model similar to GPT-2 and a 3.9 billion parameter model similar to BERT. We show that careful attention to the placement of layer normalization in BERT-like models is critical to achieving increased performance as the model size grows. Using the GPT-2 model we achieve SOTA results on the WikiText103 (10.8 compared to SOTA perplexity of 15.8) and LAMBADA (66.5% compared to SOTA accuracy of 63.2%) datasets. Our BERT model achieves SOTA results on the RACE dataset (90.9% compared to SOTA accuracy of 89.4%).

Training Deep Nets withSublinear Memory CostTraining Deep Nets with Sublinear Memory CostBridging Nonlinearitiesand Stochastic…Bridging Nonlinearities and Stochastic Regularizers with Gaussian Error Linear UnitsDeep Contextualized WordRepresentationsDeep Contextualized Word RepresentationsMixed Precision TrainingMixed Precision TrainingXLNet: GeneralizedAutoregressive…XLNet: Generalized Autoregressive Pretraining for Language UnderstandingTransformer-BasedFeature Learning for…Transformer-Based Feature Learning for Algorithm Selection in Combinatorial OptimisationBERT: Pre-training ofDeep Bidirectional…BERT: Pre-training of Deep Bidirectional Transformers for Language UnderstandingALBERT: A Lite BERT forSelf-supervised Learnin…ALBERT: A Lite BERT for Self-supervised Learning of Language RepresentationsLarge Batch Optimizationfor Deep Learning…Large Batch Optimization for Deep Learning: Training BERT in 76 minutesExploring the Limits ofTransfer Learning with…Exploring the Limits of Transfer Learning with a Unified Text-to-Text TransformerSpanBERT: ImprovingPre-training by…SpanBERT: Improving Pre-training by Representing and Predicting SpansGeneralization throughMemorization: Nearest…Generalization through Memorization: Nearest Neighbor Language ModelsImproving MachineReading Comprehension…Improving Machine Reading Comprehension with Single-choice Decision and Transfer LearningERNIE 3.0: Large-scaleKnowledge Enhanced…ERNIE 3.0: Large-scale Knowledge Enhanced Pre-training for Language Understanding and GenerationExtracting Training Datafrom Large Language…Extracting Training Data from Large Language ModelsLoRA: Low-RankAdaptation of Large…LoRA: Low-Rank Adaptation of Large Language ModelsGLaM: Efficient Scalingof Language Models with…GLaM: Efficient Scaling of Language Models with Mixture-of-ExpertsVirtualFlow: DecouplingDeep Learning Model…VirtualFlow: Decoupling Deep Learning Model Execution from Underlying HardwareRing Attention withBlockwise Transformers…Ring Attention with Blockwise Transformers for Near-Infinite ContextCodeGen: An Open LargeLanguage Model for Code…CodeGen: An Open Large Language Model for Code with Multi-Turn Program SynthesisBenchmarking LargeLanguage Models for…Benchmarking Large Language Models for Automated Verilog RTL Code GenerationTo Repeat or Not ToRepeat: Insights from…To Repeat or Not To Repeat: Insights from Scaling LLM under Token-CrisisPre-Trained LanguageModels for Text…Pre-Trained Language Models for Text Generation: A SurveyNemotron-4 15B TechnicalReportNemotron-4 15B Technical ReportMegatron-LM: TrainingMulti-Billion Parameter…Megatron-LM: Training Multi-Billion Parameter Language Models Using Model ParallelismEarlier referencesFocus paperCiting papersOlderNewer

Click a node to pin it, click the empty canvas to go back to this paper, or hover to preview. Open a node’s page from its title.