Basis Lab

Why a GPU Is Built This Way

How a GPU Stays Busy While Every One of Its Workers Is Waiting for Memory

Last timeOne Program, Many Values

A processor spends chip making each wait for memory short. A GPU leaves the wait long and keeps enough other groups ready that something can always run.

The wait for memory

The last lesson left a group of workers sharing one stream of instructions. The stream runs on a unit of arithmetic hardware. This lesson is about how much of the time that unit is doing anything.

The trouble is memory. Arithmetic on values already in hand takes a step or so. Fetching a value from the device's main memory takes far longer. NVIDIA's CUDA C++ Best Practices Guide (2026 edition) puts the delay for memory that is not held close by at hundreds of clock cycles.

A processor attacks the wait itself. It spends a large share of its chip on fast storage close to the arithmetic and on guessing what will be asked for next, so that most fetches come back almost at once. That is part of what the first lesson's expensive worker was paying for.

A plain worker has none of that. To keep the numbers small enough to draw, suppose a group runs for one step, asks for memory, waits three steps, and then runs again. A unit holding that one group is busy one step in four.

Switch instead of wait

The observation that rescues the design is that waiting uses no arithmetic. A group that has asked for memory needs nothing from the unit until the answer arrives. So the unit can run a different group in the meantime.

FIG 1One unit, two groups
step12345678910
the unitgroup Agroup Bidleidlegroup Agroup Bidleidlegroup Agroup B
group Arunningwaitingwaitingwaitingrunningwaitingwaitingwaitingrunningfinished
group Bready, no unit freerunningwaitingwaitingwaitingrunningwaitingwaitingwaitingrunning

Busy for 6 of 10 unit steps, 60 per cent. A free unit goes to the first ready task, top to bottom.

10 steps
Each group runs a step, waits three for memory, and repeats. With two groups the unit has work in steps 1 and 2 and then nothing to do until the first answer comes back. It is busy six steps in ten.

Two groups are better than one and still leave gaps. Add two more.

The lesson stops here

5 more paragraphs to go

You have read the opening. The rest of the argument, the problems that check whether it landed, and the lines worth keeping at the end all come with a plan.

The first lesson of every course in the library reads the whole way through, free, so you can see exactly what the rest of them are.

See the planThe contents

This is the reading half

Starting the course gives you your own copy of it. Every idea on every page has problems standing under it, marked with a reason rather than a tick, and any sentence you do not believe can be opened and argued with. None of that can happen on a page nobody owns.

The contents

The rest of this course

  1. 01The Same Chip Buys One Worker at Speed Four or Sixteen at Speed One
  2. 02Why a Machine Can Be Four Times Slower and Four Times Faster at Onceopening only
  3. 03Five Seconds That Will Not Divide Cap a Thousand Workers at Twenty Timesopening only
  4. 04Thirty-Two Workers Share One Stream of Instructions, and One Dissenter Stalls Them Allopening only
  5. 05How a GPU Stays Busy While Every One of Its Workers Is Waiting for Memoryyou are here
  6. 06How Big a Job Must Be Before Sending It to the GPU Pays for the Journeyopening only
  7. 07Three Numbers on a GPU Data Sheet and How to Tell Which One Limits Your Jobopening only
  8. 08Four Kinds of Job a GPU Does Worse Than the Processor Beside Itopening only

Read alongside