Mixed Precision Training

Paulius Micikevicius, Sharan Narang, Jonah Alben, Gregory Diamos, Erich Elsen +6 more
10/10/2017
2,737 citations
cs.AIcs.LGstat.ML

No official code found. Best implementation: baidu-research/DeepBench (1,109 stars, C++, Apache-2.0, last commit 2021-04-25).

Abstract

Deep neural networks have enabled progress in a wide variety of applications. Growing the size of the neural network typically results in improved accuracy.

Show full abstract

As model sizes grow, the memory and compute requirements for training these models also increases. We introduce a technique to train deep neural networks using half precision floating point numbers. In our technique, weights, activations and gradients are stored in IEEE half-precision format. Half-precision floating numbers have limited numerical range compared to single-precision numbers. We propose two techniques to handle this loss of information. Firstly, we recommend maintaining a single-precision copy of the weights that accumulates the gradients after each optimizer step. This single-precision copy is rounded to half-precision format during training. Secondly, we propose scaling the loss appropriately to handle the loss of information with half-precision gradients. We demonstrate that this approach works for a wide variety of models including convolution neural networks, recurrent neural networks and generative adversarial networks. This technique works for large scale models with more than 100 million parameters trained on large datasets. Using this approach, we can reduce the memory consumption of deep learning models by nearly 2x. In future processors, we can also expect a significant computation speedup using half-precision hardware units.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Benchmarking Deep Learning operations on different hardware

1,109243C++, CudaSep 23, 20165 years agoApache-2.0

Similar Papers

Cite this paper

@article{micikevicius2017mixed,
  title  = {Mixed Precision Training},
  author = {Paulius Micikevicius and Sharan Narang and Jonah Alben and Gregory Diamos and Erich Elsen and David Garcia and Boris Ginsburg and Michael Houston and Oleksii Kuchaiev and Ganesh Venkatesh and Hao Wu},
  year   = {2017},
  eprint = {1710.03740},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1710.03740}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1710.03740.svg)](https://codeofpaper.com/paper/1710.03740)

Discussion