[Paper Review] Revisiting BFloat16 Training
This paper demonstrates that 16-bit-FPU training using BFloat16 can achieve model accuracy matching or exceeding 32-bit training by replacing standard nearest rounding with stochastic rounding and Kahan summation for weight updates. These numerical techniques reduce update cancellation and convergence degradation, enabling high-accuracy training on pure 16-bit hardware with up to 7% absolute accuracy gain and 0.1% to 0.2% better validation accuracy than 32-bit training across seven models.
State-of-the-art generic low-precision training algorithms use a mix of 16-bit and 32-bit precision, creating the folklore that 16-bit hardware compute units alone are not enough to maximize model accuracy. As a result, deep learning accelerators are forced to support both 16-bit and 32-bit floating-point units (FPUs), which is more costly than only using 16-bit FPUs for hardware design. We ask: can we train deep learning models only with 16-bit floating-point units, while still matching the model accuracy attained by 32-bit training? Towards this end, we study 16-bit-FPU training on the widely adopted BFloat16 unit. While these units conventionally use nearest rounding to cast output to 16-bit precision, we show that nearest rounding for model weight updates often cancels small updates, which degrades the convergence and model accuracy. Motivated by this, we study two simple techniques well-established in numerical analysis, stochastic rounding and Kahan summation, to remedy the model accuracy degradation in 16-bit-FPU training. We demonstrate that these two techniques can enable up to 7% absolute validation accuracy gain in 16-bit-FPU training. This leads to 0.1% lower to 0.2% higher validation accuracy compared to 32-bit training across seven deep learning applications.
Motivation & Objective
- To determine whether 16-bit-FPU-only training can match the accuracy of 32-bit training in deep learning models.
- To identify the root cause of accuracy degradation in standard 16-bit-FPU training, particularly due to nearest rounding of weight updates.
- To evaluate whether established numerical analysis techniques—stochastic rounding and Kahan summation—can restore model accuracy in 16-bit-FPU training.
- To assess the feasibility of lower-precision training (below 16-bit) and the limitations of Float16 compared to BFloat16 for 16-bit-FPU training.
- To guide future hardware design by proving that 32-bit FPUs are not necessary for high-accuracy training when combined with proper software techniques.
Proposed method
- Replace standard nearest rounding with stochastic rounding for model weight updates to eliminate bias in weight estimation and maintain convergence speed.
- Apply Kahan summation to reduce floating-point error accumulation during gradient and optimizer state accumulation in 16-bit-FPU training.
- Use BFloat16 format with 8 exponent bits and 7 mantissa bits, leveraging its larger dynamic range compared to Float16.
- Implement the two techniques—stochastic rounding and Kahan summation—simultaneously on model weights to test robustness and synergy.
- Conduct ablation studies across seven deep learning models (ResNet-18, DLRM, BERT, etc.) using CIFAR-10, Criteo Kaggle, and Terabyte datasets.
- Compare training and validation accuracy across 32-bit, standard 16-bit-FPU (nearest rounding), and enhanced 16-bit-FPU (with stochastic rounding and/or Kahan summation) configurations.
Experimental results
Research questions
- RQ1Does nearest rounding in 16-bit-FPU training cause significant convergence degradation and accuracy loss in deep learning models?
- RQ2Can stochastic rounding and Kahan summation effectively mitigate accuracy degradation in 16-bit-FPU training without requiring 32-bit FPUs?
- RQ3How does the dynamic range of BFloat16 compare to Float16 in enabling stable 16-bit-FPU training?
- RQ4What is the impact of precision reduction below 16-bit on model accuracy, and what additional techniques are needed?
- RQ5Can 16-bit-FPU training with optimized rounding and summation techniques match or exceed 32-bit training accuracy across diverse deep learning models?
Key findings
- Standard 16-bit-FPU training with nearest rounding results in up to 16% lower training accuracy and 7% lower validation accuracy compared to 32-bit training.
- The percentage of non-zero weight updates that are canceled due to nearest rounding exceeds 80% in mid-to-late training stages on DLRM models, especially under constant or decaying learning rates.
- Stochastic rounding and Kahan summation together enable 16-bit-FPU training to achieve validation accuracy matching or exceeding 32-bit training, with gains of up to 7% absolute accuracy.
- On average, 16-bit-FPU training with these techniques achieves 0.1% lower to 0.2% higher validation accuracy than 32-bit training across seven diverse deep learning applications.
- Training with Float16 precision—even with stochastic rounding or Kahan summation—results in significant accuracy degradation due to its limited dynamic range, despite similar mantissa precision to BFloat16.
- Lower-precision training (10, 12, 14-bit) without additional techniques shows lower accuracy than 16-bit or 32-bit training, indicating that 16-bit is a practical lower bound for generic model training.
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.