DELTA: Dynamically Optimizing GPU Memory beyond Tensor Recomputation

Yu Tang, Chenyu Wang, Yufan Zhang, Yuliang Liu, Xingcheng Zhang, Linbo Qiao, Zhiquan Lai, Dongsheng LiarXiv 2022 · DOI

Introduction: The GPU Memory Wall

The deep learning landscape is currently defined by an "arms race" where model performance scales with parameter count. However, we have hit a physical limit known as the GPU memory wall. As shown in Figure 1, the memory requirements of massive models, particularly Transformers, are growing exponentially faster than the capacity of GPU hardware.

The GPU Memory Wall: Model parameter growth vs. GPU memory capacity.

To circumvent these hardware constraints, researchers typically employ two primary strategies:

  1. Recomputation: Deleting activations and recalculating them during the backward pass.
  2. Swapping: Offloading tensors from GPU memory to the larger, slower CPU memory and prefetching them when needed.

Existing tools often struggle because they are static—requiring manual "checkpointing"—or they focus on only one strategy. DELTA (Dynamic tEnsor offLoading and recompuTAtion) addresses these gaps by intelligently combining both techniques.

The DELTA Framework

DELTA is a framework-agnostic runtime memory manager that operates through three core components:

  • The Filter: This component identifies "optimal" tensors for release based on a heuristic of memory cost and staleness (time since last use). Large, infrequently used tensors are prioritized.
  • The Director: Acting as the decision engine, the Director calculates a decision score for each identified tensor. It compares the time cost of recomputing the tensor against the time cost of swapping it from the CPU. If recomputation is faster (e.g., for BatchNorm layers), the tensor is evicted; otherwise, it is offloaded.
  • The Prefetcher: To mitigate the latency of data movement, the Prefetcher reloads offloaded tensors into the GPU just before they are required, overlapping communication with computation.

Key Insights: Recomputation vs. Swapping

A significant finding of this work is the refutation of the "swapping is always best" myth. The authors observed that for specific layers, such as BatchNorm, swapping can take orders of magnitude longer than recomputation (~96,000 μs vs. 6 μs). DELTA’s dynamic ability to choose the most efficient path for each individual tensor is its primary innovation. Furthermore, DELTA requires zero user oversight, learning the optimal strategy during the initial training iterations.

Evaluation and Results

The researchers evaluated DELTA across standard benchmarks including ImageNet (ResNet, EfficientNet) and SQuAD (BERT).

Memory consumption vs. batch size comparison between baseline, DTR, and DELTA.

As illustrated in Figure 5, DELTA significantly outperforms both the baseline and state-of-the-art Dynamic Tensor Rematerialization (DTR). Key results include:

  • Memory Savings: DELTA consistently reduced GPU memory usage by 40% to 70%.
  • Batch Size Expansion: On an NVIDIA A100 (80GB), DELTA enabled a 2.04x increase in maximum batch size for ResNet-50 and 2.25x for ResNet-101.
  • Efficiency: DELTA saved an additional 30% of memory compared to DTR for the same batch size, with minimal performance overhead (e.g., only 0.551s delay per iteration for ResNet-50).

Limitations and Future Directions

While DELTA effectively breaks the memory wall, challenges remain. Memory fragmentation—where free memory is split into non-contiguous chunks—persists as a hurdle for long-running jobs. Additionally, while the logic is framework-free, deeper integration into ecosystems like PyTorch and TensorFlow is necessary for broad adoption. Future work will also focus on optimizing for extremely complex, non-linear network structures.

Summary updated

BibTeX
@misc{tang2022delta,
  author = {Yu Tang and Chenyu Wang and Yufan Zhang and Yuliang Liu and Xingcheng Zhang and Linbo Qiao and Zhiquan Lai and Dongsheng Li},
  title = {{DELTA: Dynamically Optimizing GPU Memory beyond Tensor Recomputation}},
  year = {2022},
  eprint = {2203.15980},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2203.15980},
}
Figure