Chip Foundry Services Request Assessment

Roofline Model Performance Analysis

Roofline Model Performance Analysis is the visual performance model that bounds a compute kernel by either computational throughput or memory bandwidth — using arithmetic intensity (operations per byte moved) to reveal the dominant bottleneck and point optimization at the limit that actually governs performance.

Profile the kernel
count FLOPs and bytes moved
Compute arithmetic intensity
AI = FLOPs / bytes
Locate AI against the ridge pointridge = peak FLOPS / peak bandwidth
AI below ridge
memory-bound region
AI above ridge
compute-bound region
Apply the matching optimization
If memory-bound
tile, compress, lower precision
If compute-bound
vectorize, add ILP, tensor cores
↻ re-profile and move toward the roof
Raise AI itself
reuse cached data, cross the ridge
Attainable performance
min(peak FLOPS, bandwidth x AI)
The Roofline: One Plot, Two Ceilings performance is capped by the lower of the two limits; the ridge is where they meet attainable TFLOPS (log) arithmetic intensity, FLOP/byte (log) memory roof (slope = bandwidth) compute roof (peak FLOPS) ridge = 50 memory-bound compute-bound vector add (AI 0.25) stencil (AI 4) matrix multiply (AI 110) move a kernel right (raise AI by reusing cached data) to lift it off the memory roof toward peak compute

Arithmetic intensity is the one number that decides which ceiling you hit. It is the ratio of compute work to memory traffic, $AI = \dfrac{\text{total FLOPs}}{\text{total bytes moved}}$, measured in FLOP/byte. A kernel's attainable performance is the lower of two limits, $\min\!\left(P_{\max},\; B_{\max} \times AI\right)$, where $P_{\max}$ is the hardware's peak compute rate and $B_{\max}$ is its peak memory bandwidth. Below the ridge point a kernel is memory-bound and its speed rises linearly with $AI$; above it the kernel is compute-bound and no amount of extra bandwidth helps. The ridge point itself sits at $AI = P_{\max}/B_{\max}$: for a GPU with 100 TFLOPS and 2 TB/s that is $100/2 = 50$ FLOP/byte, so a dense matrix multiply ($AI \sim 100+$) is compute-bound while a vector add ($AI = 0.25$) is firmly memory-bound.

The roofline itself is built from two ceilings and often several sub-roofs. The sloped memory roof is a line of slope $B_{\max}$ that caps bandwidth-limited kernels; the flat compute roof is the horizontal line at $P_{\max}$ that caps everything else. Additional ceilings for L1/L2 cache bandwidth, special-function throughput, or limited instruction-level parallelism draw lower sub-roofs, and a kernel can be pinned under any one of them. Real kernels typically reach only 50-80% of the relevant ceiling, because instruction overhead, pipeline stalls, and imperfect vectorization leave a gap between attainable and theoretical performance.

Where a kernel lands on the plot dictates the optimization. For a memory-bound kernel ($AI <$ ridge point), the levers all reduce data movement: cache blocking and tiling, data compression, lower precision such as FP32 to FP16, and eliminating redundant loads. For a compute-bound kernel ($AI >$ ridge point), the levers raise throughput instead: SIMD and tensor-core vectorization, fewer instructions, and more instruction-level parallelism. A deeper win is to raise $AI$ itself: tiling a matrix multiply so cached data is reused many times before eviction shifts the kernel rightward across the ridge point, converting a memory-bound problem into a compute-bound one. Profilers such as NVIDIA Nsight Compute and Intel Advisor plot each kernel directly against the roofline, showing at a glance how far it sits from its ceiling and which lever would move it most.

Read the roofline through an *arithmetic-intensity* lens rather than a *peak-FLOPS* lens: the headline TFLOPS rating is only reachable to the right of the ridge point, so the first question for any kernel is not how fast the chip can compute but how many operations it performs per byte it is forced to move.