Unit 12 of 14 · about 4 hours · explain, implement
Health checks, canaries, rollback, runbooks and fleet anomaly detection
Fleets fail in the same few ways. Checks that match those modes plus a rehearsed runbook turn incidents into routine requeues.
You'll be able to
- Design health checks, canaries and rollback gates for a training fleet.
- Write a runbook that maps symptom to evidence to cause for hangs, OOMs and stragglers.
- Explain fleet anomaly detection over telemetry including gray slow failures.
Covers
Read
In this order, only the parts listed
0 of 4 done
- Debugging utilization and fleet telemetryMachine Learning Systems Volume II - Fleet Orchestration and Performance Engineering
Debugging Cluster Utilization with policy-topology mismatch diagnosis, and Cost Optimization with spot and checkpoint-on-preemption strategy
- Canaries and gray failures at scaleMachine Learning Systems Volume II - Fleet Orchestration and Performance Engineering
Measurement at Scale with fleet MFU, scaling tax, tiered canaries and gray straggler detection
- Heartbeat, diagnosis and fast restartMegaScale: Scaling Large Language Model Training to More Than 10,000 GPUs
arXiv:2402.15627v1, Section 4: heartbeat-based detection, automated fault localization and fast recovery
- Faulty-node triage in SlurmMachine Learning Engineering Open Book - Network, Debug, Training Performance and Orchestration
Find faulty nodes and exclude them, with the GPU memory check, the NCCL barrier test and the network failure exclusion pattern
Focus on
- Health checks must match the failure taxonomy: GPU access, link errors, memory, plus an NCCL barrier test for collective hangs. Run them at alloc and re-run after any hang before requeue.
- A canary is a small fixed workload that must pass before and after each change. Rollback returns to the last-known-good config and checkpoint when it fails.
- Gray failures are slow, not dead: limping links, throttled clocks, skewed input. Tiered canaries plus MFU and scaling-tax trends catch what binary alive checks miss.
Common mistakes · 3
- Health checks without a collective test. GPUs can pass memory checks yet hang every all-reduce on a broken link.
- Canaries without a fixed workload. An unpinned canary passes or fails for workload reasons, hiding the regression.
- Auto-restart onto the same nodes. Without exclusion the job repeats the failure and burns goodput.
Try it yourself
Closed-book, before checking anything
NCCL_DEBUG=INFO, the desync report and fr_trace plus per-rank times, a cause table, and actions for exclude, rollback and requeue.Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.What belongs in a pre-flight health check?Answer
GPU access and memory, link error counters, interface selection, a small NCCL barrier or all-reduce, and storage reachability. Each maps to a known failure mode.
2.How do canary and rollback work together?Answer
The canary gates promotion: it must pass on the new config. On failure, rollback restores the last-known-good code, config and checkpoint.
3.What is a gray failure and what catches it?Answer
A component that is slow rather than dead, such as a degraded link. Trend canaries, per-rank timing skew and MFU drops catch it; alive checks do not.
You're done when
Your runbook resolves one injected failure to exclusion plus rollback plus requeue, with the evidence trail attached.
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.
- 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. - 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.
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.
- 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. - 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.