arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2309.01945cs.LGcs.AIcs.AR
收藏

片上硬件感知量化用于混合精度神经网络

On-Chip Hardware-Aware Quantization for Mixed Precision Neural Networks

The University of Hong Kong(香港大学);ETH Zürich(苏黎世联邦理工学院);Beihang University(北京航空航天大学)

Wei Huang, Haotong Qin, Yangdong Liu, Jingzhuo Liang, Yulun Zhang, Ying Li, Xianglong Liu

AI总结:

本文提出片上硬件感知量化框架OHQ,在边缘设备上直接进行混合精度量化,通过片上感知流水线和掩码引导估计技术,实现精度与效率的优化,在ResNet-18和MobileNetV3上分别达到70%和73%精度,延迟降低15%-30%。

摘要:

低比特量化成为在边缘设备上部署深度神经网络最有前景的压缩方法之一。混合精度量化利用不同比特宽度的组合,以释放量化模型在精度和效率方面的潜力。然而,现有的混合精度量化方法依赖高性能设备上的模拟,在巨大的搜索空间中实现精度与效率的权衡。这导致估计的效率指标与实际硬件之间存在不可忽视的差距,使得量化模型远离最优精度和效率,同时也导致量化过程依赖额外的高性能设备。在本文中,我们提出了一种片上硬件感知量化(OHQ)框架,在部署的边缘设备上执行硬件感知的混合精度量化,以实现准确且高效的计算。具体而言,对于效率指标,我们构建了片上量化感知流水线,使量化过程能够感知量化操作符的实际硬件效率,避免因不精确模拟导致的优化误差。对于精度指标,我们提出了掩码引导的量化估计技术,以有效估计片上场景中操作符的精度影响,摆脱量化过程对高计算能力的依赖。通过线性优化综合量化模型和硬件的洞察,我们能够获得优化的比特宽度配置,以在精度和效率上实现卓越性能。我们在硬件上评估了不同架构和压缩比下的推理精度和加速效果。OHQ在ResNet-18和MobileNetV3上分别达到70%和73%的精度,并且在实际部署中相比INT8可降低15%至30%的延迟。

英文摘要:

Low-bit quantization emerges as one of the most promising compression approaches for deploying deep neural networks on edge devices. Mixed-precision quantization leverages a mixture of bit-widths to unleash the accuracy and efficiency potential of quantized models. However, existing mixed-precision quantization methods rely on simulations in high-performance devices to achieve accuracy and efficiency trade-offs in immense search spaces. This leads to a non-negligible gap between the estimated efficiency metrics and the actual hardware that makes quantized models far away from the optimal accuracy and efficiency, and also causes the quantization process to rely on additional high-performance devices. In this paper, we propose an On-Chip Hardware-Aware Quantization (OHQ) framework, performing hardware-aware mixed-precision quantization on deployed edge devices to achieve accurate and efficient computing. Specifically, for efficiency metrics, we built an On-Chip Quantization Aware pipeline, which allows the quantization process to perceive the actual hardware efficiency of the quantization operator and avoid optimization errors caused by inaccurate simulation. For accuracy metrics, we propose Mask-Guided Quantization Estimation technology to effectively estimate the accuracy impact of operators in the on-chip scenario, getting rid of the dependence of the quantization process on high computing power. By synthesizing insights from quantized models and hardware through linear optimization, we can obtain optimized bit-width configurations to achieve outstanding performance on accuracy and efficiency. We evaluate inference accuracy and acceleration with quantization for various architectures and compression ratios on hardware. OHQ achieves 70% and 73% accuracy for ResNet-18 and MobileNetV3, respectively, and can reduce latency by 15~30% compared to INT8 on real deployment.

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

↑