Locality transforms raise operations per byte, so the point slides right along the slope. Tiling keeps a B x B block on chip and reuses each element about B times.
Doubling the tile edge roughly doubles intensity. The kernel climbs the slope toward the ridge without touching any ceiling.
Tiled GEMM (FP32, N = 512, multiply-add counts as 2 FLOP):
ops = 2N^3 = 2 x 134,217,728 = 268,435,456 FLOP
DRAM bytes ~= 8N^3 / B + 4N^2 (A/B refetch plus C writeback)
B = 16: bytes = 67,108,864 + 1,048,576 = 68,157,440 B
AI = 268,435,456 / 68,157,440 ~= 3.94 FLOP/B
cap = min(100, 3.94 x 20 ~= 78.8) ~= 79 GFLOP/s, memory-bound
B = 32: bytes = 33,554,432 + 1,048,576 = 34,603,008 B
AI = 268,435,456 / 34,603,008 ~= 7.76 FLOP/B
cap = min(100, 7.76 x 20 ~= 155) = 100 GFLOP/s, compute-boundSome kernels cannot reuse more, so the fix raises a roof. More bandwidth steepens the slope, and more ALUs lift the flat roof.
Fix | What moves | Worked effect at AI 0.5 |
|---|---|---|
Tile 16 to 32 | Point slides right | 79 toward 100 GFLOP/s |
Bandwidth 20 to 40 GB/s | Slope steepens | 0.5 x 40 = 20 GFLOP/s |
Peak 100 to 200 GFLOP/s | Flat roof lifts | No change, still slope-bound at 10 |
Peak helps only points already right of the ridge. Slope-bound kernels need reuse or bandwidth, never wider ALUs.
Each locality tool moves a different term. Tiling shifts intensity, while prefetch raises achieved bandwidth use by overlapping misses.
Tool | Roofline effect | Cost |
|---|---|---|
Tiling and blocking | Intensity rises with reuse | Tile bookkeeping and edge waste |
Prefetch | Sustained bandwidth use rises | Extra traffic if accuracy is low |
Fusion across operators | Intermediate traffic leaves DRAM | Larger live working set |
Report the gap before and after: cap minus measured throughput. The B = 16 tile caps at about 79, so a kernel at 60 GFLOP/s leaves 19 on the table.
Oversized tiles spill out of on-chip storage and traffic jumps back up. The point then slides left again, which is the sign the tile is too big.
From min(100, 40) = 40 to min(100, 80) = 80 GFLOP/s. The point climbs the slope and stays memory-bound.
Its cap is 0.5 x 20 = 10 on the slope. The flat roof never bound it, so lifting that roof changes nothing.