Unit 11 of 11 · about 5 hours · implement
Kill-at-every-boundary campaigns, post-resume equivalence and the recovery audit
The section checkpoint is this unit. Recovery that works everywhere except the one untested boundary is not recovery.
You'll be able to
- Enumerate every crash window in a save and load cycle and kill the job in each one.
- Validate post-resume equivalence against a reference trajectory with declared deterministic versus statistical bars.
- Write a failure manifest and recovery audit entry per incident: what died, what was kept, what was refused.
Covers
Read
In this order, only the parts listed
0 of 4 done
- Fault injection and recovery validationMachine Learning Systems Volume II - Chapter 7 Fault Tolerance
Fault Injection Tools and Frameworks; Failure Detection and Recovery: the detect, pause, rescale and resume sequence in Figure 28 and recovery validation (shapes, dtypes, loss consistency, gradient statistics); Distributed Debugging and Observability
- What production failures look likeThe Llama 3 Herd of Models - Reliability and Operational Challenges
Section 3.3.4 Reliability and Operational Challenges: 466 interruptions over a 54-day snapshot with the Table 5 root-cause mix (plan from counts: the printed Faulty GPU share disagrees with its count); NCCL flight recorder paragraph on ring-buffer collective metadata with automatic dumps on watchdog or heartbeat timeout (arXiv:2407.21783v3)
- Boundary enumeration from the save pathTorchFeather - Distributed Checkpoint Manager
save(should-save decision, async-wait join, sync or async write, purge),close(final join, group destroy, purge-thread join),load(_find_load_step, model-only versus full): one kill window per boundary - Capstone-adjacent smoke tests (depth)Bumblebee - DCP and Checkpoint Smoke Tests
primitive/ckpt/dcp.pyentry pointssave_training_checkpointandload_training_checkpoint;tests/qwen3_moe/test_checkpoint_smoke.pyonly asserts that the two exports resolve to the local DCP runtime and are callable, anddocs/roadmap.mdlists reshardable optimizer state as a P2 item, so treat it as an untested target, not a reference
Focus on
- A boundary is any point where a crash changes what resume sees: before the first shard, mid-shards, after shards before commit, after commit before manifest, during purge, during load. List them from the code, then kill in each.
- Equivalence has two bars. Deterministic state (parameters, optimizer, data position) must match exactly on CPU; stochastic streams after a reshard match statistically with a declared test.
- Every incident writes the same record: failed rank and step, surviving checkpoints with checksums, refused artifacts with reasons, and the recovery action. The audit is the deliverable, not the log.
- Production mixes set the campaign weights. Hardware dominates Table 5's counts, but the campaign still covers hangs, slow ranks and corrupt files, because those are the cases restart logic gets wrong.
Common mistakes · 3
- Testing only clean kills between steps. Mid-write, mid-commit and mid-purge kills are the windows that corrupt; a campaign of tidy exits proves nothing.
- Comparing resumed loss to reference loss with no tolerance statement. Deterministic CPU resume must be exact, so any gap is a bug; GPU or resharded resume needs an explicit statistical bar.
- Keeping the audit in the training log. Rank-interleaved stdout is not an audit trail; write one manifest entry per incident with the kept and refused artifacts named.
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.Name six kill windows in an async checkpoint cycle.Answer
Before the first shard write, mid-shard writes, after shards before the future joins, after join before commit, during manifest write, and during stale purge; plus during load. Each must leave a loadable prior checkpoint or a refused partial.
2.Post-resume weights match exactly but the next data batches differ. Which window was hit, and what does the audit record?Answer
The sampler-position window: state saved without the consumed offset. Record the kept checkpoint, the duplicated batch range, and the missing offset field.
3.Table 5 shows 6 silent-data-corruption interruptions out of 419. Why does the campaign still include corruption injection?Answer
Rare but load-bearing: corruption defeats every path that assumes files are honest. Confirmed plus suspected cases justify a checksum-and-refuse test.
4.A recovery audit lists the loaded checkpoint but not the refused ones. What is missing, and why does it matter?Answer
The refused artifacts with reasons. Without them a later reader cannot tell a tested refusal from an untested path, and the same corrupt file can be retried.
You're done when
Your campaign kills in every listed window, each kill either resumes to the reference trajectory or refuses loudly with an audit entry, and no window is untested.
Only when you can do this without notes.
Leads to
Notes
Resources · 4 for this unit, 9 more in the section
- Machine Learning Systems Volume II - Chapter 7 Fault ToleranceML Systems Textbook · primary
Read Failure Analysis at Scale, Hardware Fault Taxonomy, Check-and-Verify, Fault Injection Tools and Frameworks, Checkpointing, Failure Detection and Recovery, Elastic Recovery and Distributed Debugging and Observability. Turn them into a failure matrix before implementing the PyTorch DCP lab.
- TorchFeather - Distributed Checkpoint ManagerTorchFeather · required
Trace components/checkpoint.py through state wrappers, DCP save and load, asynchronous mode, retention and cleanup. Write a failure table for every barrier, future, temporary artifact and deletion boundary.
- The Llama 3 Herd of Models - Reliability and Operational ChallengesLlama Team, Meta (2024) · support
Read the reliability section and its interruption table (root causes of unexpected interruptions over a 54-day snapshot) and use it to set failure rates in your checkpoint-interval model.
- Bumblebee - DCP and Checkpoint Smoke TestsBumblebee · depth
Only as a possible capstone target: read
primitive/ckpt/dcp.pyand the checkpoint smoke tests in a clean checkout. Its own roadmap lists reshardable optimizer state as a gap.
Also in this section
- PyTorch Distributed Checkpoint RecipesPyTorch · required
Complete the distributed checkpoint recipe with a tiny sharded model on CPU, then
dcp.async_savefrom the 2.14 reference at https://docs.pytorch.org/docs/2.14/distributed.checkpoint.html. The recipe saves model and optimizer only: add scheduler, scaler, RNG and dataloader state yourself, then inject partial directories, missing shards and a changed world-size restore. - Machine Learning Engineering Open Book - Checkpoints, Storage and Fault ToleranceStas Bekman · required
Read
training/fault-tolerance/README.md(frequent checkpoints, kill and save switches, watchdogs, preemption) and the "Don't forget the checksums" and benchmark sections ofstorage/README.md. Turn them into an operational save, verify, publish, retain and recover runbook. - Distributed Training Guide - Sharded Checkpoints, Determinism and Elastic TrainingLambda Labs · required
Run
related-topics/elastic-training/toy.pywith two CPU processes (hide any GPU so it uses Gloo) to see a crash-and-restart loop, then read the determinism related topic and the Chapter 4 sharded save and load. Prove the same next batches and updates after one interrupted run. - Picotron - Checkpoint StateHugging Face · support
Inspect picotron/checkpoint.py and every call site in train.py. List which state is saved, how ranks participate and which DT-1 reproducibility requirements need to be added in your project.
- Nanotron - Distributed SerializationHugging Face · support
Read the serialization section of
docs/docs.md(metadata, per-rank optimizer and RNG shards) and its statement that checkpoints are not topology agnostic, then the reasons insrc/nanotron/serialize/. Use it as the worked example of why resharding is hard. - PyTorch Elastic Run DocumentationPyTorch · support
Use failure modes and membership changes to understand agent, worker group, rendezvous and restart semantics. Implement only bounded local restart tests; elasticity is not a substitute for checkpoint correctness.
- torchftPyTorch · support
Read the README and
train_ddp.py: per-step quorum through the lighthouse, fault-tolerant DDP and HSDP, and live peer recovery. Compare per-step healing with restart-from-checkpoint. - TorchTitan - CheckpointingPyTorch · support
Read
docs/checkpoint.mdand the checkpointer component at a pinned commit: intervals, model-only and export saves, asynchronous modes and keys excluded from loading. - OLMo-core CheckpointerAi2 · support
Read
src/olmo_core/train/checkpoint.py(_temporary_wd,_get_tmp_dir,_teardown_tmp_dir,_save_metadata) for temp-directory atomic publish with barrier discipline, andsrc/test/train/checkpoint_test.py(run_checkpointer) for the save, find and reload assertions.