Inverted Activations: Reducing Memory Footprint in Neural Network Training
Not on the map. Why?
Abstract (arXiv)
The scaling of neural networks with increasing data and model sizes necessitates the development of more efficient deep learning algorithms. A significant challenge in neural network training is the memory footprint associated with activation tensors, particularly in pointwise nonlinearity layers that traditionally save the entire input tensor for the backward pass, leading to substantial memory consumption. In this paper, we propose a modification to the handling of activation tensors in pointwise nonlinearity layers. Our method involves saving the output tensor instead of the input tensor during the forward pass. Since the subsequent layer typically also saves its input tensor, this approach reduces the total memory required by storing only one tensor between layers instead of two. This optimization is especially beneficial for transformer-based architectures like GPT, BERT, Mistral, and Llama. To enable this approach, we utilize the inverse function of the nonlinearity during the backward pass. As the inverse cannot be computed analytically for most nonlinearities, we construct accurate approximations using simpler functions. Experimental results demonstrate that our method significantly reduces memory usage without affecting training accuracy or computational performance. Our implementation is provided as a drop-in replacement for standard nonlinearity layers in the PyTorch framework, facilitating easy adoption without requiring architectural modifications.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 17 of its 24 references that are in the map. First posted on arXiv 22 Jul 2024.
Builds on
17 of 24 references.
References · 17
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,598
- 2020GLU Variants Improve Transformercited by 1,804
- 2017Quantization and Training of Neural Networks for Efficient Integer-Arithmetic-Only Inferencecited by 1,593
- 2017Mixed Precision Trainingcited by 1,156
- 2017Sigmoid-Weighted Linear Units for Neural Network Function Approximation in Reinforcement Learningcited by 950
- 2021A Survey of Quantization Methods for Efficient Neural Network Inferencecited by 815
- 2023OmniQuant: Omnidirectionally Calibrated Quantization for Large Language Modelscited by 424
- 2023LLM-QAT: Data-Free Quantization Aware Training for Large Language Modelscited by 324
- 2019Q8BERT: Quantized 8Bit BERTcited by 300
- 2019A Study of BFLOAT16 for Deep Learning Trainingcited by 232
- 2018Training Deep Neural Networks with 8-bit Floating Point Numberscited by 164
5 more
- 2020Data Movement Is All You Need: A Case Study on Optimizing Transformerscited by 108
- 2021Real-time Neural Radiance Caching for Path Tracingcited by 91
- 2024OneBit: Towards Extremely Low-bit Large Language Modelscited by 79
- 2021ActNN: Reducing Training Memory Footprint via 2-Bit Activation Compressed Trainingcited by 61
- 2022Few-Bit Backward: Quantized Gradients of Activation Functions for Memory Footprint Reductioncited by 14
Built on by
Not cited yet.