LP-GEMM: Integrating Layout Propagation into GEMM Operations

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Carneiro, César Guedes, Alvarenga, Lucas, Araujo, Guido, Rigo, Sandro
Format: Preprint
Veröffentlicht: 2026
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866913007578120192
author Carneiro, César Guedes
Alvarenga, Lucas
Araujo, Guido
Rigo, Sandro
author_facet Carneiro, César Guedes
Alvarenga, Lucas
Araujo, Guido
Rigo, Sandro
contents In Scientific Computing and modern Machine Learning (ML) workloads, sequences of dependent General Matrix Multiplications (GEMMs) often dominate execution time. While state-of-the-art BLAS libraries aggressively optimize individual GEMM calls, they remain constrained by the BLAS API, which requires each call to independently pack input matrices and restore outputs to a canonical memory layout. In sequential GEMMs, these constraints cause redundant packing and unpacking, wasting valuable computational resources. This paper introduces LP-GEMM, a decomposition of the GEMM kernel that enables packing-layout propagation across sequential GEMM operations. This approach eliminates unnecessary data repacking while preserving full BLAS semantic correctness at the boundaries. We evaluate LP-GEMM on x86 (AVX-512) and RISC-V (RVV 1.0) architectures across MLP-like and Attention-like workloads. Our results show average speedups of 2.25x over OpenBLAS on Intel x86 for sequential GEMMs and competitive gains relative to vendor-optimized libraries such as Intel MKL. We demonstrate the practicality of the approach beyond microbenchmarks by implementing a standalone C++ version of the Llama-3.2 inference path using exclusively BLAS-level GEMM calls. These results confirm that leveraging data layout propagation between operations can significantly boost performance.
format Preprint
id arxiv_https___arxiv_org_abs_2604_04599
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle LP-GEMM: Integrating Layout Propagation into GEMM Operations
Carneiro, César Guedes
Alvarenga, Lucas
Araujo, Guido
Rigo, Sandro
Distributed, Parallel, and Cluster Computing
Computer Vision and Pattern Recognition
Machine Learning
In Scientific Computing and modern Machine Learning (ML) workloads, sequences of dependent General Matrix Multiplications (GEMMs) often dominate execution time. While state-of-the-art BLAS libraries aggressively optimize individual GEMM calls, they remain constrained by the BLAS API, which requires each call to independently pack input matrices and restore outputs to a canonical memory layout. In sequential GEMMs, these constraints cause redundant packing and unpacking, wasting valuable computational resources. This paper introduces LP-GEMM, a decomposition of the GEMM kernel that enables packing-layout propagation across sequential GEMM operations. This approach eliminates unnecessary data repacking while preserving full BLAS semantic correctness at the boundaries. We evaluate LP-GEMM on x86 (AVX-512) and RISC-V (RVV 1.0) architectures across MLP-like and Attention-like workloads. Our results show average speedups of 2.25x over OpenBLAS on Intel x86 for sequential GEMMs and competitive gains relative to vendor-optimized libraries such as Intel MKL. We demonstrate the practicality of the approach beyond microbenchmarks by implementing a standalone C++ version of the Llama-3.2 inference path using exclusively BLAS-level GEMM calls. These results confirm that leveraging data layout propagation between operations can significantly boost performance.
title LP-GEMM: Integrating Layout Propagation into GEMM Operations
topic Distributed, Parallel, and Cluster Computing
Computer Vision and Pattern Recognition
Machine Learning
url https://arxiv.org/abs/2604.04599