[论文解读] A Survey of Quantization Methods for Efficient Neural Network Inference
本综述回顾神经网络推理的量化技术,详细介绍均匀与非均匀量化、标定策略、粒度、微调方法以及硬件影响。并强调在不同硬件平台上,准确性、效率和可部署性之间的权衡。
As soon as abstract mathematical computations were adapted to computation on digital computers, the problem of efficient representation, manipulation, and communication of the numerical values in those computations arose. Strongly related to the problem of numerical representation is the problem of quantization: in what manner should a set of continuous real-valued numbers be distributed over a fixed discrete set of numbers to minimize the number of bits required and also to maximize the accuracy of the attendant computations? This perennial problem of quantization is particularly relevant whenever memory and/or computational resources are severely restricted, and it has come to the forefront in recent years due to the remarkable performance of Neural Network models in computer vision, natural language processing, and related areas. Moving from floating-point representations to low-precision fixed integer values represented in four bits or less holds the potential to reduce the memory footprint and latency by a factor of 16x; and, in fact, reductions of 4x to 8x are often realized in practice in these applications. Thus, it is not surprising that quantization has emerged recently as an important and very active sub-area of research in the efficient implementation of computations associated with Neural Networks. In this article, we survey approaches to the problem of quantizing the numerical values in deep Neural Network computations, covering the advantages/disadvantages of current methods. With this survey and its organization, we hope to have presented a useful snapshot of the current research in quantization for Neural Networks and to have given an intelligent organization to ease the evaluation of future research in this area.
研究动机与目标
- 总结应用于神经网络的量化的历史背景与基础概念。
- 界定主要量化方法(均匀 vs 非均匀、对称 vs 非对称)及其权衡。
- 解释激活与权重的标定、粒度,以及动态与静态方法。
- 讨论微调策略(QAT vs PTQ)与量化的梯度处理。
- 突出硬件影响及边缘部署的实际考量。
提出的方法
- 定义量化算子以及从浮点到低精度值的映射(如 Q(r) 及反量化)。
- 区分对称 vs 非对称以及全范围 vs 有约束范围量化,并处理零点。
- 描述激活的静态 vs 动态标定及其对精度和开销的影响。
- 解释粒度选项(逐层、分组、逐通道、逐子通道)及其影响。
- 总结均匀 vs 非均匀量化,包括可学习/不可学习的量化器和基于优化的方法。
- 给出使用直通估计器(STE)的量化感知训练(QAT),以及替代的非 STE 方法,再加上裁剪范围学习(PACT、LSQ、LSQ+)。
实验结果
研究问题
- RQ1神经网络推理的主要量化策略有哪些,以及它们在精度与效率方面的权衡?
- RQ2标定、粒度和量化类型(均匀 vs 非均匀)如何影响真实模型与硬件的性能?
- RQ3有效的微调策略(QAT vs PTQ)以及量化网络的梯度处理方法有哪些?
- RQ4硬件因素如何影响边缘设备的实际量化选择?
主要发现
- 由于简单性和硬件效率,均匀量化已成为事实上的标准,尽管在某些情况下非均匀量化可能带来潜在的准确性提升。
- 逐通道量化可以提高权重的分辨率和准确性;逐层量化可能降低性能。
- 动态激活范围标定能带来更高的准确性,但增加运行时开销;静态标定成本更低但通常准确性较低。
- 使用 STE 的 QAT 是训练带量化的主流方法;替代的非 STE 方法和可学习裁剪范围也显示出潜力。
- 非均匀量化可以更好地捕捉分布,但在通用硬件上部署更困难;本文强调在部署阶段均匀方法的实用性。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。