Skip to main content
QUICK REVIEW

[Paper Review] Echo: Compiler-based GPU Memory Footprint Reduction for LSTM RNN Training

Bojian Zheng, Abhishek Tiwari|arXiv (Cornell University)|May 22, 2018
Advanced Neural Network ApplicationsComputer Science72 references6 citations
TL;DR

Echo is a compiler-based optimization that reduces GPU memory footprint in LSTM RNN training by selectively recomputing feature maps instead of storing them, leveraging layer-specific runtime estimation and global memory benefit analysis. It achieves 1.89x average and 3.13x maximum memory footprint reduction with minimal runtime overhead, enabling faster training, larger batch sizes, and deeper models on the same hardware.

ABSTRACT

The Long-Short-Term-Memory Recurrent Neural Networks (LSTM RNNs) are a popular class of machine learning models for analyzing sequential data. Their training on modern GPUs, however, is limited by the GPU memory capacity. Our profiling results of the LSTM RNN-based Neural Machine Translation (NMT) model reveal that feature maps of the attention and RNN layers form the memory bottleneck and runtime is unevenly distributed across different layers when training on GPUs. Based on these two observations, we propose to recompute the feature maps rather than stashing them persistently in the GPU memory. While the idea of feature map recomputation has been considered before, existing solutions fail to deliver satisfactory footprint reduction, as they do not address two key challenges. For each feature map recomputation to be effective and efficient, its effect on (1) the total memory footprint, and (2) the total execution time has to be carefully estimated. To this end, we propose *Echo*, a new compiler-based optimization scheme that addresses the first challenge with a practical mechanism that estimates the memory benefits of recomputation over the entire computation graph, and the second challenge by non-conservatively estimating the recomputation overhead leveraging layer specifics. *Echo* reduces the GPU memory footprint automatically and transparently without any changes required to the training source code, and is effective for models beyond LSTM RNNs. We evaluate *Echo* on numerous state-of-the-art machine learning workloads on real systems with modern GPUs and observe footprint reduction ratios of 1.89X on average and 3.13X maximum. Such reduction can be converted into faster training with a larger batch size, savings in GPU energy consumption (e.g., training with one GPU as fast as with four), and/or an increase in the maximum number of layers under the same GPU memory budget.

Motivation & Objective

  • To address the high GPU memory consumption in LSTM RNN training, which limits batch size and compute utilization.
  • To overcome the limitations of prior recomputation techniques that fail to accurately estimate memory benefits and runtime overhead in LSTM contexts.
  • To enable automatic, transparent memory footprint reduction without modifying training source code.
  • To support diverse models beyond LSTM RNNs, including Transformers and ResNets, under the same GPU memory budget.
  • To allow for faster training, larger batch sizes, or increased model depth through footprint reduction.

Proposed method

  • Echo uses a compiler-based approach to analyze the entire computation graph and estimate the net memory benefit of recomputing feature maps instead of storing them.
  • It introduces a practical mechanism to evaluate global memory savings by considering both released feature maps and newly allocated data for recomputation.
  • Echo non-conservatively estimates recomputation overhead by leveraging layer-specific characteristics, such as low computational cost in non-fully-connected layers.
  • The method identifies optimal layers for recomputation based on a trade-off between memory savings and runtime cost, avoiding over-simplistic exclusion of compute-heavy layers.
  • It integrates seamlessly into existing deep learning frameworks without requiring changes to model source code or manual kernel tuning.
  • Echo is evaluated across multiple state-of-the-art models, including NMT, DeepSpeech2, Transformer, and ResNet, on real GPUs.
Figure 1 : Left: A single-layer LSTM RNN that scans through an input sequence. Right: Zoom-in view of one LSTM cell. Both diagrams are simplified for clarity.
Figure 1 : Left: A single-layer LSTM RNN that scans through an input sequence. Right: Zoom-in view of one LSTM cell. Both diagrams are simplified for clarity.

Experimental results

Research questions

  • RQ1Can selective recomputation effectively reduce GPU memory footprint in LSTM RNN training without incurring prohibitive runtime overhead?
  • RQ2How can the net memory benefit of recomputation be accurately estimated across an entire computation graph, considering both storage release and new allocation?
  • RQ3Can a compiler-based system automatically identify optimal recomputation targets in complex models like Transformers and ResNets?
  • RQ4To what extent can footprint reduction be converted into practical benefits such as larger batch sizes or deeper models?
  • RQ5How does Echo compare to prior techniques in terms of memory reduction and runtime efficiency across diverse DNN workloads?

Key findings

  • Echo reduces the GPU memory footprint by 1.89× on average and up to 3.13× in the maximum case across diverse models including NMT, DeepSpeech2, Transformer, and ResNet.
  • The method enables training with one GPU to achieve the same speed as four GPUs in baseline configurations, significantly reducing energy consumption.
  • Echo increases the maximum number of layers by 1.83× for Transformer and 4.0× for ResNet on a single RTX 2080 Ti (11 GB memory) when batch size is fixed.
  • The approach achieves these reductions with minimal runtime overhead, demonstrating practicality for real-world training workloads.
  • Echo is effective beyond LSTM RNNs, showing strong applicability to Transformers and CNNs like ResNet.
  • The technique enables faster training convergence and supports deeper models under the same memory budget, aligning with trends in deep learning architecture design.
Figure 2 : NMT (LSTM RNN Encoder (Middle)-Decoder (Right) with Attention (Left))
Figure 2 : NMT (LSTM RNN Encoder (Middle)-Decoder (Right) with Attention (Left))

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.