Skip to main content
QUICK REVIEW

[論文レビュー] HAWQ: Hessian AWare Quantization of Neural Networks with Mixed-Precision

Zhen Dong, Zhewei Yao|arXiv (Cornell University)|Apr 29, 2019
Advanced Neural Network Applications参考文献 41被引用数 36
ひとこと要約

HAWQ は Hessian-based second-order information を用いて自動的に層ごとに混合精度を割り当て、決定論的なファインチューニング順序を提供し、CIFAR-10 と ImageNet のモデルで、精度と比較可能かそれ以上を維持しつつ、より高い圧縮を実現します。

ABSTRACT

Model size and inference speed/power have become a major challenge in the deployment of Neural Networks for many applications. A promising approach to address these problems is quantization. However, uniformly quantizing a model to ultra low precision leads to significant accuracy degradation. A novel solution for this is to use mixed-precision quantization, as some parts of the network may allow lower precision as compared to other layers. However, there is no systematic way to determine the precision of different layers. A brute force approach is not feasible for deep networks, as the search space for mixed-precision is exponential in the number of layers. Another challenge is a similar factorial complexity for determining block-wise fine-tuning order when quantizing the model to a target precision. Here, we introduce Hessian AWare Quantization (HAWQ), a novel second-order quantization method to address these problems. HAWQ allows for the automatic selection of the relative quantization precision of each layer, based on the layer's Hessian spectrum. Moreover, HAWQ provides a deterministic fine-tuning order for quantizing layers, based on second-order information. We show the results of our method on Cifar-10 using ResNet20, and on ImageNet using Inception-V3, ResNet50 and SqueezeNext models. Comparing HAWQ with state-of-the-art shows that we can achieve similar/better accuracy with $8 imes$ activation compression ratio on ResNet20, as compared to DNAS~\cite{wu2018mixed}, and up to $1\%$ higher accuracy with up to $14\%$ smaller models on ResNet50 and Inception-V3, compared to recently proposed methods of RVQuant~\cite{park2018value} and HAQ~\cite{wang2018haq}. Furthermore, we show that we can quantize SqueezeNext to just 1MB model size while achieving above $68\%$ top1 accuracy on ImageNet.

研究の動機と目的

  • 層ごとに一様な精度を用いず、量子化を通じてモデルサイズと推論エネルギーを削減する動機付け。
  • 各層ごとの量子化精度を自動的に決定するための Hessian ベースの手法を提案。
  • 量子化されたモデルのための決定論的で2次情報に基づくファインチューニング順序を提供。
  • CIFAR-10およびImageNetで高圧縮時の最先端または競争力のある精度を実証。

提案手法

  • ネットワークをブロックに分割し、各ブロックのヘシアン固有値をマトリックスフリーのパワーイテレーション(ヘシアン matvec)で計算。
  • 各ブロックの感度指標 S_i = lambda_i / n_i を定義して精度選択のランキングを行う(lambda_i は上位ヘシアン固有値、n_i はブロックサイズ)。
  • 降順の S_i に基づいてブロックの相対ビット精度順を割り当て、混合精度量子化を誘導。
  • 高曲率と大きな摂動を持つブロックを優先するように Omega_i = lambda_i * ||Q(W_i) - W_i||^2 でファインチューニング順序を定義。
  • 複雑さを抑えるため、ヘシアンを上位固有値でスケーリングされたブロック対角行列として近似。
  • 導出された順序に従って、ブロックごとにヘシアン情報を用いた量子化とその後のブロックごとのファインチューニングを実行。
  • 順序付けとヘシアン指向の影響が性能に及ぼす効果を示すアブレーション研究を提供。

実験結果

リサーチクエスチョン

  • RQ1ヘシアンスペクトラム情報は混合精度量子化における層ごとの相対的な量子化精度の選択を導くか。
  • RQ2ヘシアンに基づくブロック単位の量子化の順序付けとその後のファインチューニングが、最先端手法と同等の精度でより高い圧縮を達成できるか。
  • RQ3大規模ビジョンモデルに対するヘシアンベースの順序付けが収束速度と最終精度に与える影響は何か。
  • RQ4CIFAR-10のResNet20とImageNetのInception-V3、ResNet-50、SqueezeNextにおいて、既存の量子化手法と比較してHAWQはどのように機能するか。

主な発見

量子化wビットaビット精度W圧縮A圧縮
ベースライン323292.371.00×1.00×
Dorefa [43]2288.2016.00×16.00×
Dorefa [43]3389.9010.67×10.67×
PACT [2]2289.7016.00×16.00×
PACT [2]3391.1010.67×10.67×
LQ-Nets [40]2290.2016.00×16.00×
LQ-Nets [40]3391.6010.67×10.67×
LQ-Nets [40]23291.8016.00×1.00×
LQ-Nets [40]33292.0010.67×1.00×
DNAS [36]1 MP3292.0016.60×1.00×
DNAS [36]1 MP3292.7211.60×1.00×
Direct2 MP490.3416.00×8.00×
HAWQ2 MP492.2213.11×8.00×
  • HAWQ は CIFAR-10 ResNet20 で活性化の圧縮を最大8xまで達成するなど、精度を似るかそれ以上に保ちつつ、はるかに高い圧縮を達成。
  • ImageNet では Inception-V3 で重み+活性化の圧縮を最大12.04x、Top-1 約75.52%(Direct 比)を達成し、精度とモデルサイズの両方でいくつかの他手法を上回る。
  • ImageNet の ResNet-50 では Top-1 75.48%、モデルサイズ 7.96 MB を達成、精度とサイズの両方で HAQ を上回る。
  • ImageNet の SqueezeNext で 1 MB に圧縮、Top-1 精度 68.02%、直接量子化を大きく上回り超小型デプロイを実現。
  • アブレーションは、ヘシアン指向の順序付け(量子化とファインチューニングの両方)が、反転順序のベースラインと比較して収束速度と最終精度を実質的に改善することを示す。
  • このアプローチは、2次情報が多様なアーキテクチャにわたる混合精度量子化を体系的かつスケーラブルに実行する方法を提供することを示している。

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

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

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

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