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

要約

大規模言語モデル (LLM) は優れたパフォーマンスを示しますが、計算とメモリを大量に消費します。
量子化により、メモリが削減され、推論が高速化されます。
ただし、1000 億を超えるパラメーターの LLM の場合、既存の方法では精度を維持できないか、ハードウェア上で効率的に実行できません。
LLM の 8 ビット重み、8 ビット アクティベーション (W8A8) 量子化を可能にする、トレーニング不要で精度を維持する汎用のトレーニング後量子化 (PTQ) ソリューションである SmoothQuant を提案します。
重みは簡単に量子化できますが、アクティベーションは簡単に量子化できないという事実に基づいて、SmoothQuant は、数学的に等価な変換を使用して、量子化の難しさをアクティベーションからウェイトにオフラインで移行することにより、アクティベーションの異常値を平滑化します。
SmoothQuant は、OPT-175B、BLOOM-176B、GLM-130B、および MT-NLG 530B を含む LLM のすべての行列乗算の重みと活性化の両方の INT8 量子化を有効にします。
SmoothQuant は、既存の手法よりも優れたハードウェア効率を備えています。
LLM については、最大 1.56 倍のスピードアップと 2 倍のメモリ削減を示し、精度の損失はほとんどありません。
SmoothQuant を最先端の LLM サービング フレームワークである FasterTransformer に統合し、FP16 と比較して半数の GPU でより高速な推論速度を実現し、単一ノード内で 530B LLM のサービングを可能にします。
私たちの仕事は、ハードウェア コストを削減し、LLM を民主化するターンキー ソリューションを提供します。
コードは https://github.com/mit-han-lab/smoothquant で入手できます。

要約(オリジナル)

Large language models (LLMs) show excellent performance but are compute- and memory-intensive. Quantization can reduce memory and accelerate inference. However, for LLMs beyond 100 billion parameters, existing methods cannot maintain accuracy or do not run efficiently on hardware. 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-175B, BLOOM-176B, GLM-130B, and MT-NLG 530B. SmoothQuant has better hardware efficiency than existing techniques. We demonstrate up to 1.56x speedup and 2x memory reduction for LLMs with negligible loss in accuracy. We integrate SmoothQuant into FasterTransformer, a state-of-the-art LLM serving framework, and achieve faster inference speed with half the number of GPUs compared to FP16, enabling the serving of a 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.

arxiv情報

著者 Guangxuan Xiao,Ji Lin,Mickael Seznec,Hao Wu,Julien Demouth,Song Han
発行日 2023-02-14 21:31:03+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.AI, cs.CL, cs.LG パーマリンク