6.2.7 · D1GPU Architecture

Foundations — Memory hierarchy (global, shared, registers)

2,069 words9 min readBack to topic

Before you can read a single formula in the parent note, you need the vocabulary those formulas are built from. This page lists every symbol and every concept the parent assumes, from absolute zero, and orders them so each one rests on the one before.


0. The very first picture: memory is a ladder

Everything in this topic hangs on one image: storage arranged as a ladder. High rungs are small but instant to reach; low rungs are enormous but slow. Look at the figure below and hold it in your head — every later idea attaches to a rung.

Figure — Memory hierarchy (global, shared, registers)

Why the topic needs these two words: every row of the parent's summary table is nothing but a (latency, capacity) pair. If you don't feel these as distance and width, the table is just numbers.


1. Clock cycle — the unit of time

When the parent writes "memory access latency can be 100–1000× longer than computation", it means: one arithmetic operation costs ~1 cycle, but one global-memory fetch costs hundreds of cycles. That ratio is the entire motivation for the hierarchy.


2. Bytes, KB, GB — the unit of size

A single float (a decimal number in the GPU) is 4 bytes — remember this number, the whole coalescing story uses it. Picture a byte as one small brick; a float is four bricks glued together.


3. The thread — the smallest worker

If this is new, build it up fully in GPU Thread Hierarchy. For this page you only need: a thread is one worker, and it owns some private storage.

Figure — Memory hierarchy (global, shared, registers)

Why the topic needs the warp: coalescing and bank conflicts are both about "what happens when 32 threads ask for memory at the same instant". No warp, no coalescing.


4. The SM — the factory floor that owns the fast rungs

This is the root of the whole register pressure story: the register file is a fixed-size cupboard bolted to the SM, and every resident thread must be given a drawer from it.


5. The symbols in the parent's formulas

Now that the pictures exist, we can name the letters. Each entry is: symbol → plain words → the picture it lives in.

Figure — Memory hierarchy (global, shared, registers)

6. How every foundation feeds the topic

clock cycle = time unit

latency vs capacity ladder

byte KB GB = size unit

thread = one worker

thread block

warp of 32 threads

SM owns fast storage

registers and Rtotal r

shared memory and banks B w

coalescing segments

bank conflicts mod

occupancy latency hiding

global memory transactions

Memory Hierarchy

Read it top-down: the two units (time, size) build the ladder; the worker hierarchy (thread → block → warp) plus the SM decide who shares which rung; those together produce the three formula-families — registers/occupancy, bank conflicts, and coalescing — that make up the topic.


7. A tiny worked check (uses only the symbols above)


Equipment checklist

Cover the right side and answer each aloud. If any fails, re-read its section before the next deep dive.

A clock cycle is
one tick of the GPU's clock — the unit all latencies are counted in, so numbers stay comparable across clock speeds.
A float occupies how many bytes
4 bytes (and a bank is exactly 4 bytes wide, ).
A thread is
one worker running your program on one data stream, with its own private registers.
A warp is
exactly 32 threads executing in lockstep — the unit the memory system serves at once.
An SM is
one processing floor of the GPU that physically holds the register file and shared memory, which is why they're small and shared.
and mean
total registers on an SM, and registers used by one thread.
The (floor) symbol means
round down to the nearest whole number, because you can't run a fraction of a thread.
Occupancy is
— the fraction of the thread ceiling you fill; high occupancy hides latency.
A bank is
one narrow lane of shared memory that serves one request per cycle; there are of them.
The (modulo) operation gives
the remainder after division — it maps an address onto one of the 32 banks like hours wrap on a clock.
A segment is
an aligned fixed-size block (32/64/128 B) that global memory hands out whole; counts how many a warp touches.
The (ceiling) symbol means
round up — used for transactions because touching one byte costs the whole segment.

Next: with every symbol earned, you can now read the parent's three-level breakdown and its cousins CUDA Memory Types, Cache Architecture, and Matrix Multiplication Optimization without hitting an undefined letter.