Topic 0 › Introduction

Introduction

Why memory first: the three ideas that carry the whole curriculum.

The premise › Why memory first?

Every performance phenomenon is a memory phenomenon

This curriculum teaches GPU programming and inference performance, but it does not start with a GPU. It starts with memory, on an ordinary CPU, where the ideas are easiest to see. The bet is simple: if you learn memory once, deeply, then every GPU and inference concept that follows stops being a new idea and becomes a callback. Coalescing is the cache line from chapter 0.5. FlashAttention is the tiling trick from the GEMM arc. Paged KV cache is virtual memory wearing a serving hat.

Topic 0 stays entirely in CPU land. By the end of it you should be able to explain why a memory access costs what it costs, and predict the cache behavior of simple code before you run it.

The spine › Three ideas

Three ideas carry everything

Everything in the next thirty-six chapters hangs on three ideas. They are introduced in this topic and deliberately re-invoked in every later one:

1. Latency ≠ bandwidth ≠ capacity. Three different quantities, three different costs. Confusing them is the single most common way performance intuition goes wrong.

2. The hierarchy exists because fast memory can't be big. Caches, shared memory, register files, KV-cache paging: every tier you will ever meet is a response to this one physical constraint.

3. Time = max(bytes ÷ bandwidth, FLOPs ÷ compute). The roofline. By the end of Topic 1 you should be able to napkin-math this for any kernel, and you will never stop using it.

How this works › Predict, then run

You will compute numbers by hand

Every chapter ends with you computing a number: a memcpy time, a miss rate, a tokens-per-second estimate. And every interactive uses predict-before-reveal: you commit to a guess, then run the simulation and reconcile the gap. Sliders you can watch passively teach less than a forced guess.

Start with the next chapter, Bytes and addresses, and work forward. Each chapter opens by naming exactly which earlier ideas it builds on.

Learn memory once, deeply. Everything after is a callback.