Skip to main content
QUICK REVIEW

[Paper Review] Training Large Neural Networks with Constant Memory using a New Execution Algorithm

Bharadwaj Pudipeddi, Maral Mesmakhosroshahi|arXiv (Cornell University)|Feb 13, 2020
Ferroelectric and Negative Capacitance DevicesEngineering15 references24 citations
TL;DR

This paper introduces L2L (layer-to-layer), a novel execution algorithm that trains large neural networks with constant memory by offloading the full model to a CPU-based eager param-server (EPS), while only the current layer's parameters and activations reside in GPU memory. The method achieves 45% lower memory usage and 40% higher throughput than state-of-the-art baselines, enabling training of 50B-parameter models on a single 16GB V100 GPU with 512GB CPU memory, without model partitioning or batch size limitations.

ABSTRACT

Widely popular transformer-based NLP models such as BERT and Turing-NLG have enormous capacity trending to billions of parameters. Current execution methods demand brute-force resources such as HBM devices and high speed interconnectivity for data parallelism. In this paper, we introduce a new relay-style execution technique called L2L (layer-to-layer) where at any given moment, the device memory is primarily populated only with the executing layer(s)'s footprint. The model resides in the DRAM memory attached to either a CPU or an FPGA as an entity we call eager param-server (EPS). To overcome the bandwidth issues of shuttling parameters to and from EPS, the model is executed a layer at a time across many micro-batches instead of the conventional method of minibatches over whole model. L2L is implemented using 16GB V100 devices for BERT-Large running it with a device batch size of up to 256. Our results show 45% reduction in memory and 40% increase in the throughput compared to the state-of-the-art baseline. L2L is also able to fit models up to 50 Billion parameters on a machine with a single 16GB V100 and 512GB CPU memory and without requiring any model partitioning. L2L scales to arbitrary depth allowing researchers to develop on affordable devices which is a big step toward democratizing AI. By running the optimizer in the host EPS, we show a new form of mixed precision for faster throughput and convergence. In addition, the EPS enables dynamic neural architecture approaches by varying layers across iterations. Finally, we also propose and demonstrate a constant memory variation of L2L and we propose future enhancements. This work has been performed on GPUs first, but also targeted towards all high TFLOPS/Watt accelerators.

Motivation & Objective

  • To address the growing memory and compute demands of large-scale transformer models like BERT and GPT-3, which exceed the capacity of standard GPUs.
  • To enable training of billion-parameter models on affordable hardware without requiring high-bandwidth memory (HBM) devices or model partitioning.
  • To develop a constant-memory execution method that scales to arbitrary model depth and supports dynamic neural architecture search.
  • To reduce memory pressure and improve throughput by shifting model weights and optimizer state to a CPU-based eager param-server (EPS) and executing layers sequentially.
  • To enable mixed-precision training and efficient data parallelism through a novel, low-overhead parameter transfer mechanism between GPU and CPU.

Proposed method

  • L2L uses a relay-style execution where only the current layer's parameters and activations are stored in GPU memory, while the full model resides in DRAM on a CPU or FPGA as an eager param-server (EPS).
  • The EPS preloads and transmits the next layer's parameters to the GPU just before execution, minimizing idle time and reducing transfer frequency through inner-looping.
  • The method processes microbatches sequentially across layers instead of full minibatches, reducing memory footprint and enabling constant memory usage regardless of model depth.
  • The EPS handles gradient reduction and weight updates in parallel with GPU computation, enabling a new form of mixed-precision training with faster convergence.
  • A future extension, L2Lp, introduces fully parallel reduction and weight update in the EPS, with high-speed NVLinks used only for loading the next layer, minimizing bandwidth dependency.
  • The approach supports dynamic neural architecture search by allowing structural changes per iteration, as layers are executed independently and can be modified on the fly.

Experimental results

Research questions

  • RQ1Can large transformer models be trained with constant memory on standard GPUs by offloading the model to a CPU-based param-server?
  • RQ2How does layer-wise execution with microbatches compare to conventional minibatch training in terms of memory usage and throughput?
  • RQ3Can the L2L method scale to extremely deep models (e.g., 384 layers) without running out of memory, even on a single 16GB V100?
  • RQ4To what extent can the EPS-based architecture enable faster convergence and higher throughput through optimized parameter transfer and mixed-precision training?
  • RQ5Can L2L support dynamic neural architecture search by allowing per-iteration layer modifications without recompilation or reconfiguration?

Key findings

  • L2L reduces GPU memory usage by 45% compared to the state-of-the-art baseline when training BERT-Large on a single 16GB V100 GPU.
  • The method increases training throughput by 40% over the baseline, even while reducing memory pressure.
  • L2L successfully trains BERT-Large with up to 256 device batch size on a single 16GB V100, a significant improvement over the baseline which struggles with batch size 2.
  • The approach supports models up to 50 billion parameters on a single 16GB V100 and 512GB CPU memory, without model partitioning or out-of-memory errors.
  • L2L maintains constant memory usage regardless of model depth, enabling training of models with up to 384 layers without memory overflow.
  • Validation curves show that L2L converges faster than the baseline in both FP32 and mixed-precision modes, indicating improved training efficiency.

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.