Skip to main content
QUICK REVIEW

[論文レビュー] Improving Post Training Neural Quantization: Layer-wise Calibration and Integer Programming

Itay Hubara, Yury Nahshan|arXiv (Cornell University)|Jun 14, 2020
Domain Adaptation and Few-Shot Learning参考文献 25被引用数 76
ひとこと要約

本論文は、ポストトレーニング量子化(PTQ)における層ごとの重みと活性化の最適化を行う AdaQuant と、各層のビット幅を整数計画法で割り当て、BN の調整を行う手法を提案し、非常に小さなキャリブレーションデータセットで視覚モデルと自然言語モデルの最先端結果を達成します。

ABSTRACT

Lately, post-training quantization methods have gained considerable attention, as they are simple to use, and require only a small unlabeled calibration set. This small dataset cannot be used to fine-tune the model without significant over-fitting. Instead, these methods only use the calibration set to set the activations' dynamic ranges. However, such methods always resulted in significant accuracy degradation, when used below 8-bits (except on small datasets). Here we aim to break the 8-bit barrier. To this end, we minimize the quantization errors of each layer separately by optimizing its parameters over the calibration set. We empirically demonstrate that this approach is: (1) much less susceptible to over-fitting than the standard fine-tuning approaches, and can be used even on a very small calibration set; and (2) more powerful than previous methods, which only set the activations' dynamic ranges. Furthermore, we demonstrate how to optimally allocate the bit-widths for each layer, while constraining accuracy degradation or model compression by proposing a novel integer programming formulation. Finally, we suggest model global statistics tuning, to correct biases introduced during quantization. Together, these methods yield state-of-the-art results for both vision and text models. For instance, on ResNet50, we obtain less than 1\% accuracy degradation --- with 4-bit weights and activations in all layers, but the smallest two. We open-sourced our code.

研究の動機と目的

  • サブ 8-bit 精度でのポストトレーニング量子化における精度低下の緩和を目的とする。
  • 小さなキャリブレーションセットを過学習させずに使用する層ごとの最適化法(AdaQuant)を開発する。
  • 精度/剪定制約の下で層間のビット幅を最適に割り当てる整数計画法を提案する。
  • 量子化によって生じるバイアスを緩和するためのバッチ正規化調整を導入する。
  • 異なるハードウェア環境に適した軽量かつ高度なデプロイメントパイプラインを提供する。

提案手法

  • AdaQuant: 完全精度と量子化出力の間の MSE を最小化するための重量と量子化パラメータの層ごとの結合最適化で、V が W を調整できる(Equation 2)または逐次/並列の変種(Eq. 3-4)を許容する。
  • 総合的な性能向上を最大化するための総精度低下制約の下で各層が( k,n ) ビット構成を選択する、混成精度ビット割り当ての整数計画法(Equations 5a–5d)。
  • Batch Normalization Tuning (BNT): BN を再構成し、キャリブレーションデータ上でランニング統計を再推定し、統計を補正するために BN を重みへ再結合する(Equations 6–8)。
  • Light vs Advanced pipelines: バックワードパスなしの軽量パイプラインと、AdaQuant、IP、BN 調整、バイアス調整を追加した高度なパイプライン(Table 1)。
  • 視覚領域(ResNet 系、MobileNet-V2)と言語領域(SQuAD 上の BERT)での AdaQuant の優越性を、特に小さなキャリブレーションデータセットで、QAT-KLD や AdaRound を上回ることを示す。

実験結果

リサーチクエスチョン

  • RQ1サブ 8-bit 精度を達成するために、広範な再学習や大規模なキャリブレーションデータセットを必要とせずに PTQ を実現できるか。
  • RQ2層ごとの最適化(AdaQuant)により、層間での重みと量子化パラメータを共同調整することで量子化精度を改善できるか。
  • RQ3精度/スループット制約の下で各層のビット幅を最適に割り当てるために整数計画法をどのように用いることができるか。
  • RQ4量子化が生じさせる mean/variance のシフトに対する BN 調整の影響はどうか、BN 統計量を再推定して精度を回復できるか。
  • RQ5提案された AdaQuant および IP ベースの手法は、実用的なキャリブレーション制約下で視覚・テキストモデルの最先端結果をもたらすか。

主な発見

  • AdaQuant は、視覚領域の ResNet、MobileNet-V2、言語領域の BERT など、小規模なキャリブレーションセットでもポストトレーニング量子化の最先端を達成している。
  • AdaQuant は、重み・量子化パラメータ・バイアスを共同最適化することで量子化誤差を低減し、AdaRound や QAT ベースのベースラインよりも特に非常に低いキャリブレーションデータで優れた性能を示す。
  • 層ごとの IP ビット割り当ては、総合的な性能を向上させるために混成ビット構成(例: 4-bit vs 8-bit など)を選択し、総劣化制約の下で 2-bit 層を有効にすることさえ可能で、圧縮を促進する。
  • Batch-Norm Tuning (BNT) は、量子化による mean/variance の移動を効果的に緩和し、キャリブレーションデータを用いて数回のフォワードパスのみで有意な精度向上をもたらす。
  • 2 つのデプロイメントパイプラインを提案する: 軽量パイプライン(バックワードパスなし)と高度なパイプライン(AdaQuant + IP + BN 調整 + バイアス調整)、いずれも再学習なしで高い性能を実現する。

より良い研究を、今すぐ始めましょう

論文設計から論文執筆まで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。