MixFrag用KL散度定位模型里对量化最敏感的部分,再把位宽分配变成背包问题。在COCO上比之前最好的混合精度PTQ方法涨了9.6 AP,跑ViT的可以看看。
MixFrag提出一种面向视觉Transformer的脆弱性引导混合精度训练后量化框架。它通过计算全精度与量化输出分布的KL散度来估计各组件量化脆弱性,并将位宽分配建模为多选择背包问题。在ImageNet-1K上,MixFrag在多种ViT架构下取得有竞争力的分类精度。在COCO目标检测与实例分割任务中,MixFrag在MP3/MP3设置下比此前最优方法提升高达9.6 AP。
MixFrag: Fragility-Guided Mixed-Precision Post-Training Quantization for Vision Transformers
Post-training quantization (PTQ) has emerged as an effective solution for deploying Vision Transformers (ViTs) on resource-constrained devices. However, existing PTQ methods typically employ uniform bit-widths across transformer components, overlooking their heterogeneous sensitivity to quantization and leading to inefficient precision allocation. In this paper, we propose {MixFrag, a fragility-guided mixed-precision PTQ framework for Vision Transformers. MixFrag first estimates component-level quantization fragility by measuring the Kullback--Leibler (KL) divergence between full-precision and isolated quantized output distributions using a small calibration set. It then formulates bit allocation as a Multiple-Choice Knapsack Problem (MCKP), enabling adaptive layer-wise precision assignment under a target bit budget. Extensive experiments on ImageNet-1K across multiple Vision Transformer architectures demonstrate that MixFrag achieves competitive classification performance under practical mixed-precision settings. Furthermore, evaluations on COCO object detection and instance segmentation show that MixFrag achieves state-of-the-art performance among existing mixed-precision PTQ methods, improving the previous best method by up to 9.6 AP under the challenging MP3/MP3 setting. Additional analyses validate the proposed fragility metric and demonstrate its strong correlation with the learned bit allocation. These results establish MixFrag as an effective framework for mixed-precision post-training quantization of Vision Transformers.