Skip to main content
🌐 Distributed training 17 articles · 11 chapters

Module 3: Distributed training

Starts with an overview, then covers data parallelism, the ZeRO family, tensor parallelism, pipeline parallelism and 3D parallelism, and ties them together with a training framework.

Start learning

Chapters

From model-scale bottlenecks, hand-calculate the training memory ledger, survey the five parallelism strategies, then land on rank/torchrun/NCCL setup and your first DDP script
The physical foundation of distributed training—semantics of AllReduce/ReduceScatter/AllGather/All-to-All and other collectives, how the Ring algorithm works, and quantitative communication-volume analysis
How mainstream optimizers evolved and what state they keep inside, how to analyze optimizer memory cost, and the foundation for ZeRO memory optimization and mixed-precision training
How three generations of data parallelism evolved, how they work in practice, and what really differs between AllReduce gradient sync and parameter sharding
How ZeRO-1/2/3 shard state and what they cost in communication, plus how ZeRO-Offload and Infinity move state onto heterogeneous memory
Megatron-LM's tensor-parallel design (Column/Row Parallel Linear), where communication is inserted, and how sequence parallelism cuts activation memory
What causes the pipeline bubble, and how GPipe, 1F1B, and Interleaved scheduling reduce it—with quantitative analysis
FP16/BF16/FP8 mixed-precision training, gradient accumulation, Activation Checkpointing, and what each costs in compute and memory
Breaking the sequence-length wall—Attention's O(s²) problem, and a comparison of Ring Attention, DeepSpeed-Ulysses, and Megatron Context Parallel
How sparse expert models parallelize: the Router, All-to-All in Expert Parallelism, combining EP×DP×TP×PP, and load balancing
Putting every parallelism dimension together—topology design for TP×PP×DP×EP×CP, communication-domain mapping, rank layout, and how to pick the best mix for a given cluster

Study tips

Prerequisites

The prerequisites module, especially chapter 6 on collective communication

  • Read the overview first. It gives you the big picture.
  • Spend extra time on ZeRO. Modern distributed training is hard to follow without it.
  • The training framework chapter connects the earlier theory.