Home Knowledge Base Selective Activation Recomputation

Selective Activation Recomputation is an intelligent checkpointing strategy that analyzes the compute cost and memory footprint of each operation to decide which activations to save and which to recompute during the backward pass — achieving a better speed-memory tradeoff than uniform checkpointing by always saving expensive activations (attention softmax outputs, large intermediate tensors) while recomputing cheap ones (linear projections, element-wise operations), standard practice in Megatron-LM and DeepSpeed for training large transformers.

What Is Selective Recomputation?

How Selective Recomputation Works

Memory Savings Comparison

StrategyMemory ReductionSpeed OverheadComplexity
No checkpointing0% (baseline)0%None
Uniform (every layer)~70%~30%Low
Uniform (every 2 layers)~50%~20%Low
Selective recomputation~50-60%~10-15%Medium
Full recomputation~90%~33%Low

Implementation

Selective activation recomputation is the smart memory optimization that achieves the best speed-memory tradeoff for large model training — by analyzing each operation's compute cost and making targeted save-or-recompute decisions rather than applying uniform checkpointing, it reduces memory by 50-60% with only 10-15% slowdown, enabling training of models that would otherwise exceed GPU memory limits.

selective recomputationmemory efficienttransformer training

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.