Space Filling Curves is All You Need: Communication-Avoiding Matrix Multiplication Made Simple
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
- Tensor Comprehensions: Framework-Agnostic High-Performance Machine Learning Abstractions
- Towards a high-performance AI compiler with upstream MLIR
- Library Liberation: Competitive Performance Matmul Through Compiler-composed Nanokernels
Related papers
- iScheduler: Reinforcement Learning-Driven Continual Optimization for Large-Scale Resource Investment Problems
- SAMM: Sharded Automated Market Maker
- InferScale: GPU-Native KV Injection for Personalized LLM Serving
- Vigil: Accountable Liveness against Selective Silence
- Steelhead: Interleaving Partially Synchronous and Asynchronous Commit Rules on a Shared DAG
- Lightweight Scheduling Policies for Continuously Batched LLM Serving Across GPU Architectures