← All questions
Inference & ServingHard· GEMM· GPU Architecture· Performance Profiling

Explain why GEMM throughput has a wavy pattern as matri...

The wavy throughput pattern in GEMM operations is primarily driven by two performance hazards. First, discretization waste occurs when a matrix dimension is not a multiple of the tile size T. This results in the last tile being only partially filled, meaning the majority of threads in that tile perform no useful work. Second, wave quantization occurs when the total number of tiles is not perfectly divisible by the number of streaming multiprocessors (SMs). This forces the GPU to schedule an additional ‘wave’ of execution to process the remaining tiles. Because this final wave consumes nearly the same amount of time as a full wave but utilizes only a fraction of the SMs, it creates a significant performance penalty. Both effects can occur simultaneously when a dimension is incremented, leading to sharp drops in throughput.

Code playground (Python)