A model expressing attainable performance as the smaller of peak compute and memory bandwidth × arithmetic intensity, used to tell compute-bound from memory-bound work.
The roofline model plots attainable performance (operations per second, usually FLOP/s) against arithmetic intensity (operations per byte moved to or from memory), normally on log-log axes. Two ceilings bound every workload: a sloped line equal to memory bandwidth times arithmetic intensity, and a flat line at peak compute. Attainable performance is the lower of the two. The corner where they meet, the ridge point, sits at peak compute divided by bandwidth. With 100 TFLOPS and 2 TB/s, the ridge is 50 FLOP/byte, so a kernel at 10 FLOP/byte is memory-bound at 20 TFLOPS.
Computing arithmetic intensity
Count the useful operations and divide by the bytes that actually cross the memory interface. Adding two arrays of 8-byte doubles into a third performs 1 FLOP while moving 24 bytes, about 0.04 FLOP/byte, so it is hopelessly memory-bound on typical CPUs and GPUs. Multiplying two n-by-n matrices performs about 2n³ FLOPs on roughly 3n² elements, so intensity grows with n, provided caches or tiling actually deliver that reuse. Because intensity depends on real traffic, the same algorithm can sit at different points depending on blocking, cache size and data type.
Reading the chart and acting on it
A kernel under the sloped roof will not speed up with more arithmetic units; it needs fewer bytes per operation. Blocking or tiling to reuse data in caches, fusing consecutive operations so intermediates never reach DRAM, and using lower-precision data all move the point right or up. A kernel near the flat roof needs better use of compute instead: vectorization, fused multiply-add, matrix units and enough parallelism. Extra lower ceilings are often drawn for missing optimizations, such as peak without SIMD, and separate rooflines can be drawn for each cache level.
Where the numbers come from and limits
The flat roof is usually the vendor's peak for the relevant data type; the slope is better taken from a measured bandwidth, such as the STREAM benchmark, than from the theoretical figure. The model is an upper bound, not a prediction: real kernels sit below the roof because of latency, imperfect overlap of memory and compute, synchronization and load imbalance. A familiar application is large language model inference at batch size one, where each weight is read for about two operations, giving intensity near 1 FLOP/byte at 16-bit precision and a firmly memory-bound result.
In the Roofline model, attainable performance is the smaller of the peak and bandwidth × arithmetic intensity. 2 TB/s × 10 FLOP/byte = 20 TFLOPS, below the 100 peak, so this workload is memory-bound with a 20 TFLOPS ceiling. Peak ÷ bandwidth = 50 FLOP/byte is the boundary (the ridge point); only workloads with intensity at or above it can reach peak performance.
BIt will naturally speed up over time without changes
CRaise arithmetic intensity, for example by increasing data reuse, or reduce memory traffic
Show answer and explanation
Answer: C. Raise arithmetic intensity, for example by increasing data reuse, or reduce memory traffic
In the Roofline chart, workloads under the slanted line are capped by memory bandwidth, and adding arithmetic units does not raise that cap. Reusing data through blocking or operator fusion increases operations per byte (arithmetic intensity), moving the workload rightward and raising its ceiling. Using lower-precision data to cut memory traffic has a similar effect.
FAQ
What is the ridge point in a roofline model?
It is the arithmetic intensity where the bandwidth slope meets the compute ceiling, equal to peak FLOP/s divided by memory bandwidth in bytes per second. Workloads below it are memory-bound, those above it can be compute-bound.
How do I measure arithmetic intensity for a kernel?
Divide the number of operations by the bytes actually transferred from DRAM, which you can estimate by hand or measure with hardware counters or a profiler. Use measured traffic when caches change the amount of data moved.
Why is my workload memory-bound even on a fast GPU?
Fast accelerators have very high ridge points, often tens to hundreds of FLOP per byte, so element-wise operations and small-batch matrix-vector work cannot reach peak. Fusing operations and increasing data reuse or batch size raise intensity.
Questions that mention Roofline model (2)
Roofline model appears in 4 practice questions across 3 topics, including Performance Analysis, AI Hardware & Software Stack, CPUs and architecture.
This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.