FlashGEMM: Optimizing Sequences of Matrix Multiplication by Exploiting Data Reuse on CPUs
ACM Transactions on Architecture and Code Optimization · 2025-12-31 · 22 (4) · 1-25
DOI: 10.1145/3760784 ↗At a glance
Journal article in ACM Transactions on Architecture and Code Optimization, published online on 2025-12-13. Written by Junwen Zhang and 4 co-authors. Cited 4 times so far (Crossref); 57 references. Funded by: National Key Research and Development Program of China, National Natural Science Foundation of China, Natural Science Foundation of China.
Abstract (original language)
General Matrix Multiplication (GEMM) is a fundamental operation in high-performance computing (HPC) and deep learning (DL) applications. While mainstream linear algebra libraries on CPUs, such as MKL and OpenBLAS, achieve high performance for individual, large-scale, and regular-shaped GEMM operations, which are commonly used in emerging HPC and DL applications. We present FlashGEMM , a novel and efficient approach for optimizing sequences of GEMM on x86 CPUs. FlashGEMM introduces a new data packing strategy that reduces the memory access overhead associated with packing operations. It also offers new micro-kernels designed to fully utilize the Vector Neural Network Instructions (VNNI) units of x86 CPUs, thereby increasing the compute-to-memory ratio (CMR). Additionally, FlashGEMM includes new loop fusion strategies to reuse intermediate data across consecutive GEMM operations. Experimental results demonstrate that FlashGEMM can outperform state-of-the-art across most GEMM workloads on multi-core CPUs.
Funding
- National Key Research and Development Program of China
- National Natural Science Foundation of China
- Natural Science Foundation of China
- New Chongqing Youth Innovative Talents Project
Cite
APA
Zhang, J., Yang, W., Fang, J., Dong, D., & Chen, X. (2025). FlashGEMM: Optimizing Sequences of Matrix Multiplication by Exploiting Data Reuse on CPUs. ACM Transactions on Architecture and Code Optimization, 22(4), 1-25. https://doi.org/10.1145/3760784
Vancouver
Zhang J, Yang W, Fang J, Dong D, Chen X. FlashGEMM: Optimizing Sequences of Matrix Multiplication by Exploiting Data Reuse on CPUs. ACM Transactions on Architecture and Code Optimization. 2025;22(4):1-25. doi:10.1145/3760784
BibTeX
@article{Zhang2025,
author = {Zhang, Junwen and Yang, Weiling and Fang, Jianbin and Dong, Dezun and Chen, Xianzhang},
title = {FlashGEMM: Optimizing Sequences of Matrix Multiplication by Exploiting Data Reuse on CPUs},
journal = {ACM Transactions on Architecture and Code Optimization},
year = {2025},
volume = {22},
number = {4},
pages = {1--25},
doi = {10.1145/3760784}
}
EUVIMED