First-Principles Physics
Kernel Engineering Series · Interactive Lab
Companion to
Part 3: Climbing the CUDA GEMM Ladder
·
Part 2: Silicon Bottleneck
·
Source on GitHub
Climbing the CUDA GEMM Ladder: Eliminating the Byte Tax
Every rung is a physics experiment against one enemy: moving bytes that don't earn their keep.
Step through all 8 kernels from my_matmul_kernels.py—watching each optimization crush one silicon bottleneck and immediately expose the next.
Target GPU
132 SMs · 61.8 TFLOP/s FP32 · 3.35 TB/s HBM3 · FP32 Ridge 18.4 FLOP/B
Rung 1 · Global Memory Baseline
Naive MatMul (Uncoalesced Sector Explosion)
Presets:
Bottleneck Crushed
—
Next Wall Exposed
—
Live Roofline Shift (FP32 CUDA Cores)
Analytical model (not measured GPU runs): Ceilings = official NVIDIA datasheet specs; X-axis = exact closed-form HBM AI from
my_matmul_kernels.py; dot height below roof illustrates on-chip stall headroom from CUDA literature.
Failure Mode & Nsight Compute Diagnostic
What Breaks If You Slip — and What Moves in ncu
my_matmul_kernels.py ↗
L21–L36
Highlighted lines drive the bottleneck shift
Rung 1 / 9
The Full GEMM Ladder at a Glance
Click any row to jump directly to its live simulation · All numbers derived analytically for FP32 (4 B/float, 32B sectors)
| Rung | Kernel / Mechanism | Tile Hierarchy | HBM AI (FP32) | SMEM / MIO Pressure | Bottleneck Fixed | Next Bottleneck Exposed |
|---|