Accelerating Large Language Model Training with 4D Parallelism and Memory Consumption Estimator
Not on the map. Why?
Abstract (arXiv)
In large language model (LLM) training, several parallelization strategies, including Tensor Parallelism (TP), Pipeline Parallelism (PP), Data Parallelism (DP), as well as Sequence Parallelism (SP) and Context Parallelism (CP), are employed to distribute model parameters, activations, and optimizer states across devices. Identifying the optimal parallelization configuration for each environment while avoiding GPU memory overflow remains a challenging task. In this study, we provide precise formulas to estimate the memory consumed by parameters, gradients, optimizer states, and activations for 4D parallel training (DP, TP, PP, CP) in the Llama architecture. We conducted 454 experiments on A100 and H100 GPUs, incorporating often neglected factors such as temporary buffers and memory fragmentation into our analysis. Results indicate that when the estimated memory usage is below 80% of the available GPU memory, the training never encounters out-of-memory errors. This simple yet effective formula allows us to identify parallelization configurations that could lead to memory overflow in advance, significantly reducing the configuration search space. Additionally, through a comprehensive exploration of optimal configurations in 4D parallelism, our analysis of the 454 experimental results provides empirical insights into optimal 4D parallelism configurations.
Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Builds on 12 of its 18 references that are in the map. First posted on arXiv 10 Nov 2024.
Builds on
12 of 18 references.
References · 12
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,673
- 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,598
- 2019Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelismcited by 1,868
- 2023GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpointscited by 1,346
- 2019ZeRO: Memory Optimizations Toward Training Trillion Parameter Modelscited by 1,301
- 2021Efficient Large-Scale Language Model Training on GPU Clusters Using Megatron-LMcited by 632
- 2023Ring Attention with Blockwise Transformers for Near-Infinite Contextcited by 457
- 2021ZeRO-Offload: Democratizing Billion-Scale Model Trainingcited by 341
- 2022Reducing Activation Recomputation in Large Transformer Modelscited by 302
- 2020Memory-Efficient Pipeline-Parallel DNN Trainingcited by 134
- 2021GSPMD: General and Scalable Parallelization for ML Computation Graphscited by 111
- 2021TeraPipe: Token-Level Pipeline Parallelism for Training Large-Scale Language Modelscited by 75
Built on by
Citing papers per year: 2025: 1; 2026: 1.
2 papers.