arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.16294cs.DCcs.AI
收藏

空间填充曲线足矣:一种简化且高效的通信避免矩阵乘法方法

Space Filling Curves is All You Need: Communication-Avoiding Matrix Multiplication Made Simple

Intel Corporation(英特尔公司)

Evangelos Georganas, Alexander Heinecke, Pradeep Dubey

AI总结:

本文通过空间填充曲线技术简化了矩阵乘法,实现了平台和矩阵形状无关的高效计算,减少了数据传输并提升了性能,应用于LLM推理和分布式矩阵乘法中取得了显著加速。

摘要:

通用矩阵乘法(GEMM)是高性能计算和深度学习的核心。最先进的供应商库通过调整张量布局、并行化方案和缓存阻塞来最小化内存层次结构中的数据移动并最大化吞吐量。这些参数的最佳设置取决于目标平台和矩阵形状,使得全面调优不可行。我们重新审视空间填充曲线(SFC)以缓解这种繁琐的调优。我们利用SFC的最新进展将矩阵乘法划分为多个部分,从而获得平台无关和形状无关的矩阵乘法方案,具有高度的数据局部性。我们扩展了基于SFC的工作划分方法,以实现通信避免(CA)算法,这些算法能够证明性地最小化数据移动。CA算法的集成与紧凑的代码无缝结合,实现了在多个CPU平台上的最佳性能,对于多种GEMM形状,性能优于供应商库高达5.5倍(1.8倍加权调和均值加速)。我们通过利用我们的GEMM作为计算后端,在两个真实世界应用中展示了我们的工作的影响力:i)使用我们的GEMM进行LLM推理,加速高达1.85倍;ii)分布式内存矩阵乘法,加速高达2.2倍。

英文摘要:

General Matrix Multiplication (GEMM) is the cornerstone of HPC workloads and Deep Learning. State-of-the-art (SOTA) vendor libraries tune tensor layouts, parallelization schemes and cache blocking to minimize data movement across the memory hierarchy and maximize throughput. However, optimal settings for these parameters depend on the target platform and matrix shapes, making exhaustive tuning infeasible. In this work, we address this cumbersome scheduling search and tuning using space-filling curves (SFC). We partition the matrix multiplication using advancements in SFC, and obtain platform-oblivious and shape-oblivious matrix multiplication schemes with a high degree of data locality. We extend the SFC-based work partitioning to implement Communication-Avoiding (CA) algorithms with replication techniques in a seamless fashion. The resulting SFC-CA GEMM achieves provable asymptotic communication optimality for both square and rectangular matrix regimes. Across four x86 and Arm platforms, SFC-CA GEMM outperforms vendor libraries by up to 5.5$\times$ per shape and 1.8$\times$ in weighted harmonic mean (WHM) throughput. Last, we show the impact of our work on two real-world applications by leveraging our SFC-CA GEMM as a compute backend: i) prefill of LLM inference with speedups up to 1.85$\times$ over SOTA inference runtimes, and ii) distributed-memory matrix multiplication with speedups up to 2.3$\times$ over the SOTA distributed-memory GEMM framework with vendor-optimized compute backend.

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

↑