English

Dynamic Tensor Rematerialization

Machine Learning 2021-03-19 v4 Programming Languages Machine Learning

Abstract

Checkpointing enables the training of deep learning models under restricted memory budgets by freeing intermediate activations from memory and recomputing them on demand. Current checkpointing techniques statically plan these recomputations offline and assume static computation graphs. We demonstrate that a simple online algorithm can achieve comparable performance by introducing Dynamic Tensor Rematerialization (DTR), a greedy online algorithm for checkpointing that is extensible and general, is parameterized by eviction policy, and supports dynamic models. We prove that DTR can train an NN-layer linear feedforward network on an Ω(N)\Omega(\sqrt{N}) memory budget with only O(N)\mathcal{O}(N) tensor operations. DTR closely matches the performance of optimal static checkpointing in simulated experiments. We incorporate a DTR prototype into PyTorch merely by interposing on tensor allocations and operator calls and collecting lightweight metadata on tensors.

Keywords

Cite

@article{arxiv.2006.09616,
  title  = {Dynamic Tensor Rematerialization},
  author = {Marisa Kirisame and Steven Lyubomirsky and Altan Haan and Jennifer Brennan and Mike He and Jared Roesch and Tianqi Chen and Zachary Tatlock},
  journal= {arXiv preprint arXiv:2006.09616},
  year   = {2021}
}

Comments

31 pages, 12 figures, implementation available here: https://github.com/uwsampl/dtr-prototype, OpenReview: https://openreview.net/forum?id=Vfs_2RnOD0H

R2 v1 2026-06-23T16:23:36.405Z