arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2302.05397cs.LG
收藏

后训练Quantization的一种实用混合精度算法

A Practical Mixed Precision Algorithm for Post-Training Quantization

Qualcomm AI Research(高通人工智能研究院)

Nilesh Prasad Pandey, Markus Nagel, Mart van Baalen, Yin Huang, Chirag Patel, Tijmen Blankevoort

摘要:

神经网络量化经常用于优化神经网络的设备上部署的模型大小、延迟和功耗。在许多情况下,目标位宽是为整个网络设置的,这意味着每一层都被量化为相同的比特数。然而,对于许多网络来说,某些层对量化噪声的鲁棒性要比其他层强得多,这使得一个重要的改进轴没有得到利用。由于许多硬件解决方案提供多个不同的位宽设置,因此混合精度量化已经成为一种有前途的解决方案,以找到比均匀量化更好的性能-效率权衡。然而,大多数现有的混合精度算法对于从业者来说是相当困难的,因为它们需要访问训练数据,具有许多超参数来调整,甚至依赖于整个模型的端到端再训练。在这项工作中,我们提出了一个简单的后训练混合精度算法,只需要一个小的未标记的校准数据集自动选择合适的位宽为每一层所需的设备上的性能。我们的算法不需要超参数调整,对数据变化具有鲁棒性,并考虑到实际的硬件部署限制,使其成为实际使用的一个很好的候选人。我们在几个计算机视觉任务,自然语言处理任务和许多不同的网络实验验证了我们提出的方法,并表明,我们可以找到混合精度网络,提供更好的平衡精度和效率比均匀的位宽等价物。

英文摘要:

Neural network quantization is frequently used to optimize model size, latency and power consumption for on-device deployment of neural networks. In many cases, a target bit-width is set for an entire network, meaning every layer get quantized to the same number of bits. However, for many networks some layers are significantly more robust to quantization noise than others, leaving an important axis of improvement unused. As many hardware solutions provide multiple different bit-width settings, mixed-precision quantization has emerged as a promising solution to find a better performance-efficiency trade-off than homogeneous quantization. However, most existing mixed precision algorithms are rather difficult to use for practitioners as they require access to the training data, have many hyper-parameters to tune or even depend on end-to-end retraining of the entire model. In this work, we present a simple post-training mixed precision algorithm that only requires a small unlabeled calibration dataset to automatically select suitable bit-widths for each layer for desirable on-device performance. Our algorithm requires no hyper-parameter tuning, is robust to data variation and takes into account practical hardware deployment constraints making it a great candidate for practical use. We experimentally validate our proposed method on several computer vision tasks, natural language processing tasks and many different networks, and show that we can find mixed precision networks that provide a better trade-off between accuracy and efficiency than their homogeneous bit-width equivalents.

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

↑