LESSON 28.01 · 6 STAGES · 2 CONTROLS · 3 CHECKSPRO · PREVIEW
Naive attention's memory traffic
Watch every byte that plain attention moves between HBM and the chip.
Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 2 controls and 3 checks, in this lesson and every other.
Go Pro · $8.25/moEXPLAINER · 28.01 · MEMORY BAYQ, K, V IN HBM · 384 B
01
Stage 1 of 6 · Inputs in HBM
Q, K and V sit in HBM. Each has 16 rows of 4 values.
Explain it simply
Attention starts with three tables of numbers, called Q, K and V. Each row belongs to one token. They live in HBM, the big main memory of the GPU. The SRAM band above is fast, but this toy chip holds only 256 bytes there.
The HBM band holds Q, K and V, 16 by 4 each. S, P and O are empty outlines.
Q, K, VS, P in HBM (traffic to remove)O and byte countschip, kernelnot written
Toy: 1 head, 16 tokens × 4 values in FP16, seeded random, not trained; larger N and d count bytes only
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
Q, K and V each have N rows of d values.
PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
- 5 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.