ZeroQuant-FP: A Leap Forward in LLMs Post-Training W4A8 Quantization Using Floating-Point Formats

Xiaoxia Wu, Zhewei Yao, Yuxiong He
7/19/2023
cs.LGcs.AIcs.CL

Official code: deepspeedai/DeepSpeed (43,229 stars, Apache-2.0, PyTorch, last commit 2026-04-29).

Abstract

In the complex domain of large language models (LLMs), striking a balance between computational efficiency and maintaining model quality is a formidable challenge. Navigating the inherent limitations of uniform quantization, particularly when dealing with outliers, and motivated by the launch of NVIDIA's H100 hardware, this study delves into the viability of floating-point (FP) quantization, particularly focusing on FP8 and FP4, as a potential solution. Our comprehensive investigation reveals that for LLMs, FP8 activation consistently outshines its integer (INT8) equivalent, with the performance edge becoming more noticeable in models possessing parameters beyond one billion. For weight quantization, our findings indicate that FP4 exhibits comparable, if not superior, performance to INT4, simplifying deployment on FP-supported hardware like H100. To mitigate the overhead from precision alignment caused by the disparity between weights and activations, we propose two scaling constraints for weight quantization that negligibly impact the performance compared to the standard W4A8 model. We additionally enhance our quantization methods by integrating the Low Rank Compensation (LoRC) strategy, yielding improvements especially in smaller models. The results of our investigation emphasize the immense potential of FP quantization for LLMs, paving the way for high-efficiency deployment in resource-limited settings.

View on arXivView PDF

Code Implementations(1)

PyTorchApache-2.0

DeepSpeed is a deep learning optimization library that makes distributed training and inference easy, efficient, and effective.

43,2295,039C, C++Jan 23, 20205 months agoApache-2.0
billion-parameterscompressiondata-parallelismdeep-learninggpu+8 more

Similar Papers

Cite this paper

@article{wu2023zeroquantfp,
  title  = {ZeroQuant-FP: A Leap Forward in LLMs Post-Training W4A8 Quantization Using Floating-Point Formats},
  author = {Xiaoxia Wu and Zhewei Yao and Yuxiong He},
  year   = {2023},
  eprint = {2307.09782},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2307.09782v2}
}

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/2307.09782.svg)](https://codeofpaper.com/paper/2307.09782)

Discussion