Basis Lab

Memory Is the Limit on a GPU

Where a Byte Is Kept Decides What It Costs to Read

Last timeArithmetic per Byte

A worker on a GPU can hold a value in four places, each larger and slower than the one before, and the cost of a job depends on how often each value is read from which.

The last two lessons treated the device's memory as one store with one rate. Between that store and a worker there are nearer places to keep a value, and most of the skill in the rest of this course lies in using them.

The four levels

Why a GPU Is Built This Way described the device as many identical processing units, each running groups of workers. The vendor's programming guide lists what each has to keep values in.

FIG 1From a worker out to the device's memory
Two of the five boxes are under the program's control: the slots and the block's storage. The two caches help when they happen to hold what is wanted. The last box is the only one large enough for the data.

The pattern is the same as on a processor, which Memory, All the Way Down follows level by level. What is new is the second box: storage that belongs to a team of workers and that the program fills deliberately.

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. 01Add Up the Largest Moment, Not the Average
  2. 02The Fastest a Job Can Run Is Its Bytes Divided by the Bandwidthopening only
  3. 03One Division Says Whether Faster Arithmetic Would Helpopening only
  4. 04Where a Byte Is Kept Decides What It Costs to Readyou are here
  5. 05A Group That Reads Next-Door Addresses Wastes Nothingopening only
  6. 06Store Each Field in Its Own Array and the Group Reads Next-Door Bytesopening only
  7. 07Use a Value Many Times While It Is Near and the Memory Stops Being the Limitopening only
  8. 08Four Ways to Fit, and What Each One Costsopening only

Read alongside