Network quantization significantly reduces model inference complexity and has been widely used in real-world deployments. However, most existing quantization methods have been developed mainly on Convolutional Neural Networks (CNN), and suffer severe degradation when applied to fully quantized vision transformers. In this work, we demonstrate that many of these difficulties arise because of serious inter-channel variation in LayerNorm inputs, and present, Power-of-Two Factor (PTF), a systematic method to reduce the performance degradation and inference complexity of fully quantized vision transformers. In addition, observing an extreme non-uniform distribution in attention maps, we propose Log-Int-Softmax (LIS) to sustain that and simplify inference by using 4-bit quantization and the BitShift operator. Comprehensive experiments on various transformer-based architectures and benchmarks show that our Fully Quantized Vision Transformer (FQ-ViT) outperforms previous works while even using lower bit-width on attention maps. For instance, we reach 84.89% top-1 accuracy with ViT-L on ImageNet and 50.8 mAP with Cascade Mask R-CNN (Swin-S) on COCO. To our knowledge, we are the first to achieve lossless accuracy degradation (~1%) on fully quantized vision transformers. Code is available at https://github.com/linyang-zhh/FQ-ViT.


翻译:网络定量化极大地降低了模型的推断复杂性,并被广泛用于现实世界的部署。然而,大多数现有量化方法主要是在进化神经网络(CNN)上开发的,在对全面量化的视觉变压器应用时会发生严重退化。在这项工作中,我们证明,许多这些困难是由于以下因素造成的:层内输入和目前的二元动力变压器(PTF)中出现严重的气道间变异,这是降低性能退化和充分量化的视觉变压器复杂性的系统方法。此外,在关注地图中看到极端的非统一分布,我们建议Log-Int-Softmax(LIS)使用四位四位四位四位四位四分化和BitShift操作器,以简化推断。关于各种基于变压器的架构和基准的全面实验表明,我们完全量化的视野变压器(FQ-VT)比以往的工程要快得多,而在关注地图上甚至使用较低的位维维维维度图。例如,我们达到了84.89%的顶级-一级-一级变压系统SAS-L在图像S-MAS-S-L QAR-de-deal-de-del-de-de-deal-deal-I-deal-S-S-deal-dexxx

0
下载
关闭预览

相关内容

专知会员服务
31+阅读 · 2021年6月12日
最新《Transformers模型》教程,64页ppt
专知会员服务
298+阅读 · 2020年11月26日
专知会员服务
60+阅读 · 2020年3月19日
抢鲜看!13篇CVPR2020论文链接/开源代码/解读
专知会员服务
49+阅读 · 2020年2月26日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
57+阅读 · 2019年10月17日
ExBert — 可视化分析Transformer学到的表示
专知会员服务
31+阅读 · 2019年10月16日
[综述]深度学习下的场景文本检测与识别
专知会员服务
77+阅读 · 2019年10月10日
IEEE ICKG 2022: Call for Papers
机器学习与推荐算法
3+阅读 · 2022年3月30日
ACM MM 2022 Call for Papers
CCF多媒体专委会
5+阅读 · 2022年3月29日
IEEE TII Call For Papers
CCF多媒体专委会
3+阅读 · 2022年3月24日
AIART 2022 Call for Papers
CCF多媒体专委会
1+阅读 · 2022年2月13日
Multi-Task Learning的几篇综述文章
深度学习自然语言处理
15+阅读 · 2020年6月15日
BERT/Transformer/迁移学习NLP资源大列表
专知
19+阅读 · 2019年6月9日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
【论文】变分推断(Variational inference)的总结
机器学习研究会
39+阅读 · 2017年11月16日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
2+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2010年12月31日
Arxiv
0+阅读 · 2022年6月8日
Arxiv
27+阅读 · 2021年11月11日
VIP会员
相关VIP内容
专知会员服务
31+阅读 · 2021年6月12日
最新《Transformers模型》教程,64页ppt
专知会员服务
298+阅读 · 2020年11月26日
专知会员服务
60+阅读 · 2020年3月19日
抢鲜看!13篇CVPR2020论文链接/开源代码/解读
专知会员服务
49+阅读 · 2020年2月26日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
57+阅读 · 2019年10月17日
ExBert — 可视化分析Transformer学到的表示
专知会员服务
31+阅读 · 2019年10月16日
[综述]深度学习下的场景文本检测与识别
专知会员服务
77+阅读 · 2019年10月10日
相关资讯
IEEE ICKG 2022: Call for Papers
机器学习与推荐算法
3+阅读 · 2022年3月30日
ACM MM 2022 Call for Papers
CCF多媒体专委会
5+阅读 · 2022年3月29日
IEEE TII Call For Papers
CCF多媒体专委会
3+阅读 · 2022年3月24日
AIART 2022 Call for Papers
CCF多媒体专委会
1+阅读 · 2022年2月13日
Multi-Task Learning的几篇综述文章
深度学习自然语言处理
15+阅读 · 2020年6月15日
BERT/Transformer/迁移学习NLP资源大列表
专知
19+阅读 · 2019年6月9日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
【论文】变分推断(Variational inference)的总结
机器学习研究会
39+阅读 · 2017年11月16日
相关基金
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
2+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2010年12月31日
Top
微信扫码咨询专知VIP会员