Module 3 · Optional visual companion
Memory requests and tile reuse
Watch addresses become sector requests, then see how shared tiles feed several outputs. One operation per Next press; pause as long as you need.
Group memory requests
One instruction, 32 lane requests
← / →: one step · Home: restart chapter · 1.5-second visual transitions represent reading pace, not GPU time.
Keep the work; change the movement
32 lanes each request one distinct 4-byte value. Stride is the gap between lane addresses, in elements. Offset is the first byte address. A sector spans 32 aligned bytes. These controls count request footprints, without caches.
Tile size and logical traffic
Multiply two 4×4 matrices. One output tile loads its input rows and weight columns across all four inner positions, then stores completed outputs. Elements occupy 4 bytes; caches and edge tiles are outside this example.
Larger tiles may reduce logical loads but need more shared storage and registers; lower residency or synchronization can offset reuse. Test performance on real hardware.
Read the boundaries correctly
- Lane / warp
- A lane identifies one thread within a 32-thread NVIDIA warp. Requests are grouped for teaching, not separate chronological load instructions.
- Sector footprint
- Distinct aligned 32-byte address regions touched by one instruction in this model. Useful bytes count only requested values. Neither quantity alone measures DRAM traffic or runtime.
- Tile / shared memory
- A tile is a small matrix patch. Threads in one block explicitly stage operands in shared memory to reuse them.
- Barrier / register sum
- A block barrier makes staged operands safe to consume, or protects them from overwrite after use. Each output’s running sum stays in its thread’s registers. Barriers must be reached consistently by participating threads, including threads with guarded edge loads.
What the drawings leave out
Invented integer matrices match lesson 3.3. The illustrated 2×2 patch is not a whole warp or a realistic optimized tensor-core kernel. Loading and product phases are logical dependencies, not a GPU scheduler trace. The shared-memory tile is an explicit algorithm choice, not a mandatory HBM → cache → shared-memory route.
Tile counts describe logical global-memory element demands, including output stores. Hardware cache reuse, bank conflicts, address instructions, resource limits and actual DRAM transfers require separate analysis. Even equal mathematical results can differ in floating-point rounding with a different accumulation order.
Primary source: NVIDIA CUDA Best Practices: coalescing and shared-memory matrix multiplication. Memory lesson · Tiling lesson.