Is your code limited by the processor or by the memory? The roofline model answers with two numbers: the peak performance and the memory bandwidth. The roofline model calculator gives the attainable performance of a kernel from its arithmetic intensity, tells if it is compute-bound or memory-bound and estimates the run time.
How the calculation works
- Enter the peak compute performance (GFLOPS) and the memory bandwidth (GB/s) of the processor or the GPU. They are in the datasheet or in a benchmark.
- Enter the arithmetic intensity of your kernel: the number of floating-point operations per byte moved to or from main memory.
- The calculator applies the roofline model: performance = min(peak, bandwidth × intensity).
- The result is the attainable performance, the ridge point (peak / bandwidth), the share of peak and the run time for the work you enter.
Example
A GPU has a peak of 1000 GFLOPS and a bandwidth of 200 GB/s, so its ridge point is 5 FLOP/byte. A kernel with an intensity of 2.5 reaches min(1000, 200 × 2.5) = 500 GFLOPS, 50 % of the peak. It is memory-bound: 100 GFLOP of work take 200 ms, and doubling the intensity would reach the peak.
Why it matters
The calculator helps programmers, students and engineers in high-performance computing and machine learning to decide where to optimize, to compare machines with the same code and to understand why a faster processor does not speed up a memory-bound program.
Good to know
The simple roofline has one memory roof and one compute roof. Real machines have several roofs (caches, vector units, different precisions), and real kernels are limited by latency, by the instruction mix or by communication. The peak values in the datasheet are rarely reached, and a measured bandwidth (for example from the STREAM benchmark) is more reliable. The result is an upper bound of the performance.
Related tools
The CPU dynamic power calculator estimates the power drawn by a processor, the LLM VRAM calculator sizes the memory of a model, the Amdahl’s law calculator covers the speedup of parallel code, and the FPS frame time calculator converts frame rates to times.