activation recompute — memory against a second forward
A backward pass needs the activations the forward pass produced. Storing all of them uses one slot per layer and no extra forward. Storing only the input uses one slot and recomputes the stack. Checkpointing every few layers sits between those extremes, and the sum of memory and extra forward has a minimum there.
Sixteen layers. Segment 1 stores every activation. Segment 16 stores the input and recomputes. The objective, memory plus extra forward, is lowest at a segment in between.