← train.galvyn.xyz

Lesson 1.7 · Checkpointing · Oct 18, 2026

What a crash costs

Both runs were SIGKILLed mid-training. Checkpointing every 1,000 steps cost 6× more redone work than every 100; both resumed bit-exactly to the same final loss.

Long runs crash: power cuts, preempted cloud machines, a bug at hour 30. A checkpoint is everything needed to carry on exactly where you were: the weights, the AdamW state (two numbers per weight), the learning-rate schedule position, and the random-number state that decides which batch comes next.

Both runs are the same 30M model and 3,000 steps. A saves a checkpoint every 100 steps, B every 1,000. Mid-run, both were killed with SIGKILL (no chance to save anything) and resumed from their last checkpoint. Dashed lines on the chart are the resumed processes.

Lossdashed = after the crash and resume
681050010001500200025003000step
Real data from the lab experiment. A: fineweb edu · B: fineweb edu
AB
killed after step / resumed from1,380 / 1,3001,490 / 1,000
steps done twice~80~490
checkpoints written (disk)33 (11.7 GB)7 (2.3 GB)
best val loss5.093835.09383

Two things happened.

The crash cost B six times more work. Everything after its last checkpoint was lost and redone. On a 55-hour GPT-2 run that's the difference between losing minutes and losing hours. The price of saving often is disk: A wrote five times as much.

The resume was exact. For the steps both processes ran (8 logged points for A, 49 for B), the resumed process logged the same training loss to six decimals as the one that died. Both runs end at a validation loss of exactly 5.09383, identical to each other despite crashing at different points. That only works because the checkpoint holds the random-number state that decides the batch order: restore just the weights and the optimizer, and the resumed run would see different batches and drift.

Every number here comes from this experiment in the lab, trained on one RTX A5000.