Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 03 · AI · Past the basics · about 18 min to read

Play it as a journeyTutor comes with a plan

The GPU (thousands of cores, and the memory that feeds them)

Inference Engineering
Inference Engineering · Open board

The Inference Engineering board follows one request through a serving system. This lesson is the chip at the bottom of it.

Before you start. A matrix multiply is many dot products at once, multiply the pairs and add, and one neural-network layer is one, from Vectors, Dot Products and Matrix Multiply. A model reads your prompt in one burst, prefill, then writes the reply one token at a time, decode, and each weight costs a multiply and an add per token, two operations counted as FLOPs, from Inference Engineering (serving an LLM is a systems problem). An A100 is NVIDIA’s data-centre GPU, the AI track’s reference card. A batch is the group of conversations served on one decode step, each carrying its KV cache, the model’s saved working for every earlier word so it never recomputes it, and on an A100 a step costs at least 7 milliseconds (The Two Clocks (TTFT, TPOT, and why goodput is the number) measures it later). A processor keeps a little fast memory close and a lot of slow memory far away, and a far read costs many close ones, from The Memory Hierarchy (cache, locality, the memory wall) in How Computers Work.

The board leaves a puzzle on that same chip: one half of a request is limited by arithmetic, the other by fetching numbers from memory. This lesson is why.

Lesson 35 of 83 in AI

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • November 2006: CUDA, and the graphics card that was a calculator all along
  • Cores: thousands of painters, one instruction
  • HBM and bandwidth: the paint store, and the road to it
  • Shared memory: the table in the middle of each team
  • Arithmetic intensity: strokes per pot of paint
  • The roofline: which limit you are under
  • Where do the 312 trillion come from?
  • How many chats can share one trip?
  • Why does a bigger grid reuse more?
  • All of it in code

Terms it explains: Inference Engineering, FLOPs, HBM, bandwidth, shared memory, arithmetic intensity, roofline, compute-bound, memory-bound.

Review AI