One Worker Disagrees and Thirty-One Others Stand and Wait
Last timeWorkers, Blocks and the Grid
The device runs workers in fixed groups that execute one instruction at a time. When members disagree at a decision, both sides are run and part of the group idles on each.
The groups you did not ask for
The launch names two things, the number of blocks and the workers in each. There is a third level that it never mentions. Inside a block, the device runs workers in fixed groups.
On NVIDIA devices a group is 32 workers. The 2026 edition of the vendor's programming guide gives that size for every architecture in its table, and calls the group a warp. The guide also says how the cut is made: each group holds consecutive workers, and the first group starts at worker 0. So in a block of 256, workers 0 to 31 are one group, 32 to 63 the next, and there are 8 groups in all.
| Workers in the block | Groups | Members of the last group | Empty places in it |
|---|---|---|---|
| 256 | 8 | 32 | 0 |
| 128 | 4 | 32 | 0 |
| 100 | 4 | 4 | 28 |
| 33 | 2 | 1 | 31 |
A block whose size is not a multiple of 32 leaves places in its last group empty for the whole run, which is why the guide advises multiples of 32.
One instruction for the whole group
A group executes one instruction at a time, for all of its members together. The vendor's name for this is SIMT, single instruction, multiple threads. The instruction is fetched once and decoded once, and then carried out 32 times on 32 workers' own data.
This is the bargain described in Why a GPU Is Built This Way, seen from the inside. The machinery that works out what to do next is shared among 32 workers, which is how so many arithmetic units fit on the chip. The condition is that all 32 want the same instruction next. For the array addition of the first lesson they always do.
The lesson stops here
7 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