Thirty-Two Workers Share One Stream of Instructions, and One Dissenter Stalls Them All
Last timeWork That Splits and Work That Does Not
A GPU's workers are cheap because a group of them shares one stream of instructions. The price is paid at every decision the members of a group do not agree on.
One stream for a group
The first lesson took it as given that a plain worker costs one unit of chip. This lesson is about how a worker gets that cheap, and what was given up to make it so.
A worker needs two things. It needs something that fetches the next instruction and works out what it asks for. And it needs something that carries out the arithmetic on that worker's own values. On a GPU thousands of workers run the same function, each on a different element of the data. The values differ from worker to worker. The instructions do not.
So a GPU builds the first thing once for a whole group. One stream of instructions is fetched and worked out, and every worker in the group carries out each instruction on its own values in the same step.
The size of a group
The names and the size belong to the vendor. On NVIDIA devices a worker is called a thread, a group is called a warp, and the arrangement is called single instruction, multiple threads, or SIMT. The CUDA Programming Guide (2026 edition) gives the size: threads are organised into groups of 32, and all the threads of a group execute the same instruction at the same time.
Two properties of that number matter. It is fixed by the device, so a program cannot ask for groups of 8. And workers are packed into groups in order, the first 32 in one group and the next 32 in the next, so which workers end up together follows from how the data is laid out.
Both sides in turn
Sharing one stream works perfectly until the function contains a decision. Suppose each worker tests its own value and does one thing if the value is positive and another if it is not. Some workers in a group will want the first side and some the second, and the group has only one stream.
The group runs both sides, one after the other. While the first side runs, the workers that chose the second are switched off and do nothing. Then the second side runs with the others switched off. The guide's term for a switched off worker is masked, and for the whole event warp divergence.
The lesson stops here
3 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 contentsThis 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