A checkpoint is a complete snapshot of training state so that thousand-GPU runs can resume from the latest step after failures (node crash / OOM / power loss) instead of starting over. It must save: ① model weights; ② optimizer state — Adam's first/second moments
mt,
vt and the FP32 master weight copy (weights alone cannot resume losslessly; lost momentum and LR progress make the resumed loss unstable); ③ progress — epoch/step counters and the LR-scheduler step; ④ randomness — each rank's RNG states (data shuffle, not just init); ⑤ data cursors — DataLoader shard boundaries. Sharded checkpoints: one huge monolithic file is slow to write and fragile (a 70B FP16 file is 140 GB, minutes to persist); HF safetensors splits weights into shards plus an index.json — parallel writes, mmap zero-copy reads, and no pickle, hence no arbitrary-code-execution on load; under ZeRO-3/FSDP parameters are already sharded, so each rank persists only its own
16Ψ/Nd shard and reads it back on resume (or All-Gathers once to export a consolidated file). Async checkpointing: a synchronous save stop-the-worlds training (it stalls for the disk write); async saves first copy a consistent snapshot from GPU to CPU memory (with copy-on-write/versioning so later updates don't corrupt it), then a background thread/process writes it out while training continues. Resuming: reconstruct optimizer state, reset epoch/step and RNG, restore shuffle order and data sharding — ZeRO-3 requires every rank to read back its own shard. Training stability: pair saving with stability — on loss/gradient spikes, roll back to the last-good checkpoint, lower the LR, or skip the bad batch; save frequency trades IO overhead against failure loss, commonly using time/step thresholds plus per-epoch candidate checkpoints.