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

面向视觉Transformer的实例感知分组量化

Instance-Aware Group Quantization for Vision Transformers

Yonsei University(延世大学);Articron(阿蒂克龙)

Jaehyeon Moon, Dohyung Kim, Junyong Cheon, Bumsub Ham

AI总结:

本文提出IGQ-ViT方法,通过实例感知的动态通道分组量化激活和softmax注意力,并在BOP约束下调整组数,以解决ViTs训练后量化性能下降问题。

摘要:

训练后量化(PTQ)是一种高效的模型压缩技术,它仅使用少量无标签样本的校准集对预训练的全精度模型进行量化,而无需重新训练。针对卷积神经网络(CNN)的PTQ方法能够提供与全精度模型相当的量化结果。然而,直接将这些方法应用于视觉Transformer(ViTs)会导致严重的性能下降,这主要是由于CNN与ViTs在架构上的差异。特别是,每个通道的激活分布会根据输入实例的不同而发生剧烈变化,这使得针对CNN的PTQ方法不适用于ViTs。为了解决这一问题,我们提出了面向ViTs的实例感知分组量化(IGQ-ViT)。为此,我们提出针对每个输入实例动态地将激活图的通道划分为多个组,使得每个组内的激活具有相似的统计特性。我们还将该方案扩展到对跨token的softmax注意力进行量化。此外,在比特运算(BOP)约束下,调整每一层的组数以最小化量化模型与全精度模型预测之间的差异。我们在图像分类、目标检测和实例分割任务上,使用多种Transformer架构进行了大量实验,证明了所提方法的有效性。

英文摘要:

Post-training quantization (PTQ) is an efficient model compression technique that quantizes a pretrained full-precision model using only a small calibration set of unlabeled samples without retraining. PTQ methods for convolutional neural networks (CNNs) provide quantization results comparable to full-precision counterparts. Directly applying them to vision transformers (ViTs), however, incurs severe performance degradation, mainly due to the differences in architectures between CNNs and ViTs. In particular, the distribution of activations for each channel vary drastically according to input instances, making PTQ methods for CNNs inappropriate for ViTs. To address this, we introduce instance-aware group quantization for ViTs (IGQ-ViT). To this end, we propose to split the channels of activation maps into multiple groups dynamically for each input instance, such that activations within each group share similar statistical properties. We also extend our scheme to quantize softmax attentions across tokens. In addition, the number of groups for each layer is adjusted to minimize the discrepancies between predictions from quantized and full-precision models, under a bit-operation (BOP) constraint. We show extensive experimental results on image classification, object detection, and instance segmentation, with various transformer architectures, demonstrating the effectiveness of our approach.

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

↑