Reducing Activation Recomputation in Large Transformer Models

By Vijay Anand Korthikanti, Jared Casper, Sangkug Lym, Lawrence C. McAfee, Michael Andersch, Mohammad Shoeybi, Bryan Catanzaro. 2022

492 citations recorded by the source corpus.

Training large transformer models is one of the most important computational challenges of modern AI. In this paper, we show how to significantly accelerate training of large transformer models by reducing activation recomputation. Activation recomputation is commonly used to work around memory capacity constraints. Rather than storing activations for backpropagation, they are traditionally recomputed, which saves memory but adds redundant compute. In this work, we show most of this redundant compute is unnecessary because we can reduce memory consumption sufficiently without it. We present two novel yet very simple techniques: sequence parallelism and selective activation recomputation. In conjunction with tensor parallelism, these techniques almost eliminate the need to recompute activations. We evaluate our approach on language models up to one trillion parameters in scale and show that our method reduces activation memory by 5x, while reducing execution time overhead from activation recomputation by over 90%. For example, when training a 530B parameter GPT-3 style model on 2240 NVIDIA A100 GPUs, we achieve a Model Flops Utilization of 54.2%, which is 29% faster than the 42.1% we achieve using recomputation. Our implementation will be available in both Megatron-LM and NeMo-Megatron.

Subfields: Artificial Intelligence, Computer Vision and Pattern Recognition, Hardware and Architecture, Efficiency & Compression

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Luke S. Zettlemoyer
  2. Jason Aaron Edward Weston
  3. Graham Neubig
  4. Jianfeng Gao
  5. Edouard Grave
  6. Quoc V. Le
  7. Furu Wei
  8. Hannaneh Hajishirzi

In Computer Vision and Pattern Recognition

  1. Luc Van Gool
  2. Dacheng Tao
  3. Trevor Darrell
  4. Jitendra Malik
  5. Ming-Hsuan Yang
  6. Xiaogang Wang
  7. Yi Yang
  8. Cordelia Schmid

In Hardware and Architecture

  1. Chien-chin Huang
  2. Edouard Grave
  3. Armand Joulin
  4. Timothée Lacroix
  5. Marie-Anne Lachaux
  6. Matei A. Zaharia
  7. Peiyi Wang
  8. Haotian Tang

In Efficiency & Compression

  1. Armand Joulin
  2. Edouard Grave
  3. Hugo Touvron
  4. Sam Shleifer
  5. Myle Ott
  6. Naman Goyal
  7. Hongxu Yin
  8. Pavlo Molchanov

Citations in the corpus