Ozaki 方案 II:使用整数模技术的面向 GEMM 的浮点矩阵乘法仿真
Ozaki Scheme II: A GEMM-oriented emulation of floating-point matrix multiplication using an integer modular technique
AI总结:
本文提出一种基于中国剩余定理的 GEMM 仿真方法,利用整数模技术分解矩阵,控制乘法次数以提升精度,在 GPU 和 CPU 上显著超越原生 FP64 性能,并较传统 Ozaki 方案实现最高 2.3 倍加速。
摘要:
本文研究矩阵乘法的仿真算法。通用矩阵乘法(GEMM)是基本线性代数子程序(BLAS)中的基础操作,通常针对特定硬件架构进行优化。Ozaki 方案是一种成熟的基于 GEMM 的矩阵乘法仿真方法,其中输入矩阵被分解为多个低精度分量,以确保通过数值运算精确计算所得的矩阵乘积。本研究提出了一种新颖的基于 GEMM 的矩阵乘法仿真方法,该方法利用中国剩余定理。所提出的方法继承了高度优化的 GEMM 例程的计算效率,并进一步能够控制矩阵乘法的次数,从而可以提高计算精度。我们展示了以 GPU 上的 INT8 Tensor Core 运算和 CPU 上的 FP64 算术作为案例研究的数值实验。结果表明,使用所提出的方法进行的 FP64 仿真在 NVIDIA RTX 4090 上达到了高达 7.4 至 9.8 TFLOPS 的性能水平,在 NVIDIA GH200 上达到了 56.6 至 80.2 TFLOPS,超过了原生 FP64 算术的实测性能。此外,对于 CPU 上的 FP64 计算,与传统的 Ozaki 方案相比,所提出的方法在仿真四倍精度算术时实现了高达 2.3 倍的加速。
英文摘要:
This paper addresses emulation algorithms for matrix multiplication. General Matrix-Matrix Multiplication (GEMM), a fundamental operation in the Basic Linear Algebra Subprograms (BLAS), is typically optimized for specific hardware architectures. The Ozaki scheme is a well-established GEMM-based emulation method for matrix multiplication, wherein input matrices are decomposed into several low-precision components to ensure that the resulting matrix product is computed exactly through numerical operations. This study proposes a novel GEMM-based emulation method for matrix multiplication that leverages the Chinese Remainder Theorem. The proposed method inherits the computational efficiency of highly optimized GEMM routines and further enables control over the number of matrix multiplications, which can enhance computational accuracy. We present numerical experiments featuring INT8 Tensor Core operations on GPUs and FP64 arithmetic on CPUs as case studies. The results demonstrate that FP64 emulation using the proposed method achieves performance levels of up to 7.4 to 9.8 TFLOPS on the NVIDIA RTX 4090 and 56.6 to 80.2 TFLOPS on the NVIDIA GH200, exceeding the measured performance of native FP64 arithmetic. Furthermore, for FP64 computations on CPUs, the proposed method achieved up to a 2.3x speedup in emulating quadruple-precision arithmetic compared to the conventional Ozaki scheme.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。