Skip to content

Commit 78a1cf4

Browse files
committed
Update blog
1 parent 8b74efe commit 78a1cf4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

content/blog/2025-10-27-1761560082.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ tags:
1111
A possible intuition for understanding GPU memory hierarchy (and the performance penalty for data transfer between various layers) is to think of it like a manufacturing logistics problem:
1212
1. CPU (host) to GPU (device) is like travelling overnight between two cities. The CPU city is like the "headquarters", and contains a mega-sized warehouse of parts (think football field sizes), also known as 'Host memory'.
1313
2. Each GPU is like a different city, containing its own warehouse outside the city, also known as 'Global Memory'. This warehouse stockpiles whatever it needs from the headquarters city (CPU).
14-
3. Each SM/Core/Tile is a factory located in different areas of the city. Each factory contains a small warehouse (shed) for stockpiling whatever inventory it needs, also known as 'Shared Memory'.
14+
3. Each SM/Core/Tile is a factory located in different areas of the city. Each factory contains a small warehouse for stockpiling whatever inventory it needs, also known as 'Shared Memory'.
1515
4. Each warp is a bulk stamping machine inside the factory, producing 32 items in one shot. There's a tray next to each machine, also known as 'Registers'. This tray is used for keeping stuff temporarily for each stamping process.
1616

1717
This analogy can help understand the scale and performance penalty for data transfers.
1818

1919
For e.g. reading constantly from the Global Memory is like driving between the factory and the warehouse outside the city each time (with the traffic of city roads). This is much slower than going to the shed inside the factory (i.e. Shared Memory), and much much slower than just sticking your hand into the tray next to your stamping machine (i.e. Registers). And reading from the Host Memory (CPU) is like taking an overnight trip to another city.
2020

21+
A bit of detail: the warehouse of each factory (i.e. Shared Memory) isn't a single building, but is actually a collection of individual sheds called 'banks' (e.g. 32 sheds/banks). Each shed has its own entry, and an employee stands at the entrance of the shed to service your request.
22+
2123
Therefore the job of running a computation graph (like ONNX) efficiently on GPU(s) is like planning the logistics of a manufacturing company. You've got raw materials in the main warehouse that you need to transfer between cities, and store/process/transfer artifacts across different factories and machines. You need to make sure that:
2224
- the production process follows the chart laid out in the computation graph
2325
- every machine in each factory is being utilized optimally

0 commit comments

Comments
 (0)