[Paper Review] Mixed Precision Training
The paper shows how to train deep networks using FP16 storage and arithmetic with a FP32 master weight copy, loss scaling, and FP16 accumulation to retain FP32-level accuracy across diverse models and tasks.
Deep neural networks have enabled progress in a wide variety of applications. Growing the size of the neural network typically results in improved accuracy. 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.
Motivation & Objective
- Reduce memory and compute demands for training large neural networks.
- Maintain FP32-level accuracy when training with reduced-precision (FP16).
- Provide a practical, hyper-parameter-agnostic approach applicable to diverse architectures and tasks.
Proposed method
- Store weights, activations, and gradients in FP16 during forward/backward passes.
- Maintain FP32 master copies of weights to accumulate updates safely.
- Apply loss scaling to preserve small gradient values in FP16.
- Perform FP16 arithmetic with reductions and accumulations in FP32 when necessary (e.g., dot-products, reductions).
- Use Tensor Core-accelerated FP16 operations where available, with FP32 accumulation to memory.
Experimental results
Research questions
- RQ1Can FP16 training with a FP32 master weight copy, loss scaling, and FP16-to-FP32 accumulation achieve FP32-equivalent accuracy across diverse models?
- RQ2What are the practical requirements (techniques, scaling factors) needed to prevent information loss in FP16 during training?
- RQ3How does mixed-precision training perform on CNNs, RNNs, and GANs compared to FP32 baselines?
- RQ4What are the impacts on memory usage and training speed across tasks and architectures?
Key findings
- FP16 storage with FP32 master weights matches FP32 accuracy on CNNs for ILSVRC classification across AlexNet, VGG-D, GoogLeNet, Inception variants, and ResNet-50.
- Loss scaling enables stable training for detection and other tasks when using FP16.
- Mixing FP16 arithmetic with FP32 accumulation and selective FP32 reductions preserves critical gradient information.
- Across CNNs, RNNs, and GANs, mixed-precision training achieves comparable accuracy to FP32 with substantial memory savings.
- Training speedups up to 2x–8x are possible on Volta GPUs for memory- or arithmetic-bound workloads; full-network speedups depend on libraries/frameworks.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.