AI inference glossary
SoftwareGEMM

GEMM

Also known as general matrix multiply, matrix multiplication kernel

In plain English

GEMM is the general matrix multiply operation, the single computation that consumes most of the arithmetic in training and serving neural networks.

Technical definition

GEMM is the general matrix to matrix multiply routine, the core primitive that linear layers, attention projections, and expert computations in neural networks reduce to.

Engineering details

Transformers are mostly stacks of linear transformations, so serving a model means executing enormous numbers of matrix multiplies. Tensor cores exist specifically to accelerate them, and peak TFLOP/s specifications are quoted for these dense operations. Shape determines efficiency: prefill produces large square-ish multiplies that saturate compute, while decode produces skinny ones that are bandwidth bound. MoE adds grouped GEMMs, where many small expert multiplies are batched into one efficient launch.

Why it matters

GEMM efficiency is the substrate of every performance claim in the industry. The gap between delivered and peak GEMM throughput at real serving shapes, especially the thin matrices of decode, explains much of why spec sheet ratios fail to predict benchmark rankings.

How to read it in InferenceX

Behind every InferenceX curve sits a stack of GEMM kernels from libraries such as CUTLASS, hipBLASLt, and Triton generated code, and quantized recipes ultimately stand on how well each vendor executes low precision GEMMs at the shapes its scheduler produces.