arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2111.14826cs.CVcs.AIcs.LG
收藏

Nonuniform-to-Uniform Quantization:通过广义直通估计实现精确的Quantization

Nonuniform-to-Uniform Quantization: Towards Accurate Quantization via Generalized Straight-Through Estimation

Hong Kong University of Science and Technology(香港科技大学);Carnegie Mellon University(卡内基梅隆大学);Reality Labs, Meta Inc.(Meta公司现实实验室);Mohamed bin Zayed University of Artificial Intelligence(穆罕默德·本·扎耶德人工智能大学)

Zechun Liu, Kwang-Ting Cheng, Dong Huang, Eric Xing, Zhiqiang Shen

摘要:

用于压缩神经网络的非均匀量化策略通常实现比其对应物更好的性能,即,统一的战略,由于其优越的代表性能力。然而,许多非均匀量化方法在实现非均匀量化的权重/激活时忽略了复杂的投影过程,这在硬件部署中引起不可忽略的时间和空间开销。在这项研究中,我们提出了非均匀到均匀量化(N2 UQ),一种方法,可以保持非均匀方法的强大表示能力,同时是硬件友好和高效的模型推理的均匀量化。我们通过学习灵活的不等距输入阈值来更好地拟合底层分布,同时将这些实值输入量化为等距输出水平来实现这一目标。为了训练具有可学习输入阈值的量化网络,我们引入了一种广义直通估计器(G-STE),用于难以处理的向后导数计算w.r.t.阈值参数此外,我们考虑熵保持正则化,以进一步减少权重量化中的信息损失。即使在施加均匀量化权重和激活的不利约束下,我们的N2 UQ在ImageNet上的性能也比最先进的非均匀量化方法高出0.5~1.7,证明了N2 UQ设计的贡献。代码和模型可在https://github.com/liuzechun/Nonuniform-to-Uniform-Quantization上获得。

英文摘要:

The nonuniform quantization strategy for compressing neural networks usually achieves better performance than its counterpart, i.e., uniform strategy, due to its superior representational capacity. However, many nonuniform quantization methods overlook the complicated projection process in implementing the nonuniformly quantized weights/activations, which incurs non-negligible time and space overhead in hardware deployment. In this study, we propose Nonuniform-to-Uniform Quantization (N2UQ), a method that can maintain the strong representation ability of nonuniform methods while being hardware-friendly and efficient as the uniform quantization for model inference. We achieve this through learning the flexible in-equidistant input thresholds to better fit the underlying distribution while quantizing these real-valued inputs into equidistant output levels. To train the quantized network with learnable input thresholds, we introduce a generalized straight-through estimator (G-STE) for intractable backward derivative calculation w.r.t. threshold parameters. Additionally, we consider entropy preserving regularization to further reduce information loss in weight quantization. Even under this adverse constraint of imposing uniformly quantized weights and activations, our N2UQ outperforms state-of-the-art nonuniform quantization methods by 0.5~1.7 on ImageNet, demonstrating the contribution of N2UQ design. Code and models are available at: https://github.com/liuzechun/Nonuniform-to-Uniform-Quantization.

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

↑