Dynamic Tensor Rematerialization
Marisa Kirisame, Steven Lyubomirsky, Altan Haan et al. · arXiv (Cornell University) · 2020
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 $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.
Cited by 2 works. doi:10.48550/arxiv.2006.09616 Open-access PDF
Authors
- Marisa Kirisame
- Steven Lyubomirsky
- Altan Haan
- Jennifer Brennan
- Mike He
- Jared Roesch
- Tianqi Chen
- Zachary Tatlock
References
- U-Net: Convolutional Networks for Biomedical Image Segmentation
- Densely Connected Convolutional Networks
- BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
- Automatic differentiation in PyTorch
- PyTorch: An Imperative Style, High-Performance Deep Learning Library
- Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networks
- Large Scale GAN Training for High Fidelity Natural Image Synthesis
- Automatic Differentiation in Machine Learning: a Survey
- Training Deep Nets with Sublinear Memory Cost
- Achieving logarithmic growth of temporal and spatial complexity in reverse automatic differentiation