SmoothQuant: Accurate and Efficient Post-Training Quantization for Large Language Models
Abstract
Large language models (LLMs) show excellent performance but are compute- and memory-intensive. Quantization can reduce memory and accelerate inference. However, existing methods cannot maintain accuracy and hardware efficiency at the same time. We propose SmoothQuant, a training-free, accuracy-preserving, and general-purpose post-training quantization (PTQ) solution to enable 8-bit weight, 8-bit activation (W8A8) quantization for LLMs. Based on the fact that weights are easy to quantize while activations are not, SmoothQuant smooths the activation outliers by offline migrating the quantization difficulty from activations to weights with a mathematically equivalent transformation. SmoothQuant enables an INT8 quantization of both weights and activations for all the matrix multiplications in LLMs, including OPT, BLOOM, GLM, MT-NLG, and LLaMA family. We demonstrate up to 1.56$\times$ speedup and 2$\times$ memory reduction for LLMs with negligible loss in accuracy. SmoothQuant enables serving 530B LLM within a single node. Our work offers a turn-key solution that reduces hardware costs and democratizes LLMs.
Cite
Text
Xiao et al. "SmoothQuant: Accurate and Efficient Post-Training Quantization for Large Language Models." International Conference on Machine Learning, 2023.Markdown
[Xiao et al. "SmoothQuant: Accurate and Efficient Post-Training Quantization for Large Language Models." International Conference on Machine Learning, 2023.](https://mlanthology.org/icml/2023/xiao2023icml-smoothquant/)BibTeX
@inproceedings{xiao2023icml-smoothquant,
title = {{SmoothQuant: Accurate and Efficient Post-Training Quantization for Large Language Models}},
author = {Xiao, Guangxuan and Lin, Ji and Seznec, Mickael and Wu, Hao and Demouth, Julien and Han, Song},
booktitle = {International Conference on Machine Learning},
year = {2023},
pages = {38087-38099},
volume = {202},
url = {https://mlanthology.org/icml/2023/xiao2023icml-smoothquant/}
}