Tempo: Accelerating Transformer-Based Model Training through Memory Footprint Reduction

Muralidhar Andoorveedu, Zhanda Zhu, Bojian Zheng, Gennady Pekhimenko
10/19/2022
cs.LGcs.PF
transformer-attention

Official code: UofT-EcoSystem/Tempo (11 stars, Python, last commit 2023-01-24).

Abstract

Training deep learning models can be computationally expensive. Prior works have shown that increasing the batch size can potentially lead to better overall throughput.

Show full abstract

However, the batch size is frequently limited by the accelerator memory capacity due to the activations/feature maps stored for the training backward pass, as larger batch sizes require larger feature maps to be stored. Transformer-based models, which have recently seen a surge in popularity due to their good performance and applicability to a variety of tasks, have a similar problem. To remedy this issue, we propose Tempo, a new approach to efficiently use accelerator (e.g., GPU) memory resources for training Transformer-based models. Our approach provides drop-in replacements for the GELU, LayerNorm, and Attention layers, reducing the memory usage and ultimately leading to more efficient training. We implement Tempo and evaluate the throughput, memory usage, and accuracy/loss on the BERT Large pre-training task. We demonstrate that Tempo enables up to 2x higher batch sizes and 16% higher training throughput over the state-of-the-art baseline. We also evaluate Tempo on GPT2 and RoBERTa models, showing 19% and 26% speedup over the baseline.

View on arXivView PDF

Code Implementations(1)

Memory footprint reduction for transformer models

112Python, ShellSep 27, 20223 years ago

Similar Papers

Cite this paper

@article{andoorveedu2022tempo,
  title  = {Tempo: Accelerating Transformer-Based Model Training through Memory Footprint Reduction},
  author = {Muralidhar Andoorveedu and Zhanda Zhu and Bojian Zheng and Gennady Pekhimenko},
  year   = {2022},
  eprint = {2210.10246},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2210.10246}
}

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/2210.10246.svg)](https://codeofpaper.com/paper/2210.10246)

Discussion