Unit 6 of 11 · about 4 hours · derive
Checkpoint frequency, save cost, lost work and recovery objectives
Every checkpoint policy is one trade: frequent writes burn throughput, rare writes burn rework. RPO and RTO turn that trade into objectives the schedule must meet.
You'll be able to
- Derive the Young-Daly interval from write time and system MTBF and recompute the chapter's worked numbers.
- State RPO and RTO for a job and show how interval, retention and recovery time each move them.
- Use incremental and differential vocabulary precisely: what each reuses and what a restore needs.
Covers
Read
In this order, only the parts listed
0 of 5 done
- The interval modelMachine Learning Systems Volume II - Chapter 7 Fault Tolerance
Checkpointing: Preserving Progress with Definition 1.1; Checkpoint interval from failure analysis with Figure 25 and Napkin Math 1.3; Systems Perspective 1.3 on Young-Daly assumptions; Checkpoint overhead analysis; The stop-the-world cost
- Recovery budgets and vocabularyMachine Learning Systems Volume II - Chapter 7 Fault Tolerance
Failure Detection and Recovery with equation 9 for recovery time; Checkpoint 1.4: Reasoning about the checkpoint tax; appendix Reliability Foundations: Checkpoint Optimization, Recovery Budgets, Strategy Selection
- Frequency arithmetic from productionMachine Learning Engineering Open Book - Checkpoints, Storage and Fault Tolerance
Frequent checkpoint saving: BLOOM-176B wrote 2.3TB in 40 seconds on 384 processes every 3 hours, 720 saves totalling 8 hours (0.37 percent); keep the 2 most recent checkpoints local for fast resume
- Failure rates to plan againstThe Llama 3 Herd of Models - Reliability and Operational Challenges
Section 3.3.4 Reliability and Operational Challenges with Table 5: 466 interruptions over a 54-day snapshot, 47 planned and 419 unexpected; Section 3.3.1 storage on bursty writes and minimizing pause time (arXiv:2407.21783v3)
- Incremental checkpoints and their restore chainMachine Learning Systems Volume II - Chapter 7 Fault Tolerance
Checkpoint Storage: the paragraph beginning "Incremental checkpointing offers a further optimization"
It defines an incremental checkpoint as changes since the last full one, which backup vocabulary calls differential, yet restores it by applying a chain of increments. Use this unit's two definitions and record in the manifest which one each partial checkpoint follows.
Focus on
- Total waste is write cost plus expected rework: . The Young-Daly interval sits at its minimum. Derive it by differentiating, not by quoting.
- Restart time is a per-failure term, not a smaller write time. Folding restart into the square root needs a recovery-aware model, as Systems Perspective 1.3 warns.
- RPO is the oldest state you can lose, bounded by interval plus retention gaps. RTO is detect plus restart plus load plus warmup, the chapter's equation 9. Interval moves RPO; recovery engineering moves RTO. Both terms come from SLIs, SLOs, error budgets and recovery objectives, applied here to checkpoints.
- Incremental checkpoints store changes since the last checkpoint of any kind; differential store changes since the last full one. Restore needs the base plus every incremental since, or the base plus the latest differential. Neither replaces a correct full checkpoint. The storage chapter uses incremental for since-last-full deltas, so name the definition you use.
Common mistakes · 3
- Setting the interval from write time alone, or quoting the chapter's 16.5-minute interval as a recommendation. The formula needs the fleet MTBF as its second input, and that worked number belongs to a 10,000-GPU cluster with 37-second writes.
- Trusting the printed Table 5 percentages. The counts sum to 419 but the Faulty GPU share (30.1 percent) disagrees with its count (148 of 419 is 35.3 percent), so plan from counts and recompute shares yourself.
- Calling RTO the checkpoint write time. RTO includes detection, scheduling, loading and warmup, which run 3 to 5 times the write in production.
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.Derive the Young-Daly interval from the two-sided tax.Answer
Minimize over : , so .
2.A cluster doubles in size and system MTBF halves with write time fixed. How does the optimal interval move?Answer
It shortens by : the new interval is , since only the MTBF term changes.
3.Llama 3 saw 419 unexpected interruptions in 54 days. What fleet MTBF does that imply, and what is it for?Answer
About 3.1 hours (54 times 24 divided by 419). It is the MTBF input to the interval model for a fleet of that scale, not a constant for all jobs.
4.A job keeps hourly checkpoints with a 10-minute RTO and the last two are corrupt. What are the realized RPO and recovery time?Answer
Up to 3 hours of lost work: the newest usable checkpoint is the third most recent. Recovery still takes the 10-minute RTO on top. Retention depth is part of the RPO, not just the interval.
Practice
- MLSys Checkpoint 1.4: Reasoning about the checkpoint tax
Checkpoint 1.4: Young-Daly shift, Two-sided tax, Faster writes, Square-root scaling
Answer all four boxes on paper first: recompute Napkin Math 1.3 and the Llama 3 fleet MTBF (419 over 54 days) before checking against the text.
You're done when
You derive the interval from the tax expression without notes, recompute both worked numbers exactly, and can state your own job's RPO and RTO with the input each depends on.
Only when you can do this without notes.
Leads to
Notes
Resources · 3 for this unit, 10 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.
- 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. - 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.
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. - 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.
- 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. - 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. - 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.