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

解析ARM SME以优化通用矩阵乘法

Demystifying ARM SME to Optimize General Matrix Multiplications

College of Computer Science

Chencheng Deng, Weiling Yang, Jianbin Fang, Dezun Dong

AI总结:

本文提出MpGEMM开源库,通过利用ARM SME架构特性优化GEMM性能,实现1.23倍速度提升。

摘要:

通用矩阵乘法(GEMM)是高性能计算和深度学习中的关键内核。尽管现代架构如ARM的可扩展矩阵扩展(SME)引入了专用硬件用于矩阵运算,但现有的线性代数库未能充分利用其潜力,尤其是对于大矩阵。本文提出了MpGEMM,一个开源库,利用SME的关键架构特性来优化GEMM在多种精度下的性能。通过系统地表征SME,我们推导出优化指南,以指导我们的设计。MpGEMM采用缓存感知的分区、高效的打包方法配合即时转置,以及利用多向量加载和所有可用瓷砖寄存器的专用微内核。在Apple M4 Pro上使用DeepSeek和LLaMA的真实工作负载进行评估,MpGEMM在与供应商优化的Apple Accelerate库相比实现了平均1.23倍的速度提升,并显著优于其他开源替代方案。

英文摘要:

General Matrix Multiplication (GEMM) is a critical kernel in high-performance computing and deep learning. While modern architectures like ARM's Scalable Matrix Extension (SME) introduce dedicated hardware for matrix operations, existing linear algebra libraries fail to fully exploit its potential, particularly for large matrices. This paper presents MpGEMM, an open-source library that leverages key architectural features of SME to optimize GEMM across multiple precisions. Through a systematic characterization of SME, we derive optimization guidelines that inform our design. MpGEMM employs cache-aware partitioning, efficient data packing with on-the-fly transposition, and specialized micro-kernels that utilize multi-vector loads and all available tile registers. Evaluated on an Apple M4 Pro with real-world workloads from DeepSeek and LLaMA, MpGEMM achieves an average speedup of 1.23x over the vendor-optimized Apple Accelerate library and significantly outperforms other open-source alternatives.

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

↑