QuantuneV2:面向实际嵌入式AI应用的基于编译器的局部度量驱动混合精度量化方法
QuantuneV2: Compiler-Based Local Metric-Driven Mixed Precision Quantization for Practical Embedded AI Applications
AI总结:
针对现有混合精度量化需重训练、未考虑编译期开销的问题,本文提出基于编译器的QuantuneV2方法,通过局部度量、最优IR选择与算子融合,在5个模型上实现精度与速度的同步提升,适配嵌入式AI部署。
摘要:
现有混合精度量化方法旨在减小模型规模的同时尽量降低精度损失,但这些方法需要重新训练,且未考虑编译过程中产生的计算开销与中间表示(IR),限制了其在编译器层面的应用。此处的计算开销指推理过程中频繁的量化与反量化操作带来的运行时延迟,若在单个算子层面执行这类操作会造成显著的运行时延。为解决上述问题,本文提出QuantuneV2——一种面向实际嵌入式AI应用、基于编译器的混合精度量化方法。QuantuneV2仅需执行两次推理(量化前一次、量化后一次),计算复杂度为O(n),随模型参数量线性增长。研究还通过权重、激活值、量化信噪比(Signal to Quantization Noise Ratio)、均方误差(Mean Squared Error)等局部度量提升了敏感性分析的稳定性,同时通过选择最优IR并采用算子融合降低了计算开销。实验结果显示,在ResNet18v1、ResNet50v1、SqueezeNetv1、VGGNet、MobileNetv2共5个模型上,QuantuneV2相比现有方法精度最高提升10.28%,速度最高提升12.52%。这表明QuantuneV2在保障计算效率的同时提升了模型性能,适用于嵌入式AI环境的部署。
英文摘要:
Mixed-precision quantization methods have been proposed to reduce model size while minimizing accuracy degradation. However, existing studies require retraining and do not consider the computational overhead and intermediate representations (IR) generated during the compilation process, limiting their application at the compiler level. This computational overhead refers to the runtime latency caused by frequent quantization and dequantization operations during inference. Performing these operations at the individual operator level causes significant runtime delays. To address these issues, we propose QuantuneV2, a compiler-based mixed-precision quantization method designed for practical embedded AI applications. QuantuneV2 performs inference only twice, once before quantization and once after quantization, and operates with a computational complexity of O(n) that increases linearly with the number of model parameters. We also made the sensitivity analysis more stable by using local metrics like weights, activation values, the Signal to Quantization Noise Ratio, and the Mean Squared Error. We also cut down on computational overhead by choosing the best IR and using operator fusion. Experimental results show that QuantuneV2 achieved up to a 10.28 percent improvement in accuracy and a 12.52 percent increase in speed compared to existing methods across five models: ResNet18v1, ResNet50v1, SqueezeNetv1, VGGNet, and MobileNetv2. This demonstrates that QuantuneV2 enhances model performance while maintaining computational efficiency, making it suitable for deployment in embedded AI environments.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。