Dynamic Tensor Rematerialization

Marisa Kirisame, Steven Lyubomirsky, Altan Haan, Jennifer Brennan, Mike He +3 more
6/17/2020
cs.LGcs.PLstat.ML

Official code: uwsampl/dtr-prototype (132 stars, Python, last commit 2023-07-06).

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.

Show full abstract

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 $N$-layer linear feedforward network on an $Ω(\sqrt{N})$ memory budget with only $\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.

View on arXivView PDF

Code Implementations(1)

Dynamic Tensor Rematerialization prototype (modified PyTorch) and simulator. Paper: https://arxiv.org/abs/2006.09616

13218Python, Jupyter NotebookJun 17, 20203 years ago

Similar Papers

Cite this paper

@article{kirisame2020dynamic,
  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},
  year   = {2020},
  eprint = {2006.09616},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2006.09616}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2006.09616.svg)](https://codeofpaper.com/paper/2006.09616)

Discussion