paper-with-me

홈 › Papers

RepQ-ViT: Scale Reparameterization for Post-Training Quantization of Vision Transformers

2022-12-16 · ICCV 2023 1 · Zhikai Li, Junrui Xiao, Lianwei Yang, Qingyi Gu

Post-training quantization (PTQ), which only requires a tiny dataset for calibration without end-to-end retraining, is a light and practical model compression technique. Recently, several PTQ schemes for vision transformers (ViTs) have been presented; unfortunately, they typically suffer from non-trivial accuracy degradation, especially in low-bit cases. In this paper, we propose RepQ-ViT, a novel PTQ framework for ViTs based on quantization scale reparameterization, to address the above issues. RepQ-ViT decouples the quantization and inference processes, where the former employs complex quantizers and the latter employs scale-reparameterized simplified quantizers. This ensures both accurate quantization and efficient inference, which distinguishes it from existing approaches that sacrifice quantization performance to meet the target hardware. More specifically, we focus on two components with extreme distributions: post-LayerNorm activations with severe inter-channel variation and post-Softmax activations with power-law features, and initially apply channel-wise quantization and log$\sqrt{2}$ quantization, respectively. Then, we reparameterize the scales to hardware-friendly layer-wise quantization and log2 quantization for inference, with only slight accuracy or computational costs. Extensive experiments are conducted on multiple vision tasks with different model variants, proving that RepQ-ViT, without hyperparameters and expensive reconstruction procedures, can outperform existing strong baselines and encouragingly improve the accuracy of 4-bit PTQ of ViTs to a usable level. Code is available at https://github.com/zkkli/RepQ-ViT.

📄 PDF Abstract BibTeX arXiv:2212.08254

Code (1)

zkkli/repq-vit 공식 구현 pytorch

Tasks

Model CompressionQuantization

Similar Papers 제목 키워드 기반

RepQuant: Towards Accurate Post-Training Quantization of Large Transformer Models via Scale Reparameterization

2024-02-08 · Zhikai Li, Xuewen Liu, Jing Zhang, Qingyi Gu

Large transformer models have demonstrated remarkable success. Post-training quantization (PTQ), which requires only a small dataset for calibration and avoids end-to-end retraining, is a promising solution for compressi…

Quantization

RepQ: Generalizing Quantization-Aware Training for Re-Parametrized Architectures

2023-11-09 · Anastasiia Prutianova, Alexey Zaytsev, Chung-Kuei Lee, Fengyu Sun 외

Existing neural networks are memory-consuming and computationally intensive, making deploying them challenging in resource-constrained environments. However, there are various methods to improve their efficiency. Two suc…

Quantization

Post-Training Quantization for Vision Mamba with k-Scaled Quantization and Reparameterization

2025-01-28 · Bo-Yun Shi, Yi-Cheng Lo, An-Yeu, Wu 외

The Mamba model, utilizing a structured state-space model (SSM), offers linear time complexity and demonstrates significant potential. Vision Mamba (ViM) extends this framework to vision tasks by incorporating a bidirect…

MambaQuantization

Q-HyViT: Post-Training Quantization of Hybrid Vision Transformers with Bridge Block Reconstruction for IoT Systems

2023-03-22 · Jemin Lee, Yongin Kwon, Sihyeong Park, Misun Yu 외

Recently, vision transformers (ViTs) have superseded convolutional neural networks in numerous applications, including classification, detection, and segmentation. However, the high computational requirements of ViTs hin…

Quantization

Towards Accurate Post-training Quantization for Reparameterized Models

2024-02-25 · Luoming Zhang, Yefei He, Wen Fei, Zhenyu Lou 외

Model reparameterization is a widely accepted technique for improving inference speed without compromising performance. However, current Post-training Quantization (PTQ) methods often lead to significant accuracy degrada…

Quantization