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

FP8量化:指数的力量

FP8 Quantization: The Power of the Exponent

Qualcomm AI Research(高通人工智能研究中心);Qualcomm Technologies, Inc.(高通技术公司)

Andrey Kuzmin, Mart Van Baalen, Yuwei Ren, Markus Nagel, Jorn Peters, Tijmen Blankevoort

AI总结:

本文系统研究了FP8浮点量化在神经网络推理中的优势,分析了尾数与指数比特数选择的影响,提出可学习尺度参数和指数比特数的新算法,并证明训练后量化中FP8在精度上优于INT8。

摘要:

在对神经网络进行量化以实现高效推理时,低位整数通常是追求效率的首选格式。然而,低位浮点数具有额外的自由度,可以将部分比特用于指数尺度上的表示。本文深入研究了浮点格式在神经网络推理中的这一优势。我们详细说明了FP8格式可以做出的各种选择,包括尾数和指数比特数这一重要选择,并通过分析展示了在哪些情况下这些选择能带来更好的性能。随后,我们展示了这些发现如何转化到真实网络中,提供了FP8模拟的高效实现,并提出了一种新算法,该算法能够同时学习FP8格式中的尺度参数和指数比特数。我们的主要结论是,在对各种网络进行训练后量化时,FP8格式在精度方面优于INT8,而指数比特数的选择取决于网络中离群值的严重程度。我们还进行了量化感知训练实验,结果表明,当网络经过训练以减少离群值的影响时,不同格式之间的差异会消失。

英文摘要:

When quantizing neural networks for efficient inference, low-bit integers are the go-to format for efficiency. However, low-bit floating point numbers have an extra degree of freedom, assigning some bits to work on an exponential scale instead. This paper in-depth investigates this benefit of the floating point format for neural network inference. We detail the choices that can be made for the FP8 format, including the important choice of the number of bits for the mantissa and exponent, and show analytically in which settings these choices give better performance. Then we show how these findings translate to real networks, provide an efficient implementation for FP8 simulation, and a new algorithm that enables the learning of both the scale parameters and the number of exponent bits in the FP8 format. Our chief conclusion is that when doing post-training quantization for a wide range of networks, the FP8 format is better than INT8 in terms of accuracy, and the choice of the number of exponent bits is driven by the severity of outliers in the network. We also conduct experiments with quantization-aware training where the difference in formats disappears as the network is trained to reduce the effect of outliers.

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

↑