Skip to main content
QUICK REVIEW

[論文レビュー] AWQ: Activation-aware Weight Quantization for LLM Compression and Acceleration

Ji Lin, Jiaming Tang|arXiv (Cornell University)|Jun 1, 2023
Topic ModelingComputer Science被引用数 74
ひとこと要約

AWQは、活性化に基づくチャネル単位スケーリングを用いて、顕著な重みのごく一部を保護するウェイトのみの低ビット量子化手法を提示し、強い一般化性能を達成するとともに、FP16ベースラインで3.2–3.3xのスピードアップを実現し、エッジ展開を可能にする。

ABSTRACT

Large language models (LLMs) have transformed numerous AI applications. On-device LLM is becoming increasingly important: running LLMs locally on edge devices can reduce the cloud computing cost and protect users' privacy. However, the astronomical model size and the limited hardware resource pose significant deployment challenges. We propose Activation-aware Weight Quantization (AWQ), a hardware-friendly approach for LLM low-bit weight-only quantization. AWQ finds that not all weights in an LLM are equally important. Protecting only 1% salient weights can greatly reduce quantization error. To identify salient weight channels, we should refer to the activation distribution, not weights. To avoid the hardware-inefficient mix-precision quantization, we mathematically derive that scaling up the salient channels can reduce the quantization error. AWQ employs an equivalent transformation to scale the salient weight channels to protect them. The scale is determined by collecting the activation statistics offline. AWQ does not rely on any backpropagation or reconstruction, so it generalizes to different domains and modalities without overfitting the calibration set. AWQ outperforms existing work on various language modeling and domain-specific benchmarks (coding and math). Thanks to better generalization, it achieves excellent quantization performance for instruction-tuned LMs and, for the first time, multi-modal LMs. Alongside AWQ, we implement TinyChat, an efficient and flexible inference framework tailored for 4-bit on-device LLM/VLMs. With kernel fusion and platform-aware weight packing, TinyChat offers more than 3x speedup over the Huggingface FP16 implementation on both desktop and mobile GPUs. It also democratizes the deployment of the 70B Llama-2 model on mobile GPUs.

研究の動機と目的

  • 再訓練なしで大規模言語モデル(LLMs)のメモリおよび帯域 bottleneck を削減する動機付け。
  • LLMの性能に対して少数の重みが不均等に重要かを調査。
  • データ駆動でキャリブレーションセットに頑健な低ビット重み量子化手法を提案し、一般化を維持。
  • 実用的な速度アップと大規模モデルのエッジ展開の実現性を示す。

提案手法

  • ウェイトの大きさではなく、アクティベーションの大きさで顕著なウェイトチャネルを同定。
  • 顕在チャネルの量子化誤差を低減するためのチャネルごとのスケーリングを開発(AWQスケーリング)。
  • スケーリングを支配する単一ハイパーパラメータ alpha を [0,1] のグリッド探索で最適化。
  • 過剰適合を避けるため、グループサイズ128のINT3/INT4のグループ量子化と小規模キャリブレーションセットを使用。
  • オプションとして量子化誤差をさらに減らすためウェイトクリッピングを適用(Deltaの変化)。
  • 実用的な速度アップを実現するため、カーネル結合を備えたエッジ最適化推論フレームワークを提供。

実験結果

リサーチクエスチョン

  • RQ1バックプロパゲーションや再構成ベースの学習なしで、低ビットのウェイトのみの量子化はLLMの性能を維持できるか?
  • RQ2顕著ウェイトチャネルをアクティベーションベースで同定することは、ウェイト大きさのヒューリスティックより量子化品質を改善するか?
  • RQ3INT3/INT4、さらにはINT2(GPTQと組み合わせて)まで、アーキテクチャやモダリティを跨いで、許容される困惑度と性能を維持しつつどこまで量子化ビットを押し上げられるか?
  • RQ4AWQは限られたメモリのデバイスで大規模モデル(例: 70B)の実用的なエッジ展開を実現できるか?

主な発見

  • AWQは、7B–70BスケールのLLaMAおよびOPTファミリにおいて、RTNおよびGPTQを一貫して上回り困惑度で優れる。
  • AWQは混合精度(1% FP16)で競争力のある性能を達成しつつハードウェアに優しい。
  • アクティベーションベースの顕著性(チャネルの0.1–1%)は、ウェイトノルムのヒューリスティックと比べて困惑度を大幅に改善。
  • AWQは指示調整済みLMs(Vicuna)およびマルチモーダルLMs(OpenFlamingo-9B)へ、タスク固有のキャリブレーションなしに一般化する。
  • システム実装はデスクトップ/モバイルGPUでFP16と比較して2.7–3.9xのスピードアップを提供し、Jetson Orin上の70B Llama-2および4070ノートPC上で13Bを実現。
  • AWQはGPTQとは直交しており、GPTQと組み合わせるとINT2量子化をさらに改善できる。
  • 顕著性ベースのスケーリングは、RTNベースラインから困惑度を改善(例: OPT-6.7B Wiki PPL 23.54をs=2で11.92へ)。

この論文を読む

Nubintのビューアで原文を開き、読みながら気になる箇所をすぐに質問できます。

Nubintでこの論文を読む

このレビューはAIが論文の原文をもとに作成しました。引用する前に原文をご確認ください。