← All questions
Inference & ServingMedium· GPU Architecture· Memory Hierarchy· Optimization

How does tiling improve matrix multiply performance on a GPU?

Tiling is a critical optimization technique for matrix multiplication on GPUs. By loading blocks of data into shared memory, the GPU can reuse these elements multiple times for the inner reduction loop. Instead of fetching each element of matrices A and B from HBM N times, tiling allows each element to be read only N/T times, where T is the tile size. This reduction in HBM traffic is essential for performance, as it shifts the bottleneck from the limited bandwidth of HBM to the high-throughput compute units of the GPU, allowing the workload to become near-compute-bound.

Code playground (Python)