Curriculum / Part 3 · How AI workloads use storage
Lesson 13

Checkpointing

What a checkpoint contains, how big it is, why every GPU writes at once, and how write bandwidth turns into idle GPU time.

⏱ 40 min5-question quizLab 3.2

The simple version

A video game autosave. If saving takes a second, nobody notices. If it freezes the game for a minute every ten minutes, players riot. Checkpoints are autosaves for training, and storage write speed decides how long the freeze lasts.

How big is a checkpoint?

A full training checkpoint holds the model weights and the optimizer state needed to resume exactly. With common mixed-precision training using the Adam optimizer, a typical breakdown per parameter is:

ItemBytes per parameter
Weights in bf162
fp32 master copy of weights4
Adam first moment (fp32)4
Adam second moment (fp32)4
Total≈ 14
checkpoint ≈ parameters × ~14 bytes

70 billion parameters × 14 B ≈ 980 GB. Exact numbers depend on framework, precision and what is saved; measure yours.

From write bandwidth to idle GPUs

stall = checkpoint size ÷ aggregate write bandwidth
fraction lost = stall ÷ (interval + stall)

980 GB at 50 GB/s → 19.6 s. Every 30 minutes → 19.6 ÷ 1,819.6 ≈ 1.1% of wall time.
Same checkpoint at 5 GB/s → 196 s → 9.8%. On a thousand-GPU job that is roughly a hundred GPUs' worth of time wasted.

Shorter intervals lose less work after a failure but stall more often, so the write bandwidth you need depends on how often you must checkpoint.

Why it's bursty, and what helps

In data-parallel and sharded training, every rank writes its piece at the same time, so the storage system sees a huge burst followed by silence. Common mitigations:

  • Stripe wide on a parallel filesystem so many servers absorb the burst (Lab 3.2).
  • Asynchronous checkpointing: copy state to host memory quickly, then write in the background while training continues. PyTorch Distributed Checkpoint offers an async save API for this.
  • Tiered checkpoints: write to local NVMe first, then drain to shared storage. Fast, but a node failure before draining loses that copy.

Tools

lfs getstripe -d /lustre/ckpt
Default layout new checkpoint files will get.
lfs setstripe -c 8 /lustre/ckpt
Stripe future checkpoint files across 8 OSTs.
fio --rw=write --bs=4M --numjobs=N
Approximate a many-writer checkpoint burst.

Quiz

Lab

Lab 3.2 · Checkpoint stalls

Training pauses every 10 minutes while each host writes a 120 GiB checkpoint to /lustre/scratch/ckpt. The team measured over 5% of wall time lost to these stalls.

Start lab 3.2 →