Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

SmoothQuant: Accurate and Efficient Post-Training Quantization for Large Language Models

About

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, Llama-1/2, Falcon, Mistral, and Mixtral models. We demonstrate up to 1.56x speedup and 2x 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. Code is available at https://github.com/mit-han-lab/smoothquant.

Guangxuan Xiao, Ji Lin, Mickael Seznec, Hao Wu, Julien Demouth, Song Han• 2022

Related benchmarks

TaskDatasetResultRank
Language ModelingWikiText2
Perplexity5.18
2839
Language ModelingWikiText-2 (test)
PPL5.62
1949
Commonsense ReasoningHellaSwag
Accuracy79.21
1891
Language ModelingWikiText-2
Perplexity (PPL)7.09
1624
Visual Question AnsweringVizWiz
Accuracy70
1525
Language ModelingC4
Perplexity6.76
1422
Visual Question AnsweringTextVQA
Accuracy70.4
1285
Commonsense ReasoningWinoGrande
Accuracy61.3
1085
Language ModelingC4
Perplexity12.72
1071
Code GenerationHumanEval--
1036
Showing 10 of 121 rows
...

Other info

Follow for update