arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2205.01252cs.AR
收藏

SIMD $^2$:一种超越GEMM加速张量计算的广义矩阵指令集

SIMD$^2$: A Generalized Matrix Instruction Set for Accelerating Tensor Computation beyond GEMM

Yunan Zhang, Po-An Tsai, Hung-Wei Tseng

摘要:

矩阵乘法单元(MXU)现在在每个计算平台中都很流行。使MXU如此成功的关键属性是半环结构,它允许并行和数据重用的平铺。尽管如此,矩阵乘法并不是唯一具有这种属性的算法。我们发现,许多算法共享相同的结构,不同的只是核心操作;例如,使用加最小而不是乘加。因此,具有半环结构的算法有可能被一个通用的矩阵运算架构加速,而不是常见的MXU。在本文中,我们提出了SIMD $^2$,一个新的编程范式,以支持广义矩阵运算的半环结构。SIMD $^2$指令除了加速矩阵乘法之外,还加速了另外八种类型的矩阵运算。由于SIMD $^2$指令类似于矩阵乘法指令,因此我们能够以最小的修改在任何MXU架构之上构建SIMD $^2$架构。我们开发了一个框架,使用带Tensor核心的NVIDIA GPU来仿真和验证SIMD $^2$。在8种应用中,SIMD 2提供了高达38.59 $\times$的加速比,平均超过10.63 $\times$,而全芯片面积开销仅为5%。

英文摘要:

Matrix-multiplication units (MXUs) are now prevalent in every computing platform. The key attribute that makes MXUs so successful is the semiring structure, which allows tiling for both parallelism and data reuse. Nonetheless, matrix-multiplication is not the only algorithm with such attributes. We find that many algorithms share the same structure and differ in only the core operation; for example, using add-minimum instead of multiply-add. Algorithms with a semiring-like structure therefore have potential to be accelerated by a general-purpose matrix operation architecture, instead of common MXUs. In this paper, we propose SIMD$^2$, a new programming paradigm to support generalized matrix operations with a semiring-like structure. SIMD$^2$ instructions accelerate eight more types of matrix operations, in addition to matrix multiplications. Since SIMD$^2$ instructions resemble a matrix-multiplication instruction, we are able to build SIMD$^2$ architecture on top of any MXU architecture with minimal modifications. We developed a framework that emulates and validates SIMD$^2$ using NVIDIA GPUs with Tensor Cores. Across 8 applications, SIMD2 provides up to 38.59$\times$ speedup and more than 10.63$\times$ on average over optimized CUDA programs, with only 5% of full-chip area overhead.

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

↑