Few-Bit Backward: Quantized Gradients of Activation Functions for Memory Footprint Reduction

Abstract

Memory footprint is one of the main limiting factors for large neural network training. In backpropagation, one needs to store the input to each operation in the computational graph. Every modern neural network model has quite a few pointwise nonlinearities in its architecture, and such operations induce additional memory costs that, as we show, can be significantly reduced by quantization of the gradients. We propose a systematic approach to compute optimal quantization of the retained gradients of the pointwise nonlinear functions with only a few bits per each element. We show that such approximation can be achieved by computing an optimal piecewise-constant approximation of the derivative of the activation function, which can be done by dynamic programming. The drop-in replacements are implemented for all popular nonlinearities and can be used in any existing pipeline. We confirm the memory reduction and the same convergence on several open benchmarks.

Cite

Text

Novikov et al. "Few-Bit Backward: Quantized Gradients of Activation Functions for Memory Footprint Reduction." International Conference on Machine Learning, 2023.

Markdown

[Novikov et al. "Few-Bit Backward: Quantized Gradients of Activation Functions for Memory Footprint Reduction." International Conference on Machine Learning, 2023.](https://mlanthology.org/icml/2023/novikov2023icml-fewbit/)

BibTeX

@inproceedings{novikov2023icml-fewbit,
  title     = {{Few-Bit Backward: Quantized Gradients of Activation Functions for Memory Footprint Reduction}},
  author    = {Novikov, Georgii Sergeevich and Bershatsky, Daniel and Gusak, Julia and Shonenkov, Alex and Dimitrov, Denis Valerievich and Oseledets, Ivan},
  booktitle = {International Conference on Machine Learning},
  year      = {2023},
  pages     = {26363-26381},
  volume    = {202},
  url       = {https://mlanthology.org/icml/2023/novikov2023icml-fewbit/}
}