arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2203.08368cs.LGcs.CV
收藏

基于学习分层重要性的混合精度神经网络Quantization

Mixed-Precision Neural Network Quantization via Learned Layer-wise Importance

Tsinghua University(清华大学);Peng Cheng Laboratory(鹏城实验室);Shanghai Jiao Tong University(上海交通大学);Institute of Computing Technology, Chinese Academy of Sciences(中国科学院计算技术研究所)

Chen Tang, Kai Ouyang, Zhi Wang, Yifei Zhu, Yaowei Wang, Wen Ji, Wenwu Zhu

摘要:

混合精度量化(MPQ)中离散搜索空间呈指数级增大,使得每层的最优位宽难以确定。以前的工作通常在训练集上采用迭代搜索方法,这会消耗数百甚至数千个GPU小时。在这项研究中,我们揭示了一些独特的学习量化参数,即量化器中的比例因子,可以作为一个层的重要性指标,反映了该层的贡献,在某些位宽的最终精度。这些重要性指标在量化感知训练期间自然感知数值变换,其可以精确地提供层的量化敏感性度量。然而,深度网络总是包含数百个这样的指标,逐个训练它们会导致过多的时间成本。为了克服这个问题,我们提出了一个联合训练计划,可以一次获得所有指标。它通过并行化原始的顺序训练过程,大大加快了指标训练过程。有了这些学习的重要性指标,我们制定的MPQ搜索问题作为一个一次性的整数线性规划(ILP)问题。这避免了迭代搜索并且显著地减少了搜索时间而不限制位宽搜索空间。例如,使用我们的指标在ResNet18上进行MPQ搜索仅需0.06 s,与迭代搜索方法相比,这将成倍提高时间效率。此外,大量的实验表明,我们的方法可以在ImageNet上实现SOTA精度,用于具有各种约束的大范围模型(例如,BitOps,压缩率)。代码可在https://github.com/1hunters/LIMPQ上获得。

英文摘要:

The exponentially large discrete search space in mixed-precision quantization (MPQ) makes it hard to determine the optimal bit-width for each layer. Previous works usually resort to iterative search methods on the training set, which consume hundreds or even thousands of GPU-hours. In this study, we reveal that some unique learnable parameters in quantization, namely the scale factors in the quantizer, can serve as importance indicators of a layer, reflecting the contribution of that layer to the final accuracy at certain bit-widths. These importance indicators naturally perceive the numerical transformation during quantization-aware training, which can precisely provide quantization sensitivity metrics of layers. However, a deep network always contains hundreds of such indicators, and training them one by one would lead to an excessive time cost. To overcome this issue, we propose a joint training scheme that can obtain all indicators at once. It considerably speeds up the indicators training process by parallelizing the original sequential training processes. With these learned importance indicators, we formulate the MPQ search problem as a one-time integer linear programming (ILP) problem. That avoids the iterative search and significantly reduces search time without limiting the bit-width search space. For example, MPQ search on ResNet18 with our indicators takes only 0.06 s, which improves time efficiency exponentially compared to iterative search methods. Also, extensive experiments show our approach can achieve SOTA accuracy on ImageNet for far-ranging models with various constraints (e.g., BitOps, compress rate). Code is available on https://github.com/1hunters/LIMPQ.

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

↑