arXiv:2507.19131cs.CV2025-07ICCV被引 4

通过混合精度量化利用激活稀疏性,提升视觉Transformer推理效率。

MixA-Q: Revisiting Activation Sparsity for Vision Transformers from a Mixed-Precision Quantization Perspective

  • 按窗口重要性分配不同精度,动态优化量化位宽。
  • 无训练下实现1.35倍加速,4比特模型性能提升0.7%。
  • 适用于主流量化训练与后训练方法,适合部署优化场景。

本文提出MixA-Q,一种基于混合精度激活量化的框架,利用层内激活稀疏性(广泛应用于激活剪枝方法)来高效推理量化的基于窗口的视觉Transformer。在给定统一比特配置下,MixA-Q将Swin块内的批量窗口计算分离,并为重要性较低的窗口分配更低的比特宽度,从而改善模型性能与效率之间的权衡。我们引入双分支Swin块,在高/低比特精度下分别处理激活,可无缝集成至多数量化感知训练(QAT)和后训练量化(PTQ)方法,或仅需简单修改。在COCO数据集上的实验表明,采用PTQ配置时,MixA-Q实现无训练1.35倍计算加速且准确率无损失;使用QAT时,实现无损1.25倍加速,结合激活剪枝后达1.53倍加速,仅损失1% mAP。值得注意的是,通过降低重要区域的量化误差,我们的稀疏感知量化适配使量化后的W4A4模型(权重与激活均为4比特)mAP提升0.7%,量化退化减少24%。

原文摘要 · Abstract (English)

In this paper, we propose MixA-Q, a mixed-precision activation quantization framework that leverages intra-layer activation sparsity (a concept widely explored in activation pruning methods) for efficient inference of quantized window-based vision transformers. For a given uniform-bit quantization configuration, MixA-Q separates the batched window computations within Swin blocks and assigns a lower bit width to the activations of less important windows, improving the trade-off between model performance and efficiency. We introduce a Two-Branch Swin Block that processes activations separately in high- and low-bit precision, enabling seamless integration of our method with most quantization-aware training (QAT) and post-training quantization (PTQ) methods, or with simple modifications. Our experimental evaluations over the COCO dataset demonstrate that MixA-Q achieves a training-free 1.35x computational speedup without accuracy loss in PTQ configuration. With QAT, MixA-Q achieves a lossless 1.25x speedup and a 1.53x speedup with only a 1% mAP drop by incorporating activation pruning. Notably, by reducing the quantization error in important regions, our sparsity-aware quantization adaptation improves the mAP of the quantized W4A4 model (with both weights and activations in 4-bit precision) by 0.7%, reducing quantization degradation by 24%.

视觉Transformer量化稀疏性加速

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。