OmniQuant: Omnidirectionally Calibrated Quantization for Large Language Models

要約

大規模言語モデル (LLM) は、自然言語処理タスクに革命をもたらしました。
ただし、実際の展開は、膨大なメモリと計算要件によって妨げられます。
最近のポストトレーニング量子化 (PTQ) 手法は、メモリ フットプリントの削減と LLM の計算効率の向上に効果的ですが、量子化パラメータを手作業で作成するため、パフォーマンスが低下し、極度に低ビットの量子化に対処できません。
この問題に取り組むために、LLM 向けの全方向的に調整された量子化 (OmniQuant) 手法を導入します。これは、さまざまな量子化パラメータを効率的に最適化することで PTQ の計算効率を維持しながら、さまざまな量子化設定で優れたパフォーマンスを実現します。
OmniQuant は、学習可能な重みクリッピング (LWC) と学習可能な等価変換 (LET) を含む 2 つの革新的なコンポーネントで構成されています。
LWC は、クリッピングしきい値を最適化することで重みの極値を変調します。
一方、LET は、学習可能な等価変換を通じて量子化の課題をアクティベーションから重みに移すことで、アクティベーションの外れ値に取り組みます。
OmniQuant は、ブロック単位の誤差最小化を使用した微分可能なフレームワーク内で動作し、重みのみの量子化と重みアクティベーション量子化の両方の量子化プロセスを効率的に最適化できます。
たとえば、7 ~ 70B のサイズの LLaMA-2 モデル ファミリは、128 個のサンプルを使用して、単一の A100-40G GPU 上の OmniQuant で 1 ~ 16 時間以内に処理できます。
広範な実験により、W4A4、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, which leads to low performance and fails to deal with extremely low-bit quantization. To tackle this issue, we introduce an Omnidirectionally calibrated Quantization (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 through a learnable equivalent transformation. 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 with the size of 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, 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 and models 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
発行日 2023-08-25 02:28:35+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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