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

arXiv:2601.16294 · cs.DC, cs.AI · Submitted 2026-01-22 · Read on arXiv

cs.DC, cs.AI

Submitted: 2026-01-22

Updated: 2026-09-30

Code: https://github.com/jakubcerveny/gilbert

License: http://creativecommons.org/licenses/by/4.0/

The gist: General Matrix Multiplication (GEMM) is the cornerstone of HPC workloads and Deep Learning.

Terminology

Abstract

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.

Sources

Related papers