Unit 10 of 14 · about 4 hours · explain, measure
Network, topology and placement regressions and numerical instability at scale
A slower step after a move or a dtype switch is two different failures. Placement changes the interconnect; precision changes the arithmetic. Each needs its own test.
You'll be able to
- Explain how placement across slow links produces a throughput regression at fixed workload.
- Detect a topology or placement regression from bandwidth and trace evidence.
- Detect numerical instability from a precision or scale change with equivalence tests.
Covers
Read
In this order, only the parts listed
0 of 4 done
- Topology, NCCL and multinode pitfallsAI Systems Performance Engineering - Chapters 1 to 5, 13 and 14
Chapter 2, Ultrascale Networking Treating Many GPUs as One, with NVLink and NVSwitch, and Chapter 4, Topology Awareness in NCCL with Multinode Communication Pitfalls
- NCCL transport diagnosisMachine Learning Engineering Open Book - Network, Debug, Training Performance and Orchestration
How to diagnose NCCL connectivity issues with
NCCL_DEBUG=INFO, interface selection viaNCCL_IB_HCAandNCCL_SOCKET_IFNAME, andNCCL_DEBUG_SUBSYSfor collective versus topology failures - Topology-aware placementMachine Learning Systems Volume II - Fleet Orchestration and Performance Engineering
Topology-Aware Scheduling with link tiers and compact pod placement, plus quarantine of bad nodes, racks or links from Elastic Scheduling
- Numerical correctness under precision changeAI Systems Performance Engineering - Chapters 1 to 5, 13 and 14
Chapter 14, Performance Hints and Debugging Generated Code plus Debugging Numerical Correctness and Accuracy
Focus on
- Moving collectives from NVLink to inter-node links cuts effective bandwidth severalfold. A scattered allocation or a degraded switch shows as stretched communication on traces with unchanged compute.
- Read bus bandwidth for the fabric and algorithm bandwidth for the workload. A busbw drop is the network; a stable busbw with slower steps is placement or overlap loss.
- Precision switches change range and rounding: FP16 overflows where BF16 survives, and larger scales reorder reductions. Gate every switch on loss and gradient equivalence within a derived tolerance plus overflow counters.
Common mistakes · 3
- Quoting microbenchmark busbw as a training speedup. The benchmark measures the fabric; the workload adds overlap, imbalance and launch effects.
- Blaming code for a fabric change. A new allocation, a replaced switch or a degraded link regresses throughput with identical code.
- Treating BF16 as a wider FP16. Subnormal handling, overflow thresholds and loss-scaling needs differ, so FP16 recipes do not transfer verbatim.
Try it yourself
Closed-book, before checking anything
NCCL_DEBUG=INFO interface and topology lines plus busbw, then the numerical check with reference loss and gradient comparison plus overflow counts.Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.Steps slow 20 percent with identical code and config. What do you check first?Answer
Placement and fabric: allocation map,
NCCL_DEBUG=INFOtransport lines, busbw versus history, and whether collectives crossed to slower links.2.Busbw is stable but steps are slower. What does that separate?Answer
Fabric health from workload placement and overlap. The links deliver, but collectives now cross slower tiers or hide less under compute.
3.What gates a precision switch?Answer
Loss and gradient equivalence against the reference within a derived tolerance, plus overflow and underflow counters, all at fixed workload and seed.
You're done when
You can separate a placement regression from a numerical regression on one slowed run, with the fabric and equivalence evidence named.
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.
- 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.
Also in this section
- 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. - 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.
- 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.