LESSON 29.C1 · 6 STAGES · 2 CONTROLS · 2 CHECKSPRO · PREVIEW
KV-cache management end to end
Five cache managers serve six chats that share one system prompt.
Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 2 controls and 2 checks, in this lesson and every other.
Go Pro · $8.25/moEXPLAINER · 29.C1 · KV CACHESTEP 0 · 11 OF 32 BLOCKS IN USE · WASTE 6
01
Stage 1 of 6 · Allocate
R1 writes the system prompt into blocks 0–2. R2–R4 find blocks 0 and 1 by hash: 11 blocks in all.
Explain it simply
Four chats arrive at step 0. All of them start with the same 10 words, the system prompt. Look at blocks 0 and 1: four requests read them, so they are stored only once.
GPU memory at step 0 with the Offload manager. R1 writes the system prompt into blocks 0–2. R2–R4 find blocks 0 and 1 by hash: 11 blocks in all.
tokens (system prompt solid)booked empty, cached or freedwaste, evicted, computed; dashed: queuedcopied backstep
Toy: R1–R6 with a 10-token system prompt, 4-slot blocks, one follow-up each
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
A request takes one block for every 4 tokens.
PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
- 5 more stages and 2 live controls
- 2 mix-up cards and 2 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.