Abstract
Recently, the idea of using FP8 as a number format for neural network training has been floating around the deep learning world. Given that most training is currently conducted with entire networks in FP32, or sometimes FP16 with mixed-precision, the step to having some parts of a network run in FP8 with 8-bit weights is an appealing potential speed-up for the generally costly and time-intensive training procedures in deep learning. A natural question arises regarding what this development means for efficient inference on edge devices. In the efficient inference device world, workloads are frequently executed in INT8. Sometimes going even as low as INT4 when efficiency calls for it. In this whitepaper, we compare the performance for both the FP8 and INT formats for efficient on-device inference. We theoretically show the difference between the INT and FP formats for neural networks and present a plethora of post-training quantization and quantization-aware-training results to show how this theory translates to practice. We also provide a hardware analysis showing that the FP formats are somewhere between 50-180% less efficient in terms of compute in dedicated hardware than the INT format. Based on our research and a read of the research field, we conclude that although the proposed FP8 format could be good for training, the results for inference do not warrant a dedicated implementation of FP8 in favor of INT8 for efficient inference.
Introduction
Quantization is a cornerstone of efficient deep learning, enabling the deployment of complex models on resource-constrained edge devices by converting high-precision FP32 values into lower-precision formats. While INT8 has long been the industry standard for inference, the emergence of FP8 (8-bit floating point) in high-end training architectures like Nvidia’s Hopper has sparked interest in its potential for deployment. The core proposition is a unified pipeline: "train in FP8, deploy in FP8," potentially eliminating the complexities of quantization-aware training (QAT). This paper evaluates whether FP8 can truly challenge INT8's dominance in the inference domain.
Methods
The evaluation was conducted through three primary lenses:
- Hardware Analysis: Estimating the silicon area and power consumption (gate count) for Multiply-Accumulate (MAC) units. The study compared fixed-point (Kulisch) accumulators against floating-point accumulators for various 8-bit formats.
- Theoretical Modeling: Analyzing how different 8-bit configurations (varying exponent bits from E2 to E5) represent common neural network distributions, such as Gaussian and Student-T.
- Empirical Benchmarking: Testing a wide array of models (ResNet, MobileNet, BERT, YOLOv5, etc.) across vision, NLP, and LiDAR tasks using both Post-Training Quantization (PTQ) and QAT.
Theoretical and Hardware Analysis
A critical finding of the research is the "hardware tax" associated with floating-point arithmetic. Floating-point logic is inherently more complex than integer logic.
As shown in the hardware analysis in Figure 5, an FP8-E4 implementation is at least 50% less efficient in terms of area and energy than INT8. This gap widens significantly when using high-precision accumulators; an FP8 setup with an FP32 accumulator is approximately 183% less efficient than a comparable INT8 setup.
The theoretical advantage of FP8 lies in its dynamic range, which is beneficial for capturing outliers. This is particularly relevant for Transformer-based models like BERT. However, for standard convolutional neural networks, the uniform quantization grid of INT8 often provides higher precision in the regions where the majority of the data resides.
Figure 6 illustrates how different formats perform across statistical distributions. While FP8 formats with more exponent bits (E4, E5) handle heavy-tailed distributions (like Student-T) better, INT8 and low-exponent formats (E2) excel on uniform and normal distributions, which are common in many neural network layers.
Empirical Results
The empirical results reinforce the theoretical findings. In PTQ scenarios, FP8-E4 showed advantages for Transformers due to their inherent outliers. However, for most other architectures, INT8 or FP8-E2 (which behaves similarly to INT8) proved superior.
When QAT is employed, the performance gap narrows or reverses. QAT allows models to learn to suppress outliers, making the high dynamic range of FP8 less necessary. In these cases, the superior precision of INT8 often leads to higher final accuracy. For instance, on MobileNetV2, INT8 achieved 71.82% accuracy compared to 70.89% for FP8-E4.
Furthermore, the study found that models trained in FP8 can be converted to INT8 for deployment with minimal to no accuracy loss. This suggests that even if FP8 becomes a standard for training, it does not necessitate a shift in inference hardware.
Conclusion
While FP8 is a promising format for accelerating neural network training and handling noisy gradients, it does not currently offer a compelling case for replacing INT8 in efficient edge inference. The significant hardware overhead—ranging from 50% to 180%—outweighs the marginal accuracy benefits that can often be matched or exceeded by INT8 through proper quantization techniques like QAT. For dedicated inference silicon, INT8 remains the most efficient and effective choice.
Summary updated