Fault Tolerance and Checkpointing
Measure failures, checkpoints, restart, and recovery
Calculate expected lost progress, design sharded portable checkpoints, distinguish a hang from a slow rank, and allocate resources for long-duration recovery objectives.
Imagine a seven-day training job that uses 512 devices, where each device is a graphics processing unit (GPU). One central processing unit (CPU) process controls each GPU. A healthy optimizer step takes 1.2 seconds, but one worker stops responding after 19 hours. The remaining workers wait in a collective for 11 minutes before a watchdog ends the job. Replacement allocation, process startup, and checkpoint restore take another 17 minutes, and the job repeats 43 minutes of training completed after its last usable checkpoint.
An incident timeline makes every interval observable. The launcher records process exit and replacement times. Application progress markers record the last completed step. NCCL reliability, availability, and serviceability status can identify an unresponsive process or inconsistent communicator state. Checkpoint metadata identifies the latest version whose shards were completely written and verified. The next valid optimizer step marks the end of recovery.
Healthy-step throughput excludes all of those intervals. Calendar progress includes checkpoint interference, failure detection, replacement, restore, warm-up, and repeated work. The job-level interruption rate must also be measured from completed jobs or incidents because one shared switch, storage service, or software rollout can interrupt many otherwise healthy devices at once.
This chapter turns the incident record into a checkpoint interval model, a portable state design, a progress-detection policy, and a resource budget. The final quantity is correct completed training work per allocated accelerator-hour over a representative operating period.
Prerequisites
- Chapter 14 ownership of sharded parameters, gradients, and optimizer state
- Chapter 15 cross-rank diagnosis
- Ability to calculate an average from incident intervals and distinguish a complete file set from a partial save
Learning objectives
- Calculate expected calendar waste from checkpointing and interruptions
- Design and test a complete distributed checkpoint continuation contract
- Detect missing progress, preserve diagnostic evidence, and recover a valid worker group
Study this chapter
- 16.1Failure cost modelBegin lesson →
Calculate checkpoint overhead, expected repeated work, and recovery waste across candidate useful-training intervals between checkpoint pauses and measured incident ranges
- 16.2Sharded, portable checkpointsBegin lesson →
Map rank-local shards to logical tensor keys, publish only complete versions, and verify restore in a fresh process group without one-rank assembly
- 16.3Hangs, health, and elastic restartBegin lesson →
Use progress markers and phase-specific timeouts to distinguish a hang from a valid straggler, capture the first divergence, and choose group recovery behavior
- 16.4Reliability resource budgetBegin lesson →
Compare reliability designs using correct completed work per charged calendar allocation and explicit prevention, detection, recovery, and integrity objectives
Extended exercises
Complete these projects after the lesson-level practice tasks. Each project combines several mechanisms from the chapter.
Checkpoint interval
Evaluate useful-training intervals of 10, 20, 40, 60, and 120 minutes between checkpoint pauses across low, central, and high job-interruption estimates.
Evidence: A sensitivity table that defines I consistently and includes exposed save, expected repeated work, detection, replacement, restore, and total fractional calendar waste.
Restore drill
Save a sharded model, optimizer, random state, completed-step number, and data position, then terminate the original processes and restore into a fresh group.
Evidence: Complete-version manifest, automated logical-state comparison, next-step behavior, temporary-memory peak, and time to first valid post-restore step.
Failure injection
Kill one worker and separately stall one worker during declared phases of a toy eight-rank training job.
Evidence: Progress-marker timeline, first captured divergence, timeout decision, communicator status, launcher behavior, restored step, and exact repeated-work calculation.
Sources and further reading
The lesson explanations synthesize primary papers and official references. Follow the originals for proofs, exact APIs, architecture details, and version-sensitive behavior.