arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2303.12557cs.CVcs.AI
收藏

Q-HyViT:面向物联网系统的带桥接块重构的混合视觉Transformer训练后量化

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

KAIST(韩国科学技术院)

Jemin Lee, Yongin Kwon, Sihyeong Park, Misun Yu, Jeman Park, Hwanjun Song

AI总结:

针对现有ViT训练后量化方法应用于高效混合Transformer时精度骤降的问题,提出带桥接块重构的Q-HyViT量化方法,首次实现多类高效混合ViT的量化,8位和6位量化精度较现有方法平均提升17.73%和29.75%,适用于物联网系统。

摘要:

近年来,视觉Transformer(ViT)在分类、检测和分割等众多应用中已超越卷积神经网络。然而,ViT的高计算需求阻碍了其广泛部署。为解决这一问题,研究人员提出了高效混合Transformer架构,将卷积层与Transformer层相结合,并采用线性复杂度的优化注意力计算。此外,训练后量化也被提出作为降低计算需求的一种手段。对于移动设备而言,要实现ViT的最优加速,需要将量化技术与高效混合Transformer结构进行策略性结合。但此前尚无研究将量化应用于高效混合Transformer。本文发现,将现有的ViT训练后量化(PTQ)方法应用于高效混合Transformer会导致精度大幅下降,这归因于以下四个挑战:(i)动态范围极高,(ii)零点溢出,(iii)归一化方式多样,以及(iv)模型参数有限(<5M)。为克服这些挑战,我们提出了一种新的训练后量化方法,这是首个对高效混合ViT(MobileViTv1、MobileViTv2、Mobile-Former、EfficientFormerV1、EfficientFormerV2)进行量化的方法。与现有PTQ方法(EasyQuant、FQ-ViT、PTQ4ViT和RepQ-ViT)相比,我们的方法在8位和6位量化下分别实现了平均17.73%和29.75%的显著精度提升。我们计划在https://gitlab.com/ones-ai/q-hyvit 发布代码。

英文摘要:

Recently, vision transformers (ViTs) have superseded convolutional neural networks in numerous applications, including classification, detection, and segmentation. However, the high computational requirements of ViTs hinder their widespread implementation. To address this issue, researchers have proposed efficient hybrid transformer architectures that combine convolutional and transformer layers with optimized attention computation of linear complexity. Additionally, post-training quantization has been proposed as a means of mitigating computational demands. For mobile devices, achieving optimal acceleration for ViTs necessitates the strategic integration of quantization techniques and efficient hybrid transformer structures. However, no prior investigation has applied quantization to efficient hybrid transformers. In this paper, we discover that applying existing post-training quantization (PTQ) methods for ViTs to efficient hybrid transformers leads to a drastic accuracy drop, attributed to the four following challenges: (i) highly dynamic ranges, (ii) zero-point overflow, (iii) diverse normalization, and (iv) limited model parameters ($<$5M). To overcome these challenges, we propose a new post-training quantization method, which is the first to quantize efficient hybrid ViTs (MobileViTv1, MobileViTv2, Mobile-Former, EfficientFormerV1, EfficientFormerV2). We achieve a significant improvement of 17.73% for 8-bit and 29.75% for 6-bit on average, respectively, compared with existing PTQ methods (EasyQuant, FQ-ViT, PTQ4ViT, and RepQ-ViT)}. We plan to release our code at https://gitlab.com/ones-ai/q-hyvit.

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

↑