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.
翻译:Ootomo、Ozaki 和 Yokota [Int. J. High Perform. Comput. Appl., 38 (2024), p. 297-313] 提出了一种将浮点矩阵乘法转化为整数矩阵乘积的策略。因子 A 和 B 被拆分为整数切片,这些切片的乘积被精确计算,而 AB 则通过在浮点运算中累加这些整数乘积来近似。该技术特别适用于支持整数的混合精度矩阵乘累加单元,例如 NVIDIA tensor cores 或 AMD matrix cores。切片数量允许在性能与精度之间进行权衡:更多切片能带来更好的精度,但需要更多乘法运算,从而降低性能。我们提出了一种低成本方法,用于估计达到指定精度所需的最小乘法次数。我们的误差分析表明,如果 A 的行或 B 的列缩放不良,该算法可能会变得不准确(或低效)。我们进行了一系列数值实验,包括模拟实验和在最新 NVIDIA GPU 上的实验,这些实验证实了分析结果,并展示了该算法的优缺点。