A training step can be cut along six dimensions: the batch, the stored state, each weight matrix, the layers, the experts or the sequence. Each cut lowers what one GPU holds or computes and pays for it in bytes that a collective must move between GPUs, so a layout puts the chattiest cut on the fastest wire: NVLink inside a server, about nine times faster per GPU than the network between servers on an H100 cluster.
You need: what a training step holds in memory (weights, gradients, Adam's state, activations), which the parent Topic: llm-training-and-post-training sets out in its Machinery section. The links themselves (NVLink, InfiniBand, rings and trees) are owned by Interconnects and scaling; mixture-of-experts design by Mixture of experts.
Ψ is the parameter count, n the number of GPUs in the group, s the sequence length, b the micro-batch in sequences, h the hidden size; bytes are bf16 (2 per value) unless stated.
| Split | What is cut | Each GPU holds | Collective in one step | Bytes sent per GPU per step | Link it needs | Reach for it when |
|---|---|---|---|---|---|---|
| Data (DDP) | The batch | The whole model, its gradients and optimiser state; its own micro-batch | All-reduce of the gradients, in buckets, overlapped with backward | 2(n−1)/n × 2Ψ | Either; tolerates latency | The model and its optimiser fit on one GPU |
| ZeRO-1, ZeRO-2 | The batch, plus optimiser state (and gradients) | Full weights; 1/n of the optimiser state (and of the gradients) | Reduce-scatter of gradients, all-gather of updated weights | Same as DDP | Either | Optimiser state is what does not fit |
| ZeRO-3, FSDP | Everything stored | 1/n of weights, gradients, optimiser state; one layer's full weights at a time | All-gather of each layer's weights before forward and again before backward; reduce-scatter of gradients | 3(n−1)/n × 2Ψ, 1.5 times DDP | Fast; hybrid sharding keeps it in the server | The weights themselves do not fit; the usual choice below about 10B |
| Tensor (TP, + SP) | Every weight matrix | 1/t of each matrix; the whole micro-batch | Two all-reduces per layer forward, two backward (with sequence parallelism, reduce-scatter plus all-gather of the same size) | 4 × 2(t−1)/t × 2sbh per layer per micro-batch | NVLink, inside one server (t ≤ 8) | One layer, or its activations, does not fit |
| Pipeline (PP) | The layers | L/p consecutive layers; activations of the micro-batches in flight | Send and receive between neighbouring stages | 2 × 2sbh per micro-batch per boundary | Slow links are fine | The model does not fit in one server; across servers |
| Expert (EP) | An MoE model's experts | E/e experts; attention replicated or split another way | All-to-all dispatch and combine around every MoE layer, forward and backward | 4 × k × tokens × h × bytes × (e−1)/e per MoE layer | NVLink, or InfiniBand with routing limited to a few nodes | The model is a mixture of experts |
| Context (CP) | The sequence | 1/c of every sequence's tokens; full weights | All-gather (or ring pass) of keys and values forward, reduce-scatter of their gradients backward; gradient all-reduce as in DDP | 2 × (c−1)/c × K,V bytes per layer per micro-batch | Fast preferred | A single long sequence's activations do not fit |
Formulas: ring collectives from nccl-tests; ZeRO's 2Ψ against 3Ψ from ZeRO §7; tensor-parallel all-reduces from Megatron-LM; the other rows are derived in src/recompute.py. Numbers are published with the source linked unless marked derived, illustrative, reported (the maker's own figure) or unconfirmed. The one-line version of this table, beside precision and clusters, is in the parent page's Machinery section.
Cuts the batch; every GPU holds the whole model. Sends an all-reduce of the gradients: 24.1 GB. Any link.
Cuts the stored state as well. Sends each layer's weights twice and the gradients once: 36.1 GB. A fast link.
Cuts every matrix; every GPU sees the whole batch. Sends four all-reduces inside every layer: 51.5 GB. NVLink only.
Cuts the layers. Sends one activation and one gradient per micro-batch: 0.54 GB. Any link, but stages idle in the bubble.
Cuts the experts of an MoE model. Sends tokens to their experts and back by all-to-all: 13.6 GB. NVLink, or a few servers.
Cuts the sequence. Sends keys and values in every layer, plus the gradient all-reduce: 30.5 GB. A fast link.
Left: the batch, four sequences in chunks of tokens. Right: the model, eight rows of layers, each an attention and a feed-forward half in four slices. Bytes are per GPU for one step of Llama 3 8B on four GPUs, from each section's stage (Figs. 4 to 12) derived.
Take Llama 3 8B (8.03B parameters recounted from its config.json, an unsloth mirror of the gated repository) and train it with Adam in mixed precision on one 80 GB H100. Fig. 2 stacks what one GPU must hold, to scale, against its 80 GB: Llama 3 8B does not fit on one H100 before a single activation is stored.
src/recompute.py). About 165 GB in all, twice what the GPU holds, before a second sequence.The rule behind the bar: mixed-precision Adam holds about 16 bytes per parameter before activations, 2 for bf16 weights, 2 for bf16 gradients and 12 for the fp32 master weights and the two Adam moments (ZeRO §3.1). So plain data parallelism stops fitting above about 5B parameters on an 80 GB GPU (80 / 16 derived), and a 7.5B model needs 120 GB on every GPU. Activations come on top and grow with sequence length and micro-batch: about 34sbh bytes per layer for a GPT-style layer once the attention score matrix is not stored (Korthikanti et al. 2022), 36.5 GB for one 8,192-token sequence through Llama 3 8B's 32 layers derived. Every split below removes one of these four blocks from each GPU, or a share of it.
MT-NLG counts fp32 gradient copies and gets 20 (Smith et al. 2022 §2.1.1); Llama 3 accumulates and reduces gradients in FP32 (§3.3.2), about 18 on our reading derived; DeepSeek-V3 keeps fp32 master weights and gradients but bf16 Adam moments (§3.3), about 14 with a bf16 working copy derived; an 8-bit optimiser is less. The Layout calculator offers all four. Training against LoRA and QLoRA fine-tuning, model by model, is PEFT's memory calculator (section "Memory: full fine-tuning, LoRA and QLoRA").
Every split talks through five operations that all GPUs in a group call together. Fig. 3 runs them on four GPUs, each holding four chunks of a buffer:
The ring factors are nccl-tests'; since the bytes per GPU barely change with the group size, the slowest link sets the time. Because a ring all-reduce is exactly a reduce-scatter followed by an all-gather, ZeRO-1 and ZeRO-2 cost what DDP costs (Ultra-Scale Playbook). Inside an H100 server NVLink gives each GPU 450 GB/s each way; between servers each GPU has its own 400 Gb/s card, 50 GB/s, nine times less (Llama 3 used RoCE and InfiniBand at 400 Gb/s per GPU, §3.3.1); DeepSeek's export-limited H800s have NVLink at 160 GB/s, "roughly 3.2 times that of IB (50 GB/s)" (DeepSeek-V3 §3.2.2). That ratio pins each split to a level of the network.
Per GPU per step, for Llama 3.1 8B on 8 GPUs (BF16): DDP all-reduces 28.1 GB of gradients; FSDP moves 42.2 GB (1.5 × DDP: two weight gathers and a gradient reduce-scatter); tensor parallelism 0.47 GB per layer, on the critical path; a pipeline boundary 67 MB per micro-batch; expert parallelism at most 229 KB per token per MoE layer (DeepSeek-V3). The formulas behind each number and the time on each link: Performance math, section 8.
Implemented in: Interconnects and scaling section 7 and its Collective simulator (ring, tree and other algorithms timed on each link; a gradient all-reduce carries 16.1 GB for Llama 3 8B, 141 GB at 70B); Distributed PyTorch section 2; Launching distributed training section 6 (the NCCL communicator and its timeouts).
Replicate the model on every GPU and give each replica a different micro-batch. After backward, an all-reduce averages the gradients, so every replica takes the identical optimiser step. Fig. 4 plays one step of Llama 3 8B on four GPUs, four sequences of 8,192 tokens (given one sequence of 32,768 instead, three GPUs would have nothing to do: data parallelism cannot cut a single sequence). The same step, on the same four GPUs, returns under every split below:
DDP sends the gradients in buckets (25 MiB by default in PyTorch's DistributedDataParallel) as soon as each is ready, so the all-reduce overlaps the rest of backward. PyTorch's old DataParallel was a single process driving the GPUs of one machine by threads; DDP runs one process per GPU, works across machines, and is the baseline everything else builds on (Li et al. 2020). It scales nearly linearly while the all-reduce hides behind backward, and that has a size condition: a replica sends about 2 × 2Ψ bytes and computes 6Ψ FLOPs per token, so the transfer hides when each replica processes T ≥ 2I/3 tokens per step, where I is the GPU's sustained FLOP/s over the link's bytes per second. For an H100 at 40% of its BF16 peak over a 400 Gb/s card that is about 5,300 tokens per replica (Interconnects and scaling section 9 derived); Llama 3 405B's 16M-token batches over 128 replicas give 131,072 tokens each, far above it.
Its cost is memory: the full 16 bytes per parameter on every GPU, the ceiling ZeRO and FSDP remove. The global batch is micro-batch × gradient-accumulation steps × data-parallel degree (Playbook), so DP is also how a layout reaches its target batch once the model fits, and a fixed token budget per step caps it: Llama 3's 16K-GPU run had fewer sequences per DP rank than its 8K-GPU run and a lower MFU (41% against 43%, §3.3.2).
Implemented in: Distributed PyTorch section 3 (DDP's reducer, buckets, comm hooks); Sharding and scale (JAX); Launching distributed training (torchrun, rendezvous).
Data parallelism stores the same 16 bytes per parameter n times. ZeRO (paper page, Rajbhandari et al. 2019) shards them across the data-parallel group instead, in three stages.
ZeRO-1 shards the optimiser state: each GPU updates its 1/n of the fp32 master weights, then an all-gather shares the updated bf16 weights. ZeRO-2 also shards the gradients, reduce-scattered as backward produces them; stages 1 and 2 send what DDP sends. ZeRO-3 also shards the parameters: each layer's weights are all-gathered just in time for forward and again for backward, then freed. Communication is 3Ψ against DP's 2Ψ, 1.5 times (§7), and model-state memory falls as 1/N.
Model states per GPU for 7.5B parameters, full bar 120 GB. ZeRO-1 keeps 4 + 12/n bytes per parameter, ZeRO-2 2 + 14/n, ZeRO-3 16/n. At n = 64 the bars reproduce ZeRO Table 1 independently: 31.4, 16.6 and 1.88 GB.
Fig. 6 plays the same step as Fig. 4 under each stage, and under hybrid sharding (HSDP) across two servers. Pick one; the readout under the steps compares it with DP: the slabs fall to a quarter under ZeRO-3 while the bytes grow by half, and HSDP sends only 8.0 GB per GPU across InfiniBand.
The extra gathers are not free: with gradient accumulation ZeRO-3 gathers the weights again for every micro-batch, forward and backward, and across servers that traffic lands on the slow link; HSDP or ZeRO-2 are the usual fixes. Re-gathering for backward is itself a choice: keeping each layer's gathered weights from forward to backward saves the second all-gather (2Ψ again instead of 3Ψ) for activation-like memory. FSDP2's reshard_after_forward controls it (by default every module reshards except the root); XLA kept the weights on the Sharding and scale (JAX) page's measured run; Llama 3's FSDP shards optimiser state and gradients but keeps weights gathered after forward (§3.3.2).
FSDP is PyTorch's native version, "motivated by" ZeRO with a design aligned with the rest of PyTorch (Zhao et al. 2023); its default full sharding is ZeRO-3, and it has a ZeRO-2-like mode as well. FSDP2 (fully_shard) shards each parameter on its own dimension 0 as a DTensor, so it composes with TP, PP and EP on a device mesh. The 2026 default: on PyTorch, without a need for NVMe offload, use FSDP2 rather than DeepSpeed; the arithmetic is the same, the composition cleaner.
Hybrid sharding (HSDP) builds "a 2-D DeviceMesh that contains replica groups on one dimension and shard groups on the other" (torchtitan paper): FSDP-shard within a server (or a small group), DDP-replicate across groups. The heavy per-layer all-gathers stay on NVLink and only the gradient all-reduce crosses servers (8.0 GB per GPU on InfiniBand against 36.1 GB for ZeRO-3 across both servers). It also bounds the blast radius of a failure: a lost server leaves complete replicas, which is how torchft does "fault tolerance across the replicated dimension". Use it when the model fits in one server's (or group's) aggregate memory.
state_dict handling is sane through Distributed Checkpoint (DCP), and partial freezing works, so LoRA-style fine-tuning is straightforward.Implemented in: Distributed PyTorch section 4 (FSDP2, HSDP, prefetching, state dicts); Sharding and scale (JAX) (FSDP along a mesh axis, measured).
Tensor parallelism splits individual weight matrices across GPUs (Megatron-LM): a column-parallel matrix followed by a row-parallel one, in the feed-forward block and in attention (heads are divided among GPUs). Fig. 7 runs one feed-forward block on two GPUs, in Megatron-LM's notation (Y = GeLU(X·A), Z = Y·B), first as plain TP, then with sequence parallelism:
Sequence parallelism (Megatron-style) extends TP to the regions TP leaves replicated, LayerNorm and dropout, by splitting their activations along the sequence. The all-reduce becomes a reduce-scatter plus an all-gather of the same total size, so communication is unchanged and the duplicated activation memory disappears: activations per layer fall from sbh(34 + 5as/h) to sbh/t(34 + 5as/h), and with selective recomputation to 34sbh/t (Korthikanti et al. 2022). One small collective appears: each GPU ran the LayerNorm on its own tokens, so the LayerNorm weights' gradients are partial sums and need an all-reduce over the TP group (recorded on Distributed PyTorch section 6). It is not context parallelism (section 8): it lives inside the TP group and leaves attention whole.
That is two all-reduces per layer forward and two backward, inside every layer, in small latency-bound messages on the critical path: the next matmul needs the result, so overlap cannot hide them. Fig. 8: four GPUs, the same step as before:
TP sends 51.5 GB per GPU for this step, more than any other split, and its bytes per FLOP do not depend on the batch at all, only on the degree, the hidden size and the link, so a slow link cannot be bought back with bigger batches: for Llama 3.1 70B at TP 8 over a 400 Gb/s card the communication is 141% of the compute (Interconnects and scaling section 9 derived). Hence Megatron's guidance, TP "up to degree g when using g-GPU servers", then pipeline parallelism across servers (Narayanan et al. 2021); the Playbook measured "around 43% performance degradation" when TP crosses nodes, against 14% for PP. Keep the degree a divisor of the number of heads (of KV heads, with grouped-query attention): otherwise the attention has to be reshuffled, and the JAX page measured 1.33 times the predicted bytes for 4 heads over 8 devices.
Implemented in: Distributed PyTorch sections 5 and 6 (DTensor, TP and SP on a real block); Sharding and scale (JAX); the Megatron-LM page's section Method: the f and g operators, which splits a layer on real matrices.
Pipeline parallelism splits the model into stages of consecutive layers, one per GPU or group. Only activations (forward) and their gradients (backward) cross a stage boundary, 2sbh bytes per micro-batch each way, so PP is cheap on bandwidth and is the preferred way to split a model across servers. Run naively, one batch at a time, only one stage works while the others wait: the bubble. Cutting the batch into m micro-batches lets stages work on different micro-batches at once. Fig. 9: four stages, four micro-batches, the 1F1B schedule, with the timeline on the floor:
The idle share of the timeline is (p − 1)/(m + p − 1), 43% here; Megatron writes the same bubble as (p − 1)/m of the ideal time, 75%.
A schedule decides the order of forwards and backwards:
The default is DeepSeek's DualPipe README example, 8 stages and 20 micro-batches; at m = 8 the GPipe and 1F1B rows rise to 88% of the ideal time. Rows use illustrative chunk times (forward 1, full backward 2, weight-gradient part 1), which is what makes ZB-H1 exactly a third of 1F1B.
The price of PP is the bubble, a batch-size constraint (enough micro-batches per step), uneven memory (the first stage holds the most activations, and the embedding) and invasive code changes. Rank-by-rank schedule animations are linked rather than rebuilt: the DeepSeek page (Training systems section) runs 1F1B, ZB1P, DualPipe and DualPipeV, and the Llama 3 page's Run the 16K-GPU job tab simulates Llama 3's interleaved schedule with its tunable micro-batch grouping.
Implemented in: Distributed PyTorch section 8 (every PyTorch schedule, measured); Sharding and scale (JAX) (by hand with shard_map).
In a mixture-of-experts model each token visits only k of E feed-forward experts, so the experts can live on different GPUs. Tokens travel to their experts in an all-to-all dispatch and come back in an all-to-all combine, around every MoE layer, forward and backward; attention and the other dense parts stay replicated (data parallel) or are split another way. The step uses an MoE twin of Llama 3 8B illustrative: every feed-forward block becomes four experts the size of the original, each token routed to one (Switch-style top-1), so each token costs the same compute and the model grows to 24.9B parameters. Fig. 11 plays its step:
Per GPU the twin needs what the dense model needed, 128.5 GB, while holding three times the parameters: expert parallelism spreads the experts but does not shrink the dense state, so it is combined with FSDP, ZeRO-1 or TP for that. As Mixtral's paper puts it, tokens "are routed to the corresponding GPU for processing, and the expert's output is returned to the original token location", and EP "introduces challenges in load balancing" (Mixtral §2.1): the busiest GPU sets the pace. Given one 32,768-token sequence on GPU 0 instead of four sequences, GPU 0 would send 20.1 GB in the step, against 13.6 GB each when the tokens are spread: a hot spot (the busiest GPU's count derived, src/recompute.py).
At scale. DeepSeek-V3's layout (256 fine-grained routed experts per layer, 8 per token, 64-way EP over 8 nodes, each token capped at 4 nodes so it crosses InfiniBand once and NVLink forwards it, dispatch in FP8) is worked through on Mixture of experts, section 7, and on the DeepSeek-V3 paper page (§3.2). What it means for the training layout: 20 of each H800's SMs drive the communication, and even so cross-node EP gave "an inefficient computation-to-communication ratio of approximately 1:1", the reason DualPipe (section 6) overlaps the two. The Layout calculator's DeepSeek-V3 preset recomputes that ratio independently as 1.39 : 1.
Experts were sharded across devices with all-to-all routing by GShard (Lepikhin et al. 2020, the work DeepSeek-V3 cites for EP); Switch Transformers simplified routing to one expert and laid out how expert, data and model parallelism combine (§5, its Figure 9 redrawn on that page). Qwen3's MoE models (Qwen3-235B-A22B: 128 experts, 8 per token, config.json) are trained and fine-tuned with expert parallelism in Megatron-based stacks (ms-swift guide); Qwen has not published its own pretraining layout unconfirmed. The memory side of long-context MoE training (dispatch buffers, the vocabulary projection, checkpoints, optimiser state) is worked through on the MoE training memory bottlenecks paper page.
Implemented in: Mixture of experts section 7; Interconnects and scaling section 8 (all-to-all on the wire); Sharding and scale (JAX) (by hand).
Context parallelism shards the sequence dimension of the activations across GPUs, for long-context training where activation memory, which grows with sequence length, is what no longer fits. Token-wise layers (the feed-forward block, norms) need nothing from other GPUs; attention does, because every query needs the keys and values of earlier tokens. Causal attention makes late tokens more expensive than early ones, so the sequence is cut into 2 × CP chunks and rank i takes chunks i and 2 × CP − 1 − i (Llama 3). Fig. 12 plays the step:
Each GPU holds a quarter of the activations whether the batch is four sequences or one, but the weights stay whole (128.5 GB), so CP is combined with FSDP or TP.
There are three ways to bring the keys and values to the queries:
K,V blocks travel round the ring, n − 1 passes, each overlapped with attention on the block already received.
Every GPU gathers all keys and values once, then attends its own queries. Exposed, but small with GQA.
An all-to-all swaps the split: tokens by GPU become heads by GPU, ordinary attention runs, a second all-to-all swaps back.
Llama 3 used CP = 16 for its 128K-context phase (Table 4). PyTorch's context parallel, shipped in torchtitan, implements Ring Attention with two rotation methods, ring passing and all-gather, defaulting to all-gather, and trained Llama 3 8B on 1M-token sequences on 32 H100s (PyTorch).
Implemented in: Distributed PyTorch section 7 (ring attention on a CPU); Sharding and scale (JAX) (ring against all-gather, measured).
Real runs stack the splits on a mesh of GPUs. The standard order, outermost to innermost: DP (FSDP or HSDP) × PP × CP × TP (+SP), with EP as a further axis for MoE layers. Llama 3 orders its groups [TP, CP, PP, DP] from innermost to outermost because "the innermost parallelism requires the highest network bandwidth and lowest latency, and hence is usually constrained to within the same server", while DP tolerates latency by prefetching weights and reducing gradients asynchronously (§3.3.2).
Fig. 14 draws two published layouts as meshes of GPUs, axis by axis, with the bytes and seconds per GPU per step that the Layout calculator computes for each axis:
Fig. 14's numbers are from the Layout calculator's presets derived: Llama 3 405B at TP 8 × PP 16 × DP 128 sends 236.8 GB per GPU per step over NVLink for TP (0.53 s), 18.9 GB over the network for DP (0.38 s) and 1.07 GB for PP (0.02 s), against 6.15 s of compute at 41% MFU; DeepSeek-V3's 64-way EP sends 704 GB over InfiniBand (14.1 s) against 20.4 s of compute. Peak bandwidths, no overlap credited.
| Run | GPUs | TP | CP | PP | EP | DP | Notes |
|---|---|---|---|---|---|---|---|
| Llama 3 405B, 8K, first stage | 8,192 | 8 | 1 | 16 | 1 | 64 | 16M tokens per batch; 43% BF16 MFU |
| Llama 3 405B, 8K | 16,384 | 8 | 1 | 16 | 1 | 128 | 41%; FSDP shards optimiser state and gradients but keeps weights gathered after forward |
| Llama 3 405B, 128K | 16,384 | 8 | 16 | 16 | 1 | 8 | 38% |
| DeepSeek-V3 671B | 2,048 | 1 | 1 | 16 | 64 | 128 | ZeRO-1 data parallel; DualPipe; "without using costly tensor parallelism" |
Sources: Llama 3 Table 4 (the 41% row computes to 40.4%, 400 / 989.5, a rounding the Llama 3 page also flags); DeepSeek-V3 §3.2, DP = 2,048 / 16 derived, with the 64-way EP carved out of each stage's 128 data-parallel GPUs. The Megatron-LM page's Then and now tab lays out more runs from 2019 to 2026, and the Llama 3 page maps every rank of its mesh.
Rules of thumb, from the Ultra-Scale Playbook's 4,100 benchmarked runs on up to 512 GPUs (step 1, "Fitting a training step in memory"):
Implemented in: Distributed PyTorch section 10 (the torchtitan order); Sharding and scale (JAX) (choosing a mesh); Interconnects and scaling section 9 (why the network picks your parallelism); Launching distributed training; Fault tolerance at scale (checkpoint, restart, goodput).
Instead of storing every activation for backward, store a few and recompute the rest. One 8,192-token sequence through Llama 3 8B, no tensor parallelism:
Full recomputation (keep only each layer's input) costs 30 to 40% more execution time (36% measured); selective recomputation of only the attention core, the large but cheap part, cuts activation memory about 5 times for 2.7% (GPT-3) or 1.6% (MT-NLG) extra FLOPs (Korthikanti et al. 2022; the Playbook quotes 70% less activation memory for 2.7% compute). FlashAttention already recomputes attention in its backward pass instead of storing the score matrix, which is why selective checkpointing pairs naturally with it. Llama 3 trained 8K sequences with no activation checkpointing at all, after deallocating stage inputs and outputs it no longer needed (§3.3.2).
Per layer sbh(34 + 5as/h) bytes when the attention scores are stored, 34sbh when the attention core is recomputed (selective, or FlashAttention), 2sbh plus one layer's working set with full recomputation (Korthikanti et al. 2022), times 32 layers at s = 8,192, h = 4,096, a = 32 derived, a GPT-style estimate (Llama's SwiGLU and GQA change the constants).
torch.compile and low-precision training. The 2026 survey's advice is to "use torchtitan as a pattern source, not as a dependency".FSDP2 with HSDP covers the great majority of fine-tuning and pretraining below about 70B; full 4D parallelism is needed only at frontier scale. Schedulers, checkpoint cadence and fault tolerance at 16,000 GPUs are summarised in the parent's "Running the job" section (Topic: llm-training-and-post-training) and owned by Fault tolerance at scale; number formats for training (FP8, MXFP4) on Quantization and Precision.
FSDP2 with per-parameter sharding, tensor parallel (including async TP), pipeline parallel (including zero-bubble schedules), context parallel, DDP and HSDP, per-op selective and full activation checkpointing, torch.compile, low-precision training (MXFP8 and NVFP4 today; the paper's Float8), Distributed Checkpoint with async saves, torchft fault tolerance (README). Its paper reports 65.08% speed-up on Llama 3.1 8B at 128 GPUs (1D), 12.59% on 70B at 256 GPUs (2D) and 30% on 405B at 512 GPUs (3D) over its own baselines reported.
All counts are for Llama 3 8B in bf16 with fp32 Adam (16 bytes per parameter), 4 GPUs on NVLink (HSDP: two servers joined by InfiniBand). Bytes are per GPU and sent, not received, from the ring formulas; activations use Korthikanti et al.'s 34sbh per layer, a GPT-style estimate, and in the EP step its 15 : 19 split between attention and MLP illustrative. Bars are to scale with a full bar = 280 GB. With one 32K sequence, DP and ZeRO leave three GPUs idle, PP idles 75% of the time, and only TP and CP split the sequence's 146 GB of activations. Every number is recomputed in src/recompute.py, and src/check_calc.mjs confirms the page's JavaScript gives the same numbers.
Pick a model and a layout, TP × CP × PP × DP (plus EP for an MoE model), and see what one GPU holds and what it sends in one optimiser step, axis by axis, on the link that axis lands on. It is the arithmetic of the Reading step-throughs at real scale. Training time in GPU-days for a model size and token budget is the parent page's Scaling calculator tab; this tab only uses compute to put the communication in proportion.
Try: start from Llama 3 405B on 16,384 GPUs, then switch the preset to 128K context: CP = 16 takes the sixteen-fold longer sequences and activations per GPU do not move. Load DeepSeek-V3 and watch expert all-to-all dominate the step: that is the "approximately 1:1" computation-to-communication ratio DualPipe was built to hide. Set ZeRO to stage 0 on the ZeRO 7.5B preset to see 120 GB.
All formulas in src/recompute.py; src/check_calc.mjs confirms this page's JavaScript gives the same numbers for every preset.
Links open in a new tab. Times are estimates: for knowledge base pages, the Reading tab's word count at 230 words a minute.
One training step of Llama 3 8B on four GPUs, stepped through under DP, ZeRO-1/2/3, HSDP, TP, PP, EP and CP, each in its own section.
Memory and communication per GPU for any layout, with Llama 3 405B and DeepSeek-V3 presets.
Every split on this page as PyTorch code: c10d collectives, DDP's reducer, FSDP2, DTensor and TP, ring attention, every pipeline schedule measured, distributed checkpoints, torchtitan composition. (about 30 min)
The same splits as mesh shardings: GSPMD propagation, every strategy measured, ring attention, pipeline and expert parallelism by hand, many hosts. (about 45 min)
The wire under every collective: NVLink, InfiniBand and RoCE, collective algorithms with a Collective simulator, all-to-all, and why the network picks your parallelism. (about 30 min)
Starting the ranks: torchrun, rendezvous, building the NCCL communicator, every timeout, and debugging hangs. (about 35 min)
Section 7: expert parallelism and the all-to-all, with DeepSeek-V3's node-limited routing. (about 35 min)
The parent: training stages compared; its Machinery section has the one-line parallelism table (pointing to this page's sections), its Scaling calculator tab the FLOPs and GPU-days. (22 min, plus 22 in closed details)
What fails at 16,000 GPUs and how runs recover: detection, checkpoint and restart, replica groups, goodput. The parent's Machinery section summarises the stack and the frameworks. (35 min read)
FP8 and 4-bit training: the other way to cut bytes per parameter and per message. (34 min, plus 11 in closed details)
The runs these layouts serve: objectives, scaling laws, data curricula. (30 min, plus 4 in closed details)
The accelerators, NVLink domains and networks the layouts are mapped onto. (31 min read · +9h 13m resources)
Lab page; its Training systems section has the DualPipe and 1F1B schedule simulator, its Serving section EPLB. (26 min, plus 6 in closed details)
Sharded data parallelism; DDP against each stage, stepped layer by layer in its Communication section; stage names then and now. (24 min, plus 2 in closed details)
Tensor parallelism; a layer split on real matrices; parallel layouts from 2019 to 2026. (23 min, plus 6 in closed details)
Top-1 routing; data, model and expert parallelism combined (§5, Figure 9 redrawn). (about 26 min)
Expert parallelism and its load-balancing problem in a deployed MoE. (about 24 min)
DualPipe, node-limited all-to-all, ZeRO-1 without TP, FP8 training. (about 32 min)
4D parallelism on 16K H100s: rank mapper, interleaved pipeline simulator, 54 days of interruptions replayed. (about 31 min)
The four memory peaks of long-context MoE training and how to schedule them. (about 32 min)
Attention without storing the score matrix, the reason selective recomputation is cheap. (about 26 min)
The canonical walk from single-GPU memory anatomy through DP, ZeRO, TP, PP, CP and EP and how to combine them, built on over 4,100 benchmarked runs on up to 512 GPUs. (about 8h)
Per-parameter DTensor sharding, reshard after forward, mixed precision, HSDP meshes. (docs, about 30 min)
How PyTorch composes FSDP2, TP, PP and CP natively, with measured gains up to 405B. (45 min)
A current practical comparison of when to use which. (about 25 min)
PTD-P: TP inside servers, PP across, the 1F1B and interleaved schedules; 502 PFLOP/s on 3,072 GPUs at 52% of peak for 1T parameters. (paper, about 45 min)
Sequence parallelism, selective recomputation and the 34sbh activation formula. (paper, about 40 min)
Splitting backward into B and W; ZB-H1 and ZB-H2. (paper, about 35 min)
The two schedules every later pipeline improves on. (papers, about 30 min each)
The two families of context parallelism. (papers, about 30 min each)
Experts sharded across devices with all-to-all routing: where expert parallelism starts. (paper, about 40 min)
How PyTorch implements sharded and plain data parallelism, buckets and overlap included. (papers, about 30 min each)
Optimiser state and parameters pushed to CPU memory and NVMe. (papers, about 30 min each)
Algorithm against bus bandwidth, and the ring factors used throughout this page. (10 min)
The frameworks' repositories and feature lists. (10 min each)