论文标题

嘈杂:视觉变压器的嘈杂偏置训练后训练激活量化

NoisyQuant: Noisy Bias-Enhanced Post-Training Activation Quantization for Vision Transformers

论文作者

Liu, Yijiang, Yang, Huanrui, Dong, Zhen, Keutzer, Kurt, Du, Li, Zhang, Shanghang

论文摘要

视力变压器的复杂建筑和高训练成本促使训练后训练量化。但是,即使使用先进的量化器设计,视觉变压器激活的重尾分布也阻碍了先前的训练后量化方法的有效性。本文提出了噪音,而不是对量化量化的复杂激活分布,而不是更好地拟合复杂的激活分布,这是一种量化量化量的增强,用于训练后训练激活量化视觉变压器的性能。我们做出了一个令人惊讶的理论发现,对于给定的量化器,将固定均匀的噪声偏差添加到被量化的值中可以大大减少在可证明条件下的量化误差。在理论上的洞察力的基础上,噪声取得了首要的成功,即积极改变重尾激活分布,并具有添加噪声偏见以适合给定的量化器。广泛的实验表明,噪声很大程度上可以通过最小的计算开销来改善视觉变压器的训练后量化性能。例如,在线性均匀的6位激活量化上,噪声将ImageNet上的SOTA TOP-1精度提高了1.7%,1.1%和0.5%的VIT,DEIT和SWIN变压器,从而比以前的非线性非线性,混合精确定量实现了ON-PAR甚至更高的性能。

The complicated architecture and high training cost of vision transformers urge the exploration of post-training quantization. However, the heavy-tailed distribution of vision transformer activations hinders the effectiveness of previous post-training quantization methods, even with advanced quantizer designs. Instead of tuning the quantizer to better fit the complicated activation distribution, this paper proposes NoisyQuant, a quantizer-agnostic enhancement for the post-training activation quantization performance of vision transformers. We make a surprising theoretical discovery that for a given quantizer, adding a fixed Uniform noisy bias to the values being quantized can significantly reduce the quantization error under provable conditions. Building on the theoretical insight, NoisyQuant achieves the first success on actively altering the heavy-tailed activation distribution with additive noisy bias to fit a given quantizer. Extensive experiments show NoisyQuant largely improves the post-training quantization performance of vision transformer with minimal computation overhead. For instance, on linear uniform 6-bit activation quantization, NoisyQuant improves SOTA top-1 accuracy on ImageNet by up to 1.7%, 1.1% and 0.5% for ViT, DeiT, and Swin Transformer respectively, achieving on-par or even higher performance than previous nonlinear, mixed-precision quantization.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源