I-ViT: Integer-only Quantization for Efficient Vision Transformer Inference
摘要
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. Code of both Pytorch and TVM is released at https://github.com/zkkli/I-ViT.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 25 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- ViViT: A Video Vision Transformer 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- ViViT: A Video Vision Transformer 引用了 Training data-efficient image transformers & distillation through attention
- Outlier-aware Slicing for Post-Training Quantization in Vision Transformer 引用了 BiViT: Extremely Compressed Binary Vision Transformers
- Outlier-aware Slicing for Post-Training Quantization in Vision Transformer 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Outlier-aware Slicing for Post-Training Quantization in Vision Transformer 引用了 Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
- Outlier-aware Slicing for Post-Training Quantization in Vision Transformer 引用了 RepQ-ViT: Scale Reparameterization for Post-Training Quantization of Vision Transformers
- Outlier-aware Slicing for Post-Training Quantization in Vision Transformer 引用了 Training data-efficient image transformers & distillation through attention
- Outlier-aware Slicing for Post-Training Quantization in Vision Transformer 引用了 Jumping through Local Minima: Quantization in the Loss Landscape of Vision Transformers
- BiViT: Extremely Compressed Binary Vision Transformers 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- BiViT: Extremely Compressed Binary Vision Transformers 引用了 Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
- BiViT: Extremely Compressed Binary Vision Transformers 引用了 Training data-efficient image transformers & distillation through attention
- Oscillation-free Quantization for Low-bit Vision Transformers 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Oscillation-free Quantization for Low-bit Vision Transformers 引用了 Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
- Oscillation-free Quantization for Low-bit Vision Transformers 引用了 Training data-efficient image transformers & distillation through attention
- Swin Transformer: Hierarchical Vision Transformer using Shifted Windows 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Swin Transformer: Hierarchical Vision Transformer using Shifted Windows 引用了 Training data-efficient image transformers & distillation through attention
- Swin Transformer: Hierarchical Vision Transformer using Shifted Windows 引用了 Deformable DETR: Deformable Transformers for End-to-End Object Detection
- RepQ-ViT: Scale Reparameterization for Post-Training Quantization of Vision Transformers 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- RepQ-ViT: Scale Reparameterization for Post-Training Quantization of Vision Transformers 引用了 Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
- RepQ-ViT: Scale Reparameterization for Post-Training Quantization of Vision Transformers 引用了 Training data-efficient image transformers & distillation through attention
- RepQ-ViT: Scale Reparameterization for Post-Training Quantization of Vision Transformers 引用了 Deformable DETR: Deformable Transformers for End-to-End Object Detection
- Training data-efficient image transformers & distillation through attention 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Jumping through Local Minima: Quantization in the Loss Landscape of Vision Transformers 引用了 Oscillation-free Quantization for Low-bit Vision Transformers
- Jumping through Local Minima: Quantization in the Loss Landscape of Vision Transformers 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Jumping through Local Minima: Quantization in the Loss Landscape of Vision Transformers 引用了 Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
引用它的顶会 Paper25
- RepQ-ViT: Scale Reparameterization for Post-Training Quantization of Vision TransformersZhikai Li, Junrui Xiao, Lianwei Yang, Qingyi GuICCV 2023 · 172 次引用
- Oscillation-free Quantization for Low-bit Vision TransformersShih-Yang Liu, Zechun Liu, Kwang-Ting ChengICML 2023 · 63 次引用
- BiViT: Extremely Compressed Binary Vision TransformersYefei He, Zhenyu Lou, Luoming Zhang, Jing Liu 等ICCV 2023 · 44 次引用
- Jumping through Local Minima: Quantization in the Loss Landscape of Vision TransformersNatalia Frumkin, Dibakar Gope, Diana MarculescuICCV 2023 · 23 次引用
- Outlier-aware Slicing for Post-Training Quantization in Vision TransformerYuexiao Ma, Huixia Li, Xiawu Zheng, Feng Ling 等ICML 2024 · 17 次引用
它引用的 Paper19
- Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu 等ICCV 2021 · 31,683 次引用
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn 等ICLR 2021 · 21,477 次引用
- Training data-efficient image transformers & distillation through attentionHugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa 等ICML 2021 · 8,974 次引用
- Deformable DETR: Deformable Transformers for End-to-End Object DetectionXizhou Zhu, Weijie Su, Lewei Lu, Bin Li 等ICLR 2021 · 7,353 次引用
- ViViT: A Video Vision TransformerAnurag Arnab, Mostafa Dehghani, Georg Heigold, Chen Sun 等ICCV 2021 · 2,947 次引用
相关 Paper
- I-BERT: Integer-only BERT QuantizationSehoon Kim, Amir Gholami, Zhewei Yao, Michael W. Mahoney 等ICML 2021 · 439 次引用
- UQ-ViT: Harmonizing Extreme Activations with Hardware-Friendly Uniform Quantization in Vision TransformersTao Jiang, Yucheng Jiang, Xiwen Yao, Gong Cheng 等AAAI 2026
- PackQViT: Faster Sub-8-bit Vision Transformers via Full and Packed Quantization on the MobilePeiyan Dong, Lei Lu, Chao Wu, Cheng Lyu 等NeurIPS 2023 · 44 次引用
- ShiftAddViT: Mixture of Multiplication Primitives Towards Efficient Vision TransformerHaoran You, Huihong Shi, Yipin Guo, Yingyan LinNeurIPS 2023 · 27 次引用
- GradQ-ViT: Robust and Efficient Gradient Quantization for Vision TransformersDahun Choi, Hyun KimAAAI 2025 · 11 次引用
