Mixed Precision Training
1. Research problem
FP32 training dominates memory bandwidth and storage, while naive FP16 training loses small gradients and fails to converge.
2. Motivation
The authors wanted the speed and memory benefits of half precision without sacrificing model accuracy.
3. Previous approaches
FP16 training had been attempted but required hand-tuning; earlier work lacked a general recipe combining master weights and loss scaling.
4. Core contribution
Showed that storing weights, activations, and gradients in FP16 while keeping an FP32 master copy and applying loss scaling preserves accuracy while halving memory traffic.
5. Mathematical formulation
Compute forward/backward in FP16, multiply the loss by a scale factor S before backpropagation, unscale gradients, update FP32 master weights, and cast back to FP16.
6. Methodology
Analyze the gradient underflow problem in FP16, then validate the recipe across large networks with controlled precision ablations.
7. Architecture
Applies to any deep network; experiments on large CNNs and recurrent language models.
8. Experimental setup
Image classification, speech recognition, and language modeling with FP32 versus mixed-precision training.
9. Datasets
ImageNet, speech recognition corpora, language modeling corpora used in the experiments.
10. Results
Matched FP32 accuracy while reducing memory use and increasing training throughput, enabling larger models and batch sizes.
11. Limitations
Requires hardware with fast FP16 tensor cores; certain operations still need FP32 accumulation; loss scaling needs care with very large gradients.
12. Critical analysis
A classic example of how numerical representation choices become a systems lever for scaling, foundational for later quantization work.
13. Implementation tasks
- 1.Implement mixed-precision training with FP32 master weights and loss scaling for a small model.
- 2.Plot the fraction of gradients that underflow in FP16 with and without loss scaling.
- 3.Compare training throughput and final accuracy against FP32.
14. Follow-up work
- 1.Deep Compression: Compressing Deep Neural Networks with Pruning, Trained Quantization and Huffman Coding (Han et al., 2015)
- 2.LLM.int8(): 8-bit Matrix Multiplication for Transformers at Scale (Dettmers et al., 2022)
15. Open research questions
- 1.Which operations must remain in higher precision for stable training?
- 2.How far can precision be reduced before fine-tuning becomes impossible?