Home Knowledge Base Roofline Model Analysis

Roofline Model Analysis is the visual performance modeling framework that plots achievable performance (FLOP/s) against arithmetic intensity (FLOP/byte) to determine whether a computation is memory-bound or compute-bound — providing immediate insight into the performance bottleneck and the maximum achievable speedup, making it the most practical first-step analysis tool for understanding and optimizing the performance of any computational kernel on any hardware.

Roofline Construction

Roofline for NVIDIA A100

Peak FP32: 19.5 TFLOPS
HBM Bandwidth: 2.0 TB/s
Ridge Point: 19,500 / 2,000 = 9.75 FLOP/byte

  TFLOP/s
    19.5 |__________________________ (compute ceiling)
         |                  /
         |                /
         |              /    ← memory ceiling (slope = 2 TB/s)
         |            /
         |          /
         |        /
         |      /
         |    /
         |  /
         |/__________________________ AI (FLOP/byte)
                9.75
              (ridge point)

Computing Arithmetic Intensity

KernelFLOPs/elementBytes/elementAIBound
Vector add (a+b→c)112 (3×4B)0.08Memory
Dot product2N8N+4~0.25Memory
Dense GEMM (NxN)2N³3×4N²N/6Compute (for large N)
1D stencil (3-point)24 (with reuse)0.5Memory
SpMV (sparse)2×NNZ12×NNZ0.17Memory

Roofline Extensions

CeilingDescription
L1 bandwidth ceilingPerformance bound by L1 cache bandwidth
L2 bandwidth ceilingPerformance bound by L2 cache bandwidth
SIMD ceilingPenalty for non-vectorized code
FMA ceilingPenalty for not using fused multiply-add
Tensor Core ceilingPeak when using tensor cores (mixed precision)

Using Roofline for Optimization

1. Profile kernel: Measure actual FLOP/s and bytes transferred. 2. Plot on roofline: Where does the kernel sit relative to ceilings? 3. If below memory ceiling: Memory access inefficiency → fix coalescing, add caching. 4. If at memory ceiling: Memory-bound → increase AI (algorithm change, tiling, reuse). 5. If at compute ceiling: Compute-bound → use wider SIMD, tensor cores, better algorithm.

Tools

The roofline model is the most effective framework for understanding computational performance — by instantly revealing whether a kernel is memory-bound or compute-bound and quantifying the gap to peak performance, it guides optimization effort toward the actual bottleneck rather than wasting time on non-limiting factors.

roofline model analysisroofline performancecompute bound memory boundroofline gpuperformance modeling

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.