Computing Library › HPC & Compute
HPC & Compute

The Roofline Model

The roofline model plots achievable performance against arithmetic intensity to show whether a kernel is limited by compute or by memory bandwidth.

A performance ceiling

The roofline model is a visual bound on performance. The horizontal axis is arithmetic intensity (operations per byte moved from memory); the vertical axis is performance (operations per second), usually on log-log scales. The ceiling is two straight lines: a sloped line set by memory bandwidth (performance = intensity times bandwidth) and a flat line set by the peak compute rate. Any kernel sits under the lower of the two.

Reading the plot

Where the sloped bandwidth line meets the flat compute line is the ridge point. Kernels with intensity to the left of the ridge are memory-bound: they cannot reach peak compute because the memory system cannot feed the units fast enough. Kernels to the right are compute-bound: memory keeps up and the arithmetic units are the limit. The model instantly answers the first tuning question, which resource is the wall.

What to do with it

If a kernel is memory-bound, adding faster arithmetic or more cores will not help; the fix is to raise arithmetic intensity (reuse data more, fuse operations, improve cache and shared-memory use) or reduce bytes moved (compress, change layout, use lower precision). If it is compute-bound, the fix is faster math (vectorization, tensor cores, better instruction mix). The roofline stops teams from optimizing the wrong resource.

In practice

Most stencil and sparse-matrix kernels, common in Hyperion field solvers, are memory-bound and sit on the sloped roof. Recognizing that early directs effort toward data reuse and layout rather than toward arithmetic tricks that cannot move a bandwidth-limited kernel.