Unit 2 of 14 · about 4 hours · derive
Strong and weak scaling efficiency and goodput under failures
More ranks can raise utilization while lowering useful output once failures, restarts and stragglers dominate. This unit separates busy hardware from finished work.
You'll be able to
- Define strong scaling, weak scaling and parallel efficiency, stating the fixed quantity in each.
- Derive goodput with failures, retries and unusable work for one job size from failure rate and restart cost.
- Explain why high device utilization can coexist with poor useful throughput.
Covers
Read
In this order, only the parts listed
0 of 3 done
- Scheduling, fragmentation and utilization gradesMachine Learning Systems Volume II - Fleet Orchestration and Performance Engineering
The Scheduling Problem with gang scheduling and fragmentation math, and Debugging Cluster Utilization with allocated versus productive utilization
- MegaScale scaling and straggler evidenceMegaScale: Scaling Large Language Model Training to More Than 10,000 GPUs
arXiv:2402.15627v1, Sections 4 to 6: heartbeat fault loop, straggler mitigation and 55.2 percent MFU on 12,288 GPUs for a 175B model
Treat the MFU and speedup as that cluster's results. Reproduce the method, not the numbers.
- Failure taxonomy and MTTF versus job sizeRevisiting Reliability in Large-Scale Machine Learning Research Clusters
arXiv:2410.21680v2, Sections 2 and 5: RSC cluster design, failure taxonomy and MTTF analysis with scheduler-side requeue metrics
Model goodput for one job size only. Do not merge these research-cluster numbers with Llama 3 production counts.
Focus on
- Strong scaling fixes the global problem and grows ranks. Weak scaling grows the problem with ranks, usually tokens per GPU. Efficiency is speedup over ranks, or throughput over ranks versus the baseline.
- Goodput discounts failed, repeated and unusable work: restarts, preemption, straggler idle and checkpoint overhead. Busy GPUs doing repeated work raise utilization but not goodput.
- Failure rate grows with job size, so large jobs pay more checkpoint and restart tax. Every MTTF number is cluster-specific.
Common mistakes · 3
- Quoting weak-scaling efficiency without stating what is held fixed per rank (tokens, batch or model shard).
- Merging interruption counts across studies. Llama 3 Table 5 and the Meta reliability MTTF come from different clusters and mixes.
- Treating device utilization as useful throughput when restarts, retries and straggler idle consume the hours.
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.What is fixed in strong scaling versus weak scaling?Answer
Strong scaling fixes the global problem size. Weak scaling grows it with ranks, typically holding tokens or work per rank fixed.
2.Four ranks cut step time from 100 ms to 30 ms. What are speedup and efficiency?Answer
Speedup . Efficiency percent against the single-rank baseline.
3.How can utilization read 90 percent while goodput is poor?Answer
GPUs stay busy on repeated, failed or unusable work: restarts after interruptions, straggler waiting, and checkpoint overhead all count as utilized but not useful.
4.Why does MTTF fall as job size grows, and what follows for checkpointing?Answer
More components mean more chances per hour that one fails. Larger jobs need cheaper checkpoints and faster restart because interruptions arrive sooner.
Practice
- CS336 Assignment 2:
data_parallel_calcsandfsdp_calcsSection 8.2
data_parallel_calcsand Section 8.3fsdp_calcsin the Spring 2026 handout: backward FLOPs, backward communication time and the bottleneck inequality in batch, dimension and bandwidth termsAnalytic problems graded by the handout. Compare one prediction with a measurement on your hardware where it can run honestly.
You're done when
You can derive efficiency and goodput for one job size from stated failure and restart numbers, and name which cluster each number came from.
Only when you can do this without notes.
Leads to
Notes
Resources · 3 for this unit, 8 more in the section
- Machine Learning Systems Volume II - Fleet Orchestration and Performance EngineeringML Systems Textbook · primary
Read Scheduling Problem, Orchestration Paradigms, Topology-Aware Scheduling, Elastic Scheduling, Cost Optimization, Multi-Tenancy and Quotas and Debugging Cluster Utilization, then Memory Wall and Roofline Diagnosis, Graph Compilation, Communication-Computation Overlap, System Profiling and Measurement at Scale at https://mlsysbook.ai/vol2/performance_engineering/performance_engineering.html. Use the framework to choose one bottleneck-specific lab and one rollback metric.
- MegaScale: Scaling Large Language Model Training to More Than 10,000 GPUsJiang et al. (NSDI 2024) · support
Read the efficiency optimizations, the fault-tolerance loop (heartbeats, diagnostics, fast restart) and the straggler and diagnosis tooling. Its MFU and scale numbers are its own cluster's results.
- Revisiting Reliability in Large-Scale Machine Learning Research ClustersKokolis et al. (2024) · support
Read the failure taxonomy, mean time to failure versus job size and the scheduler-side metrics. Use them to model goodput with failures for one job size.
Also in this section
- AI Systems Performance Engineering - Chapters 1 to 5, 13 and 14Chris Fregly (O'Reilly) · required
Use Chapter 1 for goodput and reproducibility, Chapters 2 to 5 for topology, orchestration, communication, storage and the data pipeline, Chapter 13 for PyTorch profiling and scaling, and the Chapter 14 sections on graph breaks and recompilation. Run only the companion labs for the bottleneck you observe, preserve workload correctness and record hardware assumptions.
- Machine Learning Engineering Open Book - Network, Debug, Training Performance and OrchestrationStas Bekman · required
Use
network/debug/README.md, the hang, crash and OOM sections ofdebug/pytorch.md,training/performance/README.md,storage/README.mdandorchestration/slurm/users.mdas an incident-driven reference. Build one symptom-to-evidence-to-cause runbook rather than reading every page. - PyTorch Flight Recorder TutorialsPyTorch · support
Read the environment-variable Flight Recorder tutorial (trace buffer, dump on timeout,
fr_traceanalysis), then the newer tutorial at https://docs.pytorch.org/tutorials/intermediate/debug_hangs_with_flight_recorder.html, which needstorchcommsand can run on CPU with Gloo. Diagnose one injected hang from per-rank dumps. - How to Scale Your Model - Chapters 1, 5, 9 and 12Google DeepMind · required
Use rooflines, training cost models, profiling workflow and GPU topology to predict the dominant limit of one run. Compare the prediction with a trace and quantify the residual before proposing a change.
- CS336 Assignment 2 (Spring 2026) - Profiling and Parallelism AnalysisStanford University · required
Revisit Section 2 profiling and Section 8 communication analysis. Produce warmup-controlled timing, Nsight or PyTorch traces, memory evidence and analytic DP, FSDP, TP and 2D comparisons on configurations you can execute honestly.
- Ultra-Scale Playbook - Benchmarking ConfigurationsHugging Face · support
Study the configuration-search experiments and Lessons learned on benchmarking as method. Its heatmaps are its own H100 cluster's results; reproduce the method on a tiny legal search space, separating analytic predictions, simulations and measurements.
- TorchTitanPyTorch · depth
Read
docs/debugging.md(memory snapshots, fake-backend modes, Flight Recorder dumps) and the CPU unit tests undertests/unit_tests/cpu/, then the configuration, metrics, profiling, checkpoint and parallelization seams at a pinned commit. Select one bounded issue or measurable improvement and follow the contribution standards; do not attempt a wholesale rewrite. - Distributed Training Systems LaboratoryRoadmap-Final · support
Complete the capstone with a fixed workload, correctness oracle, analytic plan, fault campaign, aligned traces and one real-code extension. Label CPU simulation, single-GPU evidence and multi-GPU evidence separately.