Skip to content

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

cs.DC

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×\times the throughput of Megatron-FSDP} across three MoE models and \textbf{1.27--1.31×\times 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