arXiv reaDer
I-ViT: 効率的なビジョン トランスフォーマー推論のための整数のみの量子化
I-ViT: Integer-only Quantization for Efficient Vision Transformer Inference
ビジョン トランスフォーマー (ViT) は、さまざまなコンピューター ビジョン アプリケーションで最先端のパフォーマンスを実現しています。ただし、これらのモデルにはかなりのストレージと計算のオーバーヘッドがあり、エッジ デバイスでの展開と効率的な推論が困難になります。量子化は、モデルの複雑さを軽減するための有望なアプローチであり、二項演算パイプラインにより、量子化されたモデルが効率的な整数のみの推論を実行できるようになります。残念ながら、二項演算は、畳み込みニューラル ネットワークの均一性条件に基づいており、ViT の非線形コンポーネントには適用できないため、ViT の整数のみの推論は未解決の問題となっています。このホワイト ペーパーでは、ViT の整数のみの量子化スキームである I-ViT を提案し、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. However, these models 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, and the dyadic arithmetic pipeline can allow the quantized models to perform efficient integer-only inference. Unfortunately, dyadic arithmetic is based on the homogeneity condition in convolutional neural networks, which is not applicable to the non-linear components in ViTs, making integer-only inference of ViTs an open issue. 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 arithmetic and bit-shifting, and without any floating-point arithmetic. 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. More specifically, 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 slightly 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 Feb 27 2023 02:19:04 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アソシエイト