Generalized Tensor Parallelism: Powering Trillion-Parameter LLM Training at 10+ EFLOP/s
Shiqing Fan, Deepak Narayanan, Jimmy Zhang, Jiangfei Duan, Prajwal Singhania, Haoran Zhang, Wanying Wang, Philip Monk, Xuwen Chen, Jared Casper, Jun Yang, Mohammad Shoeybi, Bryan Catanzaro, Vijay Anand Korthikanti
Abstract
Pretraining state-of-the-art large language models (LLMs) with up to trillions of parameters is memory- and compute-intensive. Existing parallelization schemes compromise on either per-GPU memory or throughput: data parallelism replicates parameters; tensor parallelism and fully sharded data parallelism (FSDP) add communication of activations and parameters, respectively, to every microbatch; and pipeline parallelism leaves GPUs idle while the pipeline fills and drains. We show that, for linear layers, five commonly used parallelisms (data, tensor, sequence, context parallelism and FSDP) are special cases of one framework, generalized tensor parallelism (GTP), in which each layer's parameters and activations are partitioned and either can be re-materialized with an all-gather before use. In GTP, a parameter all-gather is an optional preprocessing step on one input of a matrix multiplication (GEMM), whereas FSDP implementations typically treat it as a step before an entire Transformer block, which can increase memory footprint and delay GEMMs. The GTP view lets us schedule all-gathers per GEMM rather than per block, issuing each early enough to hide its communication but late enough to limit memory. Our implementation is open source at https://github.com/NVIDIA/Megatron-LM; with it, an internal 2T-parameter mixture-of-experts (MoE) model reaches \textbf{13.0 model EFLOP/s} (exaFLOP/s) on 12,288 GB300 GPUs with 98\% weak-scaling efficiency, and runs with 1M-token sequences on 512 GPUs. On 256--1,024 GPUs, our implementation achieves \textbf{1.05--1.55 the throughput of Megatron-FSDP} across three MoE models and \textbf{1.27--1.31 that of a tuned 3D-parallel recipe with pipeline parallelism} on a DeepSeek-V4-Pro proxy model.
Create a lesson
Metadata
- Comments
- 40 pages, 22 figures
Related papers
Joule is FLOP: Optimizing Tensor-Core Kernels Beyond Latency Hiding at the GPU Power Wall
Shared title terminologycs.DCTaowen Liu, Zhiwen Mo, Hongxiang Fan et al.
LIBRA: Runtime Co-Tuning of Batch Size and Parallelism for Time-Efficient LLM Training
Shared title terminologycs.DCShengkai Lyu, Hairui Zhao, Daran Sun et al.
StarMPI-SVD: Distributed-Memory Parallel Star-M Tensor SVD
Shared title terminologycs.DCNaman Pesricha, Grey Ballard, Srinivas Eswar et al.
Parallel Memory Management in Goose, C++, and Rust: An Experimental Study of Allocation, Reclamation, and Scaling
Shared title terminologycs.DCRafał Frączek
Wi-Fi Enabled Edge Intelligence Framework for Smart City Traffic Monitoring using Low-Power IoT Cameras
Shared title terminologycs.DCRaphael Walcher, Kurt Horvath, Dragi Kimovski et al.
Torcalia.jl: An MPI-based Runtime System for Asynchronous Task Parallelism in Julia
Shared title terminologycs.DCArgiris Sofotasios, Dimitris Metaxakis, Chrysostomos Stylios et al.