Efficient Post-training Quantization with FP8 Formats

Haihao Shen, Naveen Mellempudi, Xin He, Qun Gao, Chang Wang +1 more
9/26/2023
cs.LGcs.AIcs.CL

Official code: intel/neural-compressor (2,672 stars, Apache-2.0, last commit 2026-04-30).

Abstract

Recent advances in deep learning methods such as LLMs and Diffusion models have created a need for improved quantization methods that can meet the computational demands of these modern architectures while maintaining accuracy. Towards this goal, we study the advantages of FP8 data formats for post-training quantization across 75 unique network architectures covering a wide range of tasks, including machine translation, language modeling, text generation, image classification, generation, and segmentation. We examine three different FP8 representations (E5M2, E4M3, and E3M4) to study the effects of varying degrees of trade-off between dynamic range and precision on model accuracy. Based on our extensive study, we developed a quantization workflow that generalizes across different network architectures. Our empirical results show that FP8 formats outperform INT8 in multiple aspects, including workload coverage (92.64% vs. 65.87%), model accuracy and suitability for a broader range of operations. Furthermore, our findings suggest that E4M3 is better suited for NLP models, whereas E3M4 performs marginally better than E4M3 on computer vision tasks. The code is publicly available on Intel Neural Compressor: https://github.com/intel/neural-compressor.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

SOTA low-bit LLM quantization (INT8/FP8/MXFP8/INT4/MXFP4/NVFP4) & sparsity; leading model compression techniques on PyTorch, TensorFlow, and ONNX Runtime

2,672313Roff, ShellJul 21, 20205 months agoApache-2.0
auto-tuningawqfp4gptqint4+12 more

Similar Papers

Cite this paper

@article{shen2023efficient,
  title  = {Efficient Post-training Quantization with FP8 Formats},
  author = {Haihao Shen and Naveen Mellempudi and Xin He and Qun Gao and Chang Wang and Mengni Wang},
  year   = {2023},
  eprint = {2309.14592},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2309.14592v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2309.14592.svg)](https://codeofpaper.com/paper/2309.14592)

Discussion