Skip to content
Omnikalc

Roofline model calculator: attainable performance from peak FLOPS, bandwidth and arithmetic intensity

Enter the peak performance, the memory bandwidth and the arithmetic intensity of a kernel to see if it is compute-bound or memory-bound, and get the attainable performance and the run time.

Updated on
Your inputs
GFLOPS

Value out of range

GB/s

Value out of range

Value out of range

GFLOP

Value out of range

Results

Attainable performance

500.0 GFLOPS

Ridge point of the machine
5.00 FLOP/B
Share of the peak reached
50.0 %
Memory-bound: raise the arithmetic intensity or the bandwidth
Run time of the kernel
200.0 ms

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.

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.

Frequently asked questions

What is the roofline model?

Introduced by Williams, Waterman and Patterson in 2009, the roofline model plots the performance of a kernel against its arithmetic intensity. The roof has two parts: a sloped line at low intensity, where the memory bandwidth limits the speed (performance = bandwidth × intensity), and a flat line at high intensity, where the peak of the processor limits it. The corner between them is the ridge point.

What is arithmetic intensity?

It is the ratio of the floating-point operations to the bytes moved between the processor and the main memory. Adding two vectors has an intensity of 1/12 FLOP/byte in double precision and is deeply memory-bound. A large matrix multiplication has an intensity that grows with the size of the blocks, and can be compute-bound. Caching and blocking raise the intensity by reusing data.

How can I improve a memory-bound kernel?

Raise the arithmetic intensity: reuse data in the caches or registers, fuse loops so that data are read once, use lower precision (half the bytes per number), and compress the data. If the intensity cannot change, only a higher bandwidth (a faster memory, or a different device) will help. Do not spend time on vectorization or on more cores for a kernel that is memory-bound.

What are typical values of the ridge point?

A CPU server has a ridge near 5 to 15 FLOP/byte for double precision. A modern GPU has a higher peak and also a higher bandwidth, with a ridge near 10 to 30 FLOP/byte, and tensor cores in low precision raise it a lot more. Many scientific codes have an intensity under 1 and so are memory-bound, while dense linear algebra and neural network layers are often compute-bound.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.