TECHNOLOGY

Activation checkpointing trades stored intermediates for recomputation

In this article
THE QUICK TAKE

Checkpointing exchanges retained activation storage for recomputation; its correctness depends on reproducing the needed forward computation during backward.

Backpropagation often needs values produced during the forward pass. Keeping all of them can consume substantial memory. Activation checkpointing retains selected boundaries and recomputes some missing intermediates when their derivatives are needed. It changes the execution plan rather than removing the mathematical need for those values.

Backward uses saved forward information

For many operations, the derivative depends on an input, output or another intermediate from the forward pass. Automatic differentiation normally arranges for the needed information to remain available. This retained state can grow with depth and sequence length. Checkpointing asks which parts can be reconstructed from a smaller set of retained boundaries. It does not mean every activation is unnecessary, nor does it replace differentiation with an approximation by definition. The computation still needs the relevant local values when evaluating the corresponding derivative.

A chain makes the storage exchange visible

Imagine a chain of consecutive blocks. Retain the input to a chosen group instead of all the group’s intermediate activations. During backward, run the group forward again from that retained input, obtain the needed local values, and compute the gradients. The saved boundary consumes storage, while the repeated forward work consumes computation. Different groupings change both costs. This is a structural example rather than a claim that checkpointing a particular number of blocks will produce a universal memory reduction or runtime increase on every accelerator.

Repeated execution must respect state

Recomputation should reproduce the values required by the intended derivative. Random operations, mutable buffers or other side effects can complicate that requirement. A framework may preserve random-number state under documented conditions, but arbitrary external mutation is not automatically corrected. If a recomputed block reads a changed global variable, its second execution can differ from the original. Treat a checkpointed function’s inputs and execution context as an explicit contract, and consult the implementation’s restrictions rather than assuming any function can be safely repeated.

Measure the actual retained and repeated work

Compare a small baseline with checkpointed execution under controlled randomness and a declared gradient tolerance. Then measure peak memory and time for the intended workload, because parameter, optimizer and allocator memory are separate from retained activations. A reduction in activation storage does not guarantee that the whole run becomes proportionally smaller. Document the chosen boundaries and implementation variant so the result can be reproduced. This connects the conceptual storage exchange to a concrete execution plan and makes correctness evidence distinct from the performance measurement.

Primary research and implementation references

Reproducible inference stacks: preserving a GPU pilot’s result; A GPU inference benchmark you can trust.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles