Unit 1 of 13 · about 4 hours · explain, derive
The parallel dimensions and world-size factorization
A planner must count physical ranks once even when their ownership changes between dense and expert layers. Start from the mechanisms you built in DT-3 through DT-7, not a list of parallelism labels.
You'll be able to
- Identify the state or tensor dimension partitioned by each strategy and the communication it introduces.
- Derive world size from independent mesh axes without counting SP or a reused expert mesh twice.
- Distinguish data replicas, state-sharding groups and expert replicas in one composed plan.
Covers
Read
In this order, only the parts listed
0 of 2 done
- The strategies as one ownership mapThe Ultra-Scale Playbook - 5D Parallelism and Finding the Best Configuration
5D Parallelism in a Nutshell, including Scope and focus and Summarizing it all
- Dense and sparse meshes reuse the same worldTorchFeather - ParallelDims and Composition Plan
ParallelDims._validateandbuild_mesh, especially thedataloading,denseandsparsemesh productsTrace the products and ownership only. Do not copy the private mesh methods into your planner. The trainer package requires PyTorch 2.11 up to but excluding 2.12; that range is an implementation convention, not a current public API contract.
Focus on
- For an independent dense mesh, write , with replicated DP, sharded DP, TP, CP and PP degrees respectively. FSDP describes state ownership on existing ranks, not another factor.
- Megatron-style SP uses the TP group for selected sequence-sharded activations. It does not add ranks. CP is a separate sequence axis in this mesh.
- TorchFeather uses for expert-FSDP, EP and expert-TP degrees. The expert mesh refactors the same ranks; dense and expert state have different owners.
Common mistakes · 2
- Treating every named strategy as an independent axis. Ask whether it introduces new ranks or changes ownership on existing ranks.
- Using the data-replica count for every gradient reduction. CP ranks contribute different tokens, and expert parameters have their own replication groups.
Try it yourself
Closed-book, before checking anything
Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.Does enabling SP on an existing TP group double world size?Answer
No. It changes selected activation layouts on those ranks.
2.Why does CP not create new examples in the global batch?Answer
Its ranks own pieces of the same sequences. Their token contributions must be combined, not counted as independent copies of those sequences.
3.Can an expert parameter use the dense FSDP divisor without checking its mesh?Answer
No. EP assigns different experts to ranks, so the ranks holding replicas of one expert can be a smaller group than the dense FSDP group.
You're done when
Your ownership table accounts for all 16 ranks once in each mesh and names the reduction group for dense and expert gradients.
Only when you can do this without notes.
Leads to
Notes
Resources · 2 for this unit, 11 more in the section
- The Ultra-Scale Playbook - 5D Parallelism and Finding the Best ConfigurationHugging Face · primary
Study 5D Parallelism in a Nutshell, then Finding the Best Training Configuration (fitting a step in memory, reaching the global batch, optimizing throughput) at https://nanotron-ultrascale-playbook.static.hf.space/index.html#finding_the_best_training_configuration. Rebuild a small planner that enumerates legal DP, TP, CP, PP and EP degrees and ranks them by predicted memory and step time; its heatmaps are its own H100 cluster's results.
- TorchFeather - ParallelDims and Composition PlanTorchFeather · support
Inspect distributed/parallel_dims.py and model/parallelize.py. Build the exact mesh product and divisibility table for one FSDP, TP, CP, PP and EP configuration, then identify ordering assumptions in its composition.
Also in this section
- Picotron - 4D CompositionHugging Face · required
Trace create_config.py, process_group_manager.py and train.py across DP, TP, PP and CP. Run the CPU 3D example or a smaller equivalent, assert group membership and compare observed event order with the planner.
- First-Principles Video - Device Mesh Composition SegmentUmar Jamil · support
Watch 08:37:34 on device meshes and combining pipeline with data parallelism. Reconstruct its rank-coordinate table and compare it with Picotron process groups and your planner output.
- Distributed Training Guide - Chapter 7 FSDP plus TPLambda Labs · support
Read the 2D FSDP plus TP path in
07-2d-paralleland explain why FSDP is applied after TP and what limits the TP degree. Running it needs several GPUs. - How to Scale Your Model - Chapters 4 to 6Google DeepMind · required
Use Part 4 (transformer math), Part 5 (training parallelism) and Part 6 (LLaMA 3 case study) to independently estimate parameters, FLOPs, memory, communication, time and cost for one configuration, then the GPU rooflines in Part 12. Keep TPU constants labeled and compare its recommendation with the Playbook.
- Efficient Large-Scale Language Model Training on GPU Clusters Using Megatron-LMNarayanan et al. (SC 2021) · required
Read the composition of tensor, pipeline and data parallelism, the interleaved schedule and the performance analysis of parallel configurations. Check its guidance against your planner on one model and cluster.
- CS336 Assignment 2 (Spring 2026) - Section 8 Analyzing Parallelism StrategiesStanford University · required
Solve
data_parallel_calcs,fsdp_calcs,tp_calcsandfsdp_tp_calcs(Sections 8.2 to 8.5) with your planner, and reconcile any disagreement before trusting either. - Transformer Math 101 - Distributed TrainingEleutherAI · support
Use the sharded-optimizer, 3D-parallelism and activation equations as a cross-check of your planner's memory terms.
- TensorTonic - Choose a Topology-Aware Parallel PlanTensorTonic · support
Solve Choose a Topology-Aware Parallel Plan, then compare its memory and communication model with yours.
- NanotronHugging Face · depth
Inspect configuration, parallel context and trainer paths used by the Ultra-Scale benchmarks only after the planner works. Its "3D" means DP, TP and PP: there is no context or expert parallelism.
- Bumblebee - Parallel State and CompositionBumblebee · depth
Only as a possible capstone target: read
primitive/parallel/and the composition tests in a clean checkout to compare TP, EP, ETP, CP and PP contracts. Its multi-GPU paths are untested upstream. - HetPipe - Heterogeneous Partitioning and PlacementPark et al. · support
Read arXiv:2005.14038v1 Section 4, Pipelined Model Parallelism Within a VW, for its Model Partitioning paragraph, Section 7, Partitioning Algorithm, and Section 8.1, Methodology, for resource allocation to virtual workers. Reuse device-specific compute, memory and placement constraints in a synchronous simulator; do not adopt its stale-weight update semantics or source speedups.