arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2507.03522cs.ARcs.LG
收藏

一种用于高效 GEMM 的灵活指令集架构

A Flexible Instruction Set Architecture for Efficient GEMMs

Barcelona Supercomputing Center(巴塞罗那超级计算中心);Universitat Politècnica de Catalunya(加泰罗尼亚理工大学)

Alexandre de Limas Santana, Adrià Armejach, Francesc Martinez, Erich Focht, Marc Casas

AI总结:

本文提出 Matrix Tile Extension(MTE),一种将指令集架构与微架构完全解耦的灵活矩阵 ISA,通过利用现有向量寄存器文件并在 M、N、K 三个维度向量化 GEMM,以极小实现开销实现比最先进矩阵 ISA 快 1.35 倍的性能。

摘要:

通用矩阵乘法(GEMM)在高性能计算和深度学习工作负载中反复出现。通常,高端 CPU 使用单指令多数据(SIMD)或向量指令集架构(ISA)来加速 GEMM 工作负载。由于这些 ISA 在运行 GEMM 工作负载时面临显著问题,尤其是在处理小型、高瘦型或窄瘦型矩阵时,过去几年主要硬件厂商已提出并实现了矩阵 ISA。尽管这些矩阵 ISA 在运行 GEMM 时比其 SIMD/向量对应方案提供更高的吞吐量,但它们是僵化的解决方案,无法根据应用特定方面(如数据格式)动态调整自身。本文证明了最先进的矩阵 ISA 在运行最常用的卷积和 Transformer 模型时性能欠佳。本文提出 Matrix Tile Extension(MTE),这是第一个将指令集架构与微架构完全解耦并无缝与现有向量 ISA 交互的矩阵 ISA。MTE 的实现开销极小,因为它只需要少量额外指令和一个 64 位控制状态寄存器(CSR)来保持其状态。具体而言,MTE 能够 i) 在 M、N 和 K 三个维度上对 GEMM 进行向量化;ii) 利用现有向量寄存器文件的容量;iii) 将 tile 形状与底层微架构解耦。MTE 相较于最佳的最先进矩阵 ISA 实现了 1.35 倍的加速。

英文摘要:

GEneral Matrix Multiplications (GEMMs) are recurrent in high-performance computing and deep learning workloads. Typically, high-end CPUs accelerate GEMM workloads with Single-Instruction Multiple Data (SIMD) or vector Instruction Set Architectures (ISAs). Since these ISAs face significant issues when running GEMM workloads, particularly when dealing with small, tall, or skinny matrices, matrix ISAs have been proposed and implemented by major hardware vendors in the last years. Although these matrix ISAs deliver larger throughput when running GEMMs than their SIMD/vector counterparts, they are rigid solutions unable to dynamically adapt themselves to application-specific aspects like the data format. This paper demonstrates that the state-of-the-art matrix ISAs deliver suboptimal performance when running the most commonly used convolution and transformer models. This paper proposes the Matrix Tile Extension (MTE), the first matrix ISA that completely decouples the instruction set architecture from the microarchitecture and seamlessly interacts with existing vector ISAs. MTE incurs minimal implementation overhead since it only requires a few additional instructions and a 64-bit Control Status Register (CSR) to keep its state. Specifically, MTE can i) vectorize GEMMs across the three dimensions M, N, and K; ii) leverage the capacity of the existing vector register file; and iii) decouple the tile shape from the underlying microarchitecture. MTE achieves speed-ups of 1.35x over the best state-of-the-art matrix ISA.

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

↑