Gradient Checkpointing
Gradient checkpointing is now documented under Activation Checkpointing & Offloading.
Gradient checkpointing and activation checkpointing are two names for the same technique. During the forward pass each decoder layer keeps only its input and drops its intermediate activations; during the backward pass it runs its forward again to rebuild them. Activation memory drops to about one hidden-state tensor per layer, at the cost of roughly one extra forward pass per step.
PyTorch, DeepSpeed, accelerate and transformers (from 5.23) call it activation checkpointing, and
Axolotl’s config follows them: activation_checkpointing: true replaces
gradient_checkpointing: true, which still works but is deprecated, and the same block configures
selective checkpointing and activation offloading.
activation_checkpointing: trueOn the new page:
- Enabling activation checkpointing,
including
reentrantand the extratorch.utils.checkpointarguments - Selective activation checkpointing (SAC)
- Activation offloading
- Layer offloading
- Migrating from
gradient_checkpointingand the other legacy keys