OmniQuant: Omnidirectionally Calibrated Quantization for Large Language Models

要約

大規模言語モデル (LLM) は、自然言語処理タスクに革命をもたらしました。
ただし、実際の展開は、膨大なメモリと計算要件によって妨げられます。
最近のポストトレーニング量子化 (PTQ) 手法は、メモリ フットプリントの削減と LLM の計算効率の向上に効果的ですが、量子化パラメータを手作業で作成するため、特に極度に低ビットの量子化においてパフォーマンスの低下につながります。
この問題に取り組むために、LLM 用の全方向的に調整された量子化 (\textbf{OmniQuant}) 手法を導入します。これは、さまざまな量子化パラメーターを効率的に最適化することで PTQ の計算効率を維持しながら、さまざまな量子化設定で優れたパフォーマンスを実現します。
OmniQuant は、学習可能な重みクリッピング (LWC) と学習可能な等価変換 (LET) を含む 2 つの革新的なコンポーネントで構成されています。
LWC は、クリッピングしきい値を最適化することで重みの極値を変調します。
一方、LET は、量子化の課題をアクティベーションから重みに移すことで、アクティベーションの外れ値に取り組みます。
OmniQuant は、ブロック単位の誤差最小化を使用した微分可能なフレームワーク内で動作し、重みのみの量子化と重みアクティベーション量子化の両方の量子化プロセスを効率的に最適化できます。
たとえば、LLaMA-2 モデル ファミリ サイズ 7 ~ 70B は、128 個のサンプルを使用して、単一の A100-40G GPU 上の OmniQuant で 1 ~ 16 時間以内に処理できます。
広範な実験により、W4A4 (4 ビットの重み、4 ビットのアクティベーション)、W6A6、W4A16、W3A16、W2A16 などのさまざまな量子化構成にわたる OmniQuant の優れたパフォーマンスが検証されています。
さらに、OmniQuant は命令調整モデルでの有効性を実証し、実際のデバイスでの推論速度とメモリ削減に顕著な改善をもたらします。
コードは \url{https://github.com/OpenGVLab/OmniQuant} で入手できます。

要約(オリジナル)

Large language models (LLMs) have revolutionized natural language processing tasks. However, their practical deployment is hindered by their immense memory and computation requirements. Although recent post-training quantization (PTQ) methods are effective in reducing memory footprint and improving the computational efficiency of LLM, they hand-craft quantization parameters, leading to low performance, especially in extremely low-bit quantization. To tackle this issue, we introduce an Omnidirectionally calibrated Quantization (\textbf{OmniQuant}) technique for LLMs, which achieves good performance in diverse quantization settings while maintaining the computational efficiency of PTQ by efficiently optimizing various quantization parameters. OmniQuant comprises two innovative components including Learnable Weight Clipping (LWC) and Learnable Equivalent Transformation (LET). LWC modulates the extreme values of weights by optimizing the clipping threshold. Meanwhile, LET tackles activation outliers by shifting the challenge of quantization from activations to weights. Operating within a differentiable framework using block-wise error minimization, OmniQuant can optimize the quantization process efficiently for both weight-only and weight-activation quantization. For instance, the LLaMA-2 model family size 7-70B can be processed with OmniQuant on a single A100-40G GPU within 1-16 hours using 128 samples. Extensive experiments validate OmniQuant’s superior performance across diverse quantization configurations such as W4A4 (4-bit weight, 4-bit activation), W6A6, W4A16, W3A16, and W2A16. Additionally, OmniQuant demonstrates effectiveness in instruction-tuned models and delivers notable improvements in inference speed and memory reduction on real devices. Codes are available at \url{https://github.com/OpenGVLab/OmniQuant}.

arxiv情報

著者 Wenqi Shao,Mengzhao Chen,Zhaoyang Zhang,Peng Xu,Lirui Zhao,Zhiqian Li,Kaipeng Zhang,Peng Gao,Yu Qiao,Ping Luo
発行日 2024-03-18 05:33:22+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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