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

改进Quantization感知训练的最优裁剪和幅度感知微分

Optimal Clipping and Magnitude-aware Differentiation for Improved Quantization-aware Training

NVIDIA Corporation(英伟达公司)

Charbel Sakr, Steve Dai, Rangharajan Venkatesan, Brian Zimmer, William J. Dally, Brucek Khailany

摘要:

数据裁剪对于减少量化操作中的噪声和提高量化感知训练(QAT)的可实现精度至关重要。目前的实践依赖于算法来设置裁剪阈值标量,并且不能被证明是最佳的。我们提出了最优裁剪张量和矢量(OCTAV),一个递归算法来确定MSE最优裁剪标量。OCTAV源自快速Newton-Raphson方法,在QAT例程的每次迭代中为每个张量动态地找到最佳裁剪标量。因此,QAT算法在每一步都用可证明的最小量化噪声来制定。此外,我们揭示了QAT中常见的梯度估计技术的局限性,并提出了幅度感知微分作为进一步提高准确性的补救措施。在实验中,支持OCTAV的QAT在多个任务上实现了最先进的精度。这些包括从头开始训练和重新训练ImageNet上的ResNets和MobileNets,以及使用BERT模型的Squad微调,其中支持OCTAV的QAT在低精度(4到6位)下始终保持准确性。我们的结果不需要修改基线训练配方,除了在适当的地方插入量化操作。

英文摘要:

Data clipping is crucial in reducing noise in quantization operations and improving the achievable accuracy of quantization-aware training (QAT). Current practices rely on heuristics to set clipping threshold scalars and cannot be shown to be optimal. We propose Optimally Clipped Tensors And Vectors (OCTAV), a recursive algorithm to determine MSE-optimal clipping scalars. Derived from the fast Newton-Raphson method, OCTAV finds optimal clipping scalars on the fly, for every tensor, at every iteration of the QAT routine. Thus, the QAT algorithm is formulated with provably minimum quantization noise at each step. In addition, we reveal limitations in common gradient estimation techniques in QAT and propose magnitude-aware differentiation as a remedy to further improve accuracy. Experimentally, OCTAV-enabled QAT achieves state-of-the-art accuracy on multiple tasks. These include training-from-scratch and retraining ResNets and MobileNets on ImageNet, and Squad fine-tuning using BERT models, where OCTAV-enabled QAT consistently preserves accuracy at low precision (4-to-6-bits). Our results require no modifications to the baseline training recipe, except for the insertion of quantization operations where appropriate.

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

↑