Abstract
As neural networks scale to hundreds of billions of parameters, the computational and memory requirements for training have become significant bottlenecks. This paper proposes a standardized 8-bit floating point (FP8) format designed to accelerate deep learning while maintaining model accuracy. By employing a hybrid approach with two distinct encodings—E4M3 for precision and E5M2 for dynamic range—we demonstrate that 8-bit training can match the performance of 16-bit sessions across a wide range of models, including Large Language Models (LLMs) with up to 175 billion parameters.
Introduction
The transition from 32-bit (FP32) to 16-bit (FP16 or bfloat16) precision was a landmark achievement that enabled the current era of large-scale deep learning. However, the search for further efficiency has led to the exploration of 8-bit formats. While 8-bit integers (INT8) are widely used for inference, they often lack the necessary dynamic range and precision for the delicate gradients and weight updates required during training. This work introduces a flexible FP8 framework that addresses these challenges.
Proposed FP8 Formats
We propose a hybrid approach using two different FP8 encodings tailored to specific needs within the network:
- E4M3 (4-bit exponent, 3-bit mantissa): Optimized for weights and activations, this format provides higher precision. To maximize its utility, we deviate from IEEE 754 standards by reclaiming bit patterns typically reserved for infinities, thereby extending the representable range to ±448.
- E5M2 (5-bit exponent, 2-bit mantissa): Optimized for gradients, this format offers a wider dynamic range (similar to FP16) to accommodate the small and volatile nature of gradient values, albeit at the cost of some precision.
Training Methodology
To effectively utilize the narrow 8-bit window, we employ per-tensor scaling factors to shift data into the representable range before casting to FP8. Additionally, we found that saturating values—clipping them to the maximum representable value rather than zeroing them out—is essential for maintaining training stability when values exceed the format's range.
Evaluation and Results
The proposed FP8 formats were evaluated across a diverse set of industry-standard benchmarks, including computer vision (ImageNet), language translation (WMT16), and large-scale language modeling.
Computer Vision and Translation
Testing across 13 different CNN and Transformer architectures, including ResNet, VGG, and Vision Transformers (DeiT), showed that the Top-1 accuracy gap between FP16 and FP8 was typically within 0.1% to 0.3%. Similar parity was achieved in language translation tasks using GNMT and Transformer models.
Large Language Models (LLMs)
The scalability of FP8 was rigorously tested on GPT-style models ranging from 126 million to 175 billion parameters. As illustrated in Figure 1, the training loss (perplexity) curves for FP8 are virtually indistinguishable from the bfloat16 baselines, confirming that FP8 can support the training of the world's largest models without loss of quality.
Conclusion
FP8 represents a new frontier for scaling deep learning. Our results show that it matches 16-bit performance across a wide array of tasks and model sizes. Furthermore, FP8's non-linear sampling of the real number line makes it superior to INT8 for post-training quantization. While these experiments utilized software simulation, the integration of native FP8 support in next-generation hardware will unlock significant speedups and memory savings for the entire deep learning ecosystem.
Summary updated