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.
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.