Basis Lab

Memory Is the Limit on a GPU

A Group That Reads Next-Door Addresses Wastes Nothing

Last timeThe Levels Between a Worker and the Memory

The workers of a group read in the same step and the device fetches in fixed units of 32 bytes, so how far apart their addresses lie decides how much of each fetch is used.

Lesson two said the floor on a job's time assumes every byte fetched is a byte wanted. This lesson shows when that holds and what it costs when it does not.

Reading in one step

Why a GPU Is Built This Way established that workers run in groups sharing one stream of instructions. The vendor's programming guide gives the size of a group as 32 workers and calls it a warp. Since the workers of a group are all at the same instruction, when one reads from the device's memory, all 32 read, each from its own address.

The device does not serve them one by one. Its best practices guide says the reads of a group are combined into as few transactions as will cover them. This course calls a transaction a fetch.

The fetch unit

On every recent device, the Tesla V100 and the A100 among them, a fetch is 32 bytes: one whole unit of the memory, starting at a multiple of 32. Eight values of four bytes fit in one. A fetch cannot be made smaller. A worker that wants four bytes causes all 32 to travel.

So the question for any read is how many units the group's 32 addresses fall in.

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. 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 Readopening only
  5. 05A Group That Reads Next-Door Addresses Wastes Nothingyou are here
  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