FP8 versus INT8 for efficient deep learning inference
Mart van Baalen, Andrey Kuzmin, Suparna S Nair, Yuwei Ren, Eric Mahurin, Chirag Patel, Sundar Subramanian, Sanghyuk Lee, Markus Nagel, Joseph Soriaga, Tijmen Blankevoort
TL;DR
The paper evaluates FP8 versus INT8 for on-device neural network inference, combining theoretical analysis of number formats with extensive PTQ and QAT experiments across diverse models. It demonstrates that FP8 formats (especially FP8-E4/E5) incur substantial hardware costs and, for most well-behaved networks, do not yield better accuracy than INT8; transformer-specific outlier cases can momentarily favor FP8, but hardware inefficiencies and available quantization tricks render FP8 unnecessary. The authors argue that INT8 (and occasionally INT4 with W8A16) provides superior practical efficiency, with FP8 primarily suited for training rather than inference. They also show that FP8-to-INT8 conversions can preserve or improve accuracy in many cases, reinforcing INT8 as the robust path for edge deployment and suggesting that FP8-based inference hardware is unlikely to offer net benefits. Overall, the work aligns with prior findings but offers a broader, hardware-aware comparison that cautions against FP8 adoption for inference.
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. We show that our results are mostly consistent with previous findings but that important comparisons between the formats have thus far been lacking. Finally, we discuss what happens when FP8-trained networks are converted to INT8 and conclude with a brief discussion on the most efficient way for on-device deployment and an extensive suite of INT8 results for many models.
