arXiv reaDer
I-ViT:効率的なVisionTransformer推論のための整数のみの量子化
I-ViT: Integer-only Quantization for Efficient Vision Transformer Inference
ビジョントランスフォーマー(ViT)は、さまざまなコンピュータービジョンアプリケーションで最先端のパフォーマンスを実現しています。ただし、これらのモデルにはかなりのストレージと計算のオーバーヘッドがあり、エッジデバイスでの展開と効率的な推論が困難になります。量子化は、モデルの複雑さを軽減するための有望なアプローチです。残念ながら、ViTを量子化するための既存の取り組みは、シミュレートされた量子化(別名、偽の量子化)です。これは、推論中に浮動小数点演算のままであるため、モデルの高速化にはほとんど寄与しません。この論文では、ViTが整数演算とビットシフトを使用し、浮動小数点演算を使用せずに推論の計算グラフ全体を実行できるようにする、ViTの整数のみの量子化スキームであるI-ViTを提案します。 I-ViTでは、線形演算(MatMulやDenseなど)は2項演算を使用した整数のみのパイプラインに従い、非線形演算(Softmax、GELU、LayerNormなど)は提案された軽量の整数のみで近似されます。算術法。特に、I-ViTは、提案されたShiftmaxおよびShiftGELUを適用します。これらは、整数ビットシフトを使用して、対応する浮動小数点演算を近似するように設計されています。さまざまなベンチマークモデルでI-ViTを評価し、その結果は、整数のみのINT8量子化が、全精度(FP)ベースラインと同等(またはそれ以上)の精度を達成することを示しています。さらに、GPUの整数演算装置での実用的なハードウェア展開にTVMを利用し、FPモデルと比較して3.72〜4.11倍の推論速度を実現しています。
Vision Transformers (ViTs) have achieved state-of-the-art performance on various computer vision applications. These models, however, have considerable storage and computational overheads, making their deployment and efficient inference on edge devices challenging. Quantization is a promising approach to reducing model complexity; unfortunately, existing efforts to quantize ViTs are simulated quantization (aka fake quantization), which remains floating-point arithmetic during inference and thus contributes little to model acceleration. In this paper, we propose I-ViT, an integer-only quantization scheme for ViTs, to enable ViTs to perform the entire computational graph of inference with integer operations and bit-shifting and no floating-point operations. In I-ViT, linear operations (e.g., MatMul and Dense) follow the integer-only pipeline with dyadic arithmetic, and non-linear operations (e.g., Softmax, GELU, and LayerNorm) are approximated by the proposed light-weight integer-only arithmetic methods. In particular, I-ViT applies the proposed Shiftmax and ShiftGELU, which are designed to use integer bit-shifting to approximate the corresponding floating-point operations. We evaluate I-ViT on various benchmark models and the results show that integer-only INT8 quantization achieves comparable (or even higher) accuracy to the full-precision (FP) baseline. Furthermore, we utilize TVM for practical hardware deployment on the GPU's integer arithmetic units, achieving 3.72~4.11× inference speedup compared to the FP model.
updated: Mon Jul 04 2022 13:37:38 GMT+0000 (UTC)
published: Mon Jul 04 2022 13:37:38 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アソシエイト