LESSON 27.10 · 5 STAGES · 2 CONTROLS · 3 CHECKSPRO · PREVIEW
Tiled matrix multiplication
Watch tiles of A and B load once and serve many outputs.
Needs27.09 GEMM vs GEMV
Pro lesson. Stage 1 is free to watch. Pro opens all 5 stages, 2 controls and 3 checks, in this lesson and every other.
Go Pro · $8.25/moEXPLAINER · 27.10 · GPU BAYNAIVE · 1,056,768 B FROM HBM
01
Stage 1 of 5 · The naive kernel
The naive GPU kernel gives each output its own thread. It reads 64 values of A and 64 of B from HBM.
Explain it simply
Each output in C is one row of A times one column of B. In the naive kernel, one thread makes one output alone. It fetches all 128 of its numbers from HBM, the big and slow memory. So each number in A is fetched 64 times.
Matrices A, B and C, 64 by 64. Output C 20, 41 uses row 20 of A and column 41 of B. The naive kernel moves 1,056,768 bytes from HBM.
weights A, tile edgesinputs B, bytes movedoutputs C, math time
Toy: the 64 × 64 matmul of 27.C2 on a toy GPU (HBM 64 GB/s, shared memory 512 GB/s)
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
Each output adds 64 products of a row of A and a column of B.
PRO LESSON · YOU WATCHED STAGE 1 OF 5
Unlock the full explainer
- 4 more stages and 2 live controls
- 2 mix-up cards and 3 predict-then-reveal checks
- Watch it as a narrated video, in three voices
- Every Pro lesson and capstone · 656 in total
$99 a year, or $15 a month. Cancel any time.