arXiv reaDer
Vision Transformer の正確なトレーニング後の量子化に向けて
Towards Accurate Post-Training Quantization for Vision Transformer
ビジョン トランスフォーマーは、ビジョン タスクの潜在的なアーキテクチャとして浮上しています。ただし、激しい計算と無視できない遅延により、現実世界での適用が妨げられます。広く普及しているモデル圧縮手法として、既存のトレーニング後の量子化手法は依然としてパフォーマンスの大幅な低下を引き起こします。主な理由は、(1) 非常に低いビット表現の量子化の影響を測定する際に既存のキャリブレーション メトリックが不正確であること、および (2) 既存の量子化パラダイムが Softmax のべき乗分布に適していないことにあることがわかります。これらの観察に基づいて、ビジョン トランスフォーマーの新しい正確なトレーニング後の量子化フレームワーク、つまり APQ-ViT を提案します。最初に、統一されたボトムエリミネーション ブロックワイズ キャリブレーション スキームを提示して、キャリブレーション メトリックを最適化して、全体的な量子化外乱をブロックごとに認識し、最終出力により大きな影響を与える重要な量子化エラーに優先順位を付けます。次に、Softmax のマシュー効果保存量子化を設計して、べき法則の性質を維持し、注意メカニズムの機能を維持します。大規模な分類および検出データセットに関する包括的な実験では、APQ-ViT が既存のトレーニング後の量子化方法よりも優れていることが実証されており、特に低いビット幅設定で (たとえば、平均して分類で最大 5.17% 改善、 W4A4 での検出)。また、APQ-ViT は汎用性が高く、さまざまな変圧器のバリエーションでうまく機能することも強調しています。
Vision transformer emerges as a potential architecture for vision tasks. However, the intense computation and non-negligible delay hinder its application in the real world. As a widespread model compression technique, existing post-training quantization methods still cause severe performance drops. We find the main reasons lie in (1) the existing calibration metric is inaccurate in measuring the quantization influence for extremely low-bit representation, and (2) the existing quantization paradigm is unfriendly to the power-law distribution of Softmax. Based on these observations, we propose a novel Accurate Post-training Quantization framework for Vision Transformer, namely APQ-ViT. We first present a unified Bottom-elimination Blockwise Calibration scheme to optimize the calibration metric to perceive the overall quantization disturbance in a blockwise manner and prioritize the crucial quantization errors that influence more on the final output. Then, we design a Matthew-effect Preserving Quantization for Softmax to maintain the power-law character and keep the function of the attention mechanism. Comprehensive experiments on large-scale classification and detection datasets demonstrate that our APQ-ViT surpasses the existing post-training quantization methods by convincing margins, especially in lower bit-width settings (e.g., averagely up to 5.17% improvement for classification and 24.43% for detection on W4A4). We also highlight that APQ-ViT enjoys versatility and works well on diverse transformer variants.
updated: Sat Mar 25 2023 03:05:26 GMT+0000 (UTC)
published: Sat Mar 25 2023 03:05:26 GMT+0000 (UTC)
参考文献 (このサイトで利用可能なもの) / References (only if available on this site)
被参照文献 (このサイトで利用可能なものを新しい順に) / Citations (only if available on this site, in order of most recent)
Amazon.co.jpアソシエイト