Menu

1 / 3

What is gradient checkpointing, and when should you use it?

DEV Community: pytorch·Viswaretas Kotra·10 days ago
#lX4lxWNi
#devtopytorch#devto#dev#checkpointing#layer
Long article (1989 words) — no AI summary yet.
Reading 0:00
15s threshold

Gradient checkpointing, also called activation checkpointing, saves GPU memory in training by keeping only a few activations from the forward pass and recomputing the rest during the backward pass. Nodus turns it on by default in its sft fine-tuning runtime: in our Qwen3-8B estimate it cuts activation memory more than 10x, and published measurements put the cost at 20 to 36% more step time. Use it when activations are what overflow your GPU, and leave it off when the model already fits with a batch size that keeps the GPU busy.

Is gradient checkpointing the same as saving a training checkpoint?

No, and the shared word causes real confusion. Gradient checkpointing is a memory trick inside one training step. Nothing is written to disk, and nothing survives a crash.

A training checkpoint is a saved copy of the weights, optimizer state and data position, written every few hundred steps so a run can resume after a failure.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.