arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2506.11277math.NAcs.MScs.NA
收藏

浮点矩阵乘法通过整数运算进行分析

Analysis of Floating-Point Matrix Multiplication Computed via Integer Arithmetic

Innovative Computing Laboratory, University of Tennessee, Knoxville(田纳西大学诺克斯维尔分校创新计算实验室);Department of Mathematics, University of Manchester(曼彻斯特大学数学系);School of Computer Science, University of Leeds(利兹大学计算机科学学院)

Ahmad Abdelfattah, Jack Dongarra, Massimiliano Fasi, Mantas Mikaitis, Françoise Tisseur

AI总结:

本文提出了一种通过整数运算计算浮点矩阵乘法的策略,通过整数切片精确计算并累加以近似浮点结果,分析了精度与性能的权衡,并通过实验验证了算法的准确性与效率。

摘要:

Ootomo, Ozaki, and Yokota [Int. J. High Perform. Comput. Appl., 38 (2024), p. 297-313] 提出了一种将浮点矩阵乘法转换为整数矩阵乘法的策略。将矩阵A和B分割为整数切片,计算这些切片的精确乘积,并通过浮点运算累加这些整数乘积以近似AB。该技术特别适用于具有整数支持的混合精度矩阵乘法单元,如NVIDIA张量核心或AMD矩阵核心。切片数量允许在性能和精度之间进行权衡:更多切片会提高精度但需要更多乘法运算,从而降低性能。我们提出了一种低成本的方法来估算达到指定精度所需的最小乘法次数。我们的误差分析表明,如果A的行或B的列被不良缩放,则算法可能会不准确(或低效)。我们进行了大量的数值实验,包括模拟和最新的NVIDIA GPU,以验证分析并说明该算法的优势和劣势。

英文摘要:

Ootomo, Ozaki, and Yokota [Int. J. High Perform. Comput. Appl., 38 (2024), p. 297-313] have proposed a strategy to recast a floating-point matrix multiplication in terms of integer matrix products. The factors A and B are split into integer slices, the product of these slices is computed exactly, and AB is approximated by accumulating these integer products in floating-point arithmetic. This technique is particularly well suited to mixed-precision matrix multiply-accumulate units with integer support, such as the NVIDIA tensor cores or the AMD matrix cores. The number of slices allows for performance-accuracy tradeoffs: more slices yield better accuracy but require more multiplications, which in turn reduce performance. We propose an inexpensive way to estimate the minimum number of multiplications needed to achieve a prescribed level of accuracy. Our error analysis shows that the algorithm may become inaccurate (or inefficient) if rows of A or columns of B are badly scaled. We perform a range of numerical experiments, both in simulation and on the latest NVIDIA GPUs, that confirm the analysis and illustrate strengths and weaknesses of the algorithm.

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

↑