Current and New Activation Checkpointing Techniques in PyTorch – PyTorch
As models scale in depth, batch size, and sequence length, etc, activation memory becomes an increasingly significant contributor to the overall memory usage. To help address this, PyTorch provides utilities for activation checkpointing, which reduce the number of saved tensors by recomputing them when needed, trading off memory usage for additional compute. In this post, we’ll walk through the basics of what activation memory is, the high-level ideas behind existing activation checkpointing techniques, and also introduce some newer techniques that aim to improve flexibility and provide more optimization/automation out of the box. As we look at these techniques, we’ll compare how these methods fit into a speed vs. memory trade-off diagram and hopefully provide some insight on how to choose the right strategy for your use case. (If you prefer to jump straight to the new APIs, please skip ahead to the “Selective Activation Checkpoint” and “Memory Budget API” sections below.) By default,
As models scale in depth, batch size, and sequence length, etc, activation memory becomes an increasingly significant contributor to the overall memory usage. To help address this, PyTorch provides utilities for activation checkpointing , which reduce the number of saved tensors by recomputing them when needed, trading off memory usage for additional compute. In this post, we’ll walk through the basics of what activation memory is, the high-level ideas behind existing activation checkpointing techniques, and also introduce some newer techniques that aim to improve flexibility and provide more
Explore this link on the map →saved by
related reading
- Making Deep Learning go Brrrr From First Principleshorace.io
- PyTorch internals : ezyang's blogblog.ezyang.com
- Transformer Math 101 | EleutherAI Blogblog.eleuther.ai
- Interpretability Infrastructure at Frontier Scale: Harvesting Activations from a Trillion-Parameter Modelgoodfire.ai
- State of torch.compile for training (August 2025) : ezyang's blogblog.ezyang.com
- the bug that taught me more about PyTorch than years of using it | Elana Simonelanapearl.github.io
- Memory-Limited Layers User's Guide - NVIDIA Docsdocs.nvidia.com
- Transformer Inference Arithmetic | kipply's blogkipp.ly
- Tiny TPUtinytpu.com
- Accelerating Generative AI with PyTorch II: GPT, Fast – PyTorchpytorch.org
- UW PLSE | How does torch.compile work?uwplse.org
- CVPR2023_eff_tutorial_molchanov.pdfnvlabs.github.io