Module 04 · How Computers Work · Inside the operating system · about 15 min to read
Thousands of tiny cores: how a GPU works
The CPU · Open board
One core’s fetch, decode and execute circle. A GPU keeps that circle but shares each turn of it between 32 workers at once.
Before you start. The CPU (fetch-decode-execute, the ISA, assembly) showed one core repeating fetch, decode and execute, where fetch reads the next instruction and execute does it. Why chips went wide: clocks, heat and the end of free speed showed why chips stopped getting faster per core and started getting wider. The Memory Hierarchy (cache, locality, the memory wall) showed that a read from far memory costs far more time than a read from near memory. Doing many things at once inside one core: out-of-order, SIMD and speculation showed how one core overlaps work to hide waiting. This lesson takes the idea of going wide to its end.
Lesson 20 of 41 in How Computers Work
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
- The problem: one small if made the program twice as slow
- A thread: one small worker with its own number
- A warp: 32 threads that share one instruction (SIMT)
- Divergence: when the 32 threads disagree
- Coalesced access: 32 neighbours read in one trip
- Latency hiding: switching warps while one waits
- Matrix multiply: the same step, thousands of times
- How a warp runs a branch
- Divergence and coalescing, run
- How often does a random branch split a warp?
- Edge cases and costs
Terms it explains: thread, warp, SIMT, divergence, coalesced, hidden, latency hiding, ALU, assembly, branch prediction, CISC vs RISC, clock, core, fetch-decode-execute, flags, immediate, IPC, ISA, opcode, operand, out-of-order, PC (program counter), pipelining, register, superscalar.
Review How Computers Work
Saved in this browser, and to your account when you sign in.