Basis Lab

How a Program Runs on a GPU

The Function Asked for a Little More Storage and Half Its Groups Had to Leave

Last timeWhich Group Runs Now

A core has fixed private storage and fixed shared storage. What each worker asks for decides how many groups are resident, and so how much of the wait is hidden.

What one core has to give

The last lesson ended on a condition. Changing groups is free because every resident group keeps its working values on the chip. So the chip's storage decides how many groups can be resident, and resident groups are what hide the wait.

Real numbers are needed here. Take the architecture NVIDIA's programming guide numbers 10.0, which its device list assigns to the B200, a data-centre device announced in March 2024. The 2026 edition of the guide gives the limits of one core, which the vendor calls a streaming multiprocessor.

FIG 1
Limit of one coreValueVendor's name
Resident workers2,048, which is 64 groupsthreads, warps
Private storage65,536 cells of 32 bitsregisters
Shared storage233,472 bytesshared memory
Resident blocks32blocks

Private storage is where a worker keeps its own working values, its index and partial results. Shared storage belongs to a block and is the subject of the next lesson. The fraction of the 64 groups actually resident is what the vendor calls occupancy.

Divide the first two rows. 65,536 cells among 2,048 workers is 32 cells each. A function whose workers need 32 or fewer can fill the core. One that needs more cannot, and the compiler, not the programmer, decides the number, up to 255 per worker on this architecture.

The four limits

A block is resident whole or not at all. So the question is how many whole blocks fit, and there are four separate reasons a block might not.

The lesson stops here

4 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 Loop Had an Order and the Sum Never Needed It
  2. 02Nobody Hands a Worker Its Index, So It Works It Out from Where It Sitsopening only
  3. 03One Worker Disagrees and Thirty-One Others Stand and Waitopening only
  4. 04A Group That Is Waiting Does Not Need the Arithmetic Units, So Another Takes Themopening only
  5. 05The Function Asked for a Little More Storage and Half Its Groups Had to Leaveyou are here
  6. 06Adding 256 Numbers in Eight Stages, with Everyone Waiting at the End of Eachopening only
  7. 07Two Workers Added One to the Same Cell and It Went Up by Oneopening only
  8. 08The Timer Said the Function Took No Time, Because It Had Not Run Yetopening only

Read alongside