arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1904.06376cs.MScs.NAmath.NA
收藏

利用bfloat16人工智能数据类型实现更高精度计算

Leveraging the bfloat16 Artificial Intelligence Datatype For Higher-Precision Computations

Intel Corporation(英特尔公司);Intel Labs(英特尔实验室)

Greg Henry, Ping Tak Peter Tang, Alexander Heinecke

AI总结:

本文研究了如何利用bfloat16数据类型中的FMA单元实现更高精度的矩阵运算,通过分解为多个小数据类型来提高计算精度和性能,同时展示了在求解线性方程时的高精度效果。

摘要:

近年来,融合乘加(FMA)单元在低精度乘法和高精度累加方面的应用在机器学习/人工智能应用中证明了其有用性,尤其是在深度神经网络训练中,因其极高的计算强度。与经典的IEEE-754 32位(FP32)和64位(FP64)算术相比,这些低精度算术可以自然地以比例的方式加速。主要硬件供应商的常用策略是进一步增强性能。一种特定的FMA操作,即两个BF16数相乘并以FP32精度累加,在深度学习中已被证明是有用的,其中BF16是具有IEEE FP32数值范围但8位有效数字精度的16位浮点数据类型。在本文中,我们研究了如何利用这种FMA单元实现更高精度的矩阵运算,从潜在的性能增益和对精度的影响方面进行分析。我们展示了如何通过分解为多个较小的数据类型来组装高精度结果,利用FMA单元的高精度累加。我们首先证明了通过将FP32数分解为多个BF16数并进行适当的计算,可以实现向量内积和由此扩展的矩阵-矩阵乘积的计算,能够适应动态范围并比标准FP32计算保持精度,同时达到高达5.2倍的速度提升。此外,我们还研究了以残差形式表征的线性方程的解法,允许迭代细化。我们证明了在各种线性系统条件数范围内,所得到的解与FP64提供的解相当。

英文摘要:

In recent years fused-multiply-add (FMA) units with lower-precision multiplications and higher-precision accumulation have proven useful in machine learning/artificial intelligence applications, most notably in training deep neural networks due to their extreme computational intensity. Compared to classical IEEE-754 32 bit (FP32) and 64 bit (FP64) arithmetic, these reduced precision arithmetic can naturally be sped up disproportional to their shortened width. The common strategy of all major hardware vendors is to aggressively further enhance their performance disproportionately. One particular FMA operation that multiplies two BF16 numbers while accumulating in FP32 has been found useful in deep learning, where BF16 is the 16-bit floating point datatype with IEEE FP32 numerical range but 8 significant bits of precision. In this paper, we examine the use this FMA unit to implement higher-precision matrix routines in terms of potential performance gain and implications on accuracy. We demonstrate how a decomposition into multiple smaller datatypes can be used to assemble a high-precision result, leveraging the higher precision accumulation of the FMA unit. We first demonstrate that computations of vector inner products and by natural extension, matrix-matrix products can be achieved by decomposing FP32 numbers in several BF16 numbers followed by appropriate computations that can accommodate the dynamic range and preserve accuracy compared to standard FP32 computations, while projecting up to 5.2x speed-up. Furthermore, we examine solution of linear equations formulated in the residual form that allows for iterative refinement. We demonstrate that the solution obtained to be comparable to those offered by FP64 under a large range of linear system condition numbers.

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

↑