MPTQ-ViT:Mixed-PrecisionPost-TrainingQuantizationforVisionTransformer

要約

ビジョン トランスフォーマー (ViT) はコンピューター ビジョン タスクにおいて大きな可能性を示していますが、その高度な計算とメモリ要件により、実際のアプリケーションには課題が生じています。
既存のトレーニング後の量子化手法は、値の再配分または特殊な量子化器を活用して、ViT の非正規分布に対処します。
ただし、これらの方法では、アクティベーションの非対称性を考慮せず、手作りの設定に依存すると、低ビット量子化下でパフォーマンスを維持するのに苦労することがよくあります。
これらの課題を克服するために、バイアス項 (SQ-b) を備えた SmoothQuant を導入して、非対称の問題を緩和し、クランプ損失を低減します。
また、データ依存メカニズムによって量子化パラメータを自動的に決定する最適スケーリングファクタ比検索 (OPT-m) も導入します。
圧縮率をさらに高めるために、前述の手法を組み込み、ビジョン トランスフォーマー用の混合精度ポストトレーニング量子化フレームワーク (MPTQ-ViT) を提案します。
モデルのパフォーマンスと圧縮率の両方を考慮してレイヤーごとのビット幅を割り当てるための貪欲混合精度量子化 (Greedy MP) を開発します。
ViT、DeiT、Swin での実験では、ImageNet データセットでの SOTA と比較して精度が大幅に向上していることが実証されました。
具体的には、私たちが提案する方法は、単精度の 4 ビット ViT で 0.90% ~ 23.35%、混合精度の 5 ビット完全量子化 ViT で 3.82% ~ 78.14% の範囲の精度向上を達成します。

要約(オリジナル)

While vision transformers (ViTs) have shown great potential in computer vision tasks, their intense computation and memory requirements pose challenges for practical applications. Existing post-training quantization methods leverage value redistribution or specialized quantizers to address the non-normal distribution in ViTs. However, without considering the asymmetry in activations and relying on hand-crafted settings, these methods often struggle to maintain performance under low-bit quantization. To overcome these challenges, we introduce SmoothQuant with bias term (SQ-b) to alleviate the asymmetry issue and reduce the clamping loss. We also introduce optimal scaling factor ratio search (OPT-m) to determine quantization parameters by a data-dependent mechanism automatically. To further enhance the compressibility, we incorporate the above-mentioned techniques and propose a mixed-precision post-training quantization framework for vision transformers (MPTQ-ViT). We develop greedy mixed-precision quantization (Greedy MP) to allocate layer-wise bit-width considering both model performance and compressibility. Our experiments on ViT, DeiT, and Swin demonstrate significant accuracy improvements compared with SOTA on the ImageNet dataset. Specifically, our proposed methods achieve accuracy improvements ranging from 0.90% to 23.35% on 4-bit ViTs with single-precision and from 3.82% to 78.14% on 5-bit fully quantized ViTs with mixed-precision.

arxiv情報

著者 Yu-Shan Tai,An-Yeu,Wu
発行日 2024-01-26 14:25:15+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.CV パーマリンク