arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2408.03291cs.CV
收藏

DopQ-ViT:面向视觉Transformer的分布友好型和离群值感知的模型后训练量化

DopQ-ViT: Towards Distribution-Friendly and Outlier-Aware Post-Training Quantization for Vision Transformers

Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所);School of Artificial Intelligence, University of Chinese Academy of Sciences(中国科学院大学人工智能学院);Department of Computer Science, City University of Hong Kong(香港城市大学计算机科学系)

Lianwei Yang, Haisong Gong, Haokun Lin, Yichen Wu, Caifeng Shan, Zhenan Sun, Qingyi Gu

AI总结:

针对视觉Transformer高计算成本及后训练量化性能易降问题,提出DopQ-ViT方法,通过引入Tan量化器保留幂律分布、MAD引导的最优缩放因子选择,在分类和检测任务上优于先前PTQ方法。

摘要:

视觉Transformer(ViT)备受关注,但其高计算成本限制了实际应用。后训练量化(PTQ)虽能减小模型大小并加速推理,但常导致性能下降。本文指出性能下降的两个关键原因:现有量化方法与Softmax后激活的幂律分布不匹配;重新参数化LayerNorm后激活因缩放因子中的离群值影响导致性能下降。为此提出DopQ-ViT方法,引入Tan量化器更好地保留幂律分布,提出MAD引导的最优缩放因子选择方法。实验表明,DopQ-ViT在分类和检测任务上均优于先前的PTQ方法。

英文摘要:

Vision Transformers (ViTs) have gained significant attention, but their high computing cost limits the practical applications. While post-training quantization (PTQ) reduces model size and speeds up inference, it often degrades performance, especially in low-bit settings. We identify two key reasons for the performance degradation: 1) existing quantization methods fail to align with the power-law distribution of post-Softmax activations, and 2) reparameterizing post-LayerNorm activations leads to a performance drop due to the significant influence of outliers in the scaling factors. To address these challenges, we propose DopQ-ViT, a Distribution-friendly and Outlier-aware Post-training Quantization method for ViTs. First, DopQ-ViT introduces the Tan Quantizer (TanQ), which better preserves the power-law distribution of post-Softmax activations by focusing more on values near 1. Second, DopQ-ViT presents the MAD-guided Optimal Scaling Factor (MOSF), which selects the optimal scaling factor without introducing additional calculations. Extensive experiments across various ViT models and quantization settings demonstrate that DopQ-ViT, with the help of TanQ and MOSF, outperforms previous PTQ methods on both classification and detection tasks.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑