arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2105.03536cs.LGcs.CV
收藏

Pareto最优量化ResNet主要为4-bit

Pareto-Optimal Quantized ResNet Is Mostly 4-bit

University of California Riverside(加州大学河滨分校);Google Research(谷歌研究院)

AmirAli Abdolrashidi, Lisa Wang, Shivani Agrawal, Jonathan Malmaud, Oleg Rybakov, Chas Leichner, Lukasz Lew

AI总结:

本文以ResNet为案例研究量化对推理计算成本与质量权衡的影响,发现4-bit量化模型能产生最佳Pareto曲线,并在ImageNet上通过量化感知训练达到77.09%的top-1准确率,同时开源了JAX量化库。

摘要:

量化已成为压缩神经网络并降低计算成本的流行技术,但先前的大多数工作集中在研究不改变网络规模的量化。神经网络的许多实际应用具有计算成本和内存预算,可以通过改变参数数量来与模型质量进行权衡。在本工作中,我们以ResNet为案例研究,系统地调查量化对推理计算成本-质量权衡曲线的影响。我们的结果表明,对于每个bfloat16 ResNet模型,都存在成本更低且准确率更高的量化模型;换句话说,bfloat16的计算成本-质量权衡曲线被4-bit和8-bit曲线Pareto占优,其中主要量化为4-bit的模型产生了最佳的Pareto曲线。此外,我们通过量化感知训练在4-bit ResNet-50的ImageNet上取得了最先进的结果,获得了77.09%的top-1评估准确率。我们通过测量泛化差距来证明量化的正则化效应。我们使用的量化方法针对实用性进行了优化:它几乎不需要调优,并在设计时考虑了硬件能力。我们的工作推动了对量化最优数值格式的进一步研究,以及支持这些格式的机器学习加速器的开发。作为这项工作的一部分,我们贡献了一个用JAX编写的量化库,已在https://github.com/google-research/google-research/tree/master/aqt开源。

英文摘要:

Quantization has become a popular technique to compress neural networks and reduce compute cost, but most prior work focuses on studying quantization without changing the network size. Many real-world applications of neural networks have compute cost and memory budgets, which can be traded off with model quality by changing the number of parameters. In this work, we use ResNet as a case study to systematically investigate the effects of quantization on inference compute cost-quality tradeoff curves. Our results suggest that for each bfloat16 ResNet model, there are quantized models with lower cost and higher accuracy; in other words, the bfloat16 compute cost-quality tradeoff curve is Pareto-dominated by the 4-bit and 8-bit curves, with models primarily quantized to 4-bit yielding the best Pareto curve. Furthermore, we achieve state-of-the-art results on ImageNet for 4-bit ResNet-50 with quantization-aware training, obtaining a top-1 eval accuracy of 77.09%. We demonstrate the regularizing effect of quantization by measuring the generalization gap. The quantization method we used is optimized for practicality: It requires little tuning and is designed with hardware capabilities in mind. Our work motivates further research into optimal numeric formats for quantization, as well as the development of machine learning accelerators supporting these formats. As part of this work, we contribute a quantization library written in JAX, which is open-sourced at https://github.com/google-research/google-research/tree/master/aqt.

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

↑