LESSON 32.07 · 6 STAGES · 2 CONTROLS · 3 CHECKSPRO · PREVIEW
Caching allocators and memory pools
Watch three engine steps get memory for their tensors, three ways.
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 · 32.07 · ALLOCATOR BAY21 TENSORS · PEAK 192 KiB
01
Stage 1 of 6 · Tensor lifetimes
Each op writes a new tensor. The tensor is freed after the last op that reads it.
Explain it simply
Each bar is one tensor, from the op that writes it to the last op that reads it. Step 2 runs 16 tokens, so its bars are thicker. At most 192 KiB is alive at one time.
Seven rows of bars, one row per tensor name, over three steps of 4, 16, 6 tokens. The peak is 192 KiB.
live tensorcached free blocksegment or arenaallocator time, misseskernel time, peak
Toy: one layer, D 1,024, fp16; 3 engine steps; 64 KiB segments (PyTorch: 2 MiB); toy µs
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
A tensor's bytes grow with the tokens in its step.
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.