core26 min studyLesson 119 in Engineering

Roofline bounds and the traffic boundary

Use operational intensity to reason about compute and bandwidth ceilings while separating an upper bound from a throughput prediction.

On this page

What you’ll understand

  • Calculate operational intensity at a named memory boundary.
  • Identify a model's bandwidth and compute regions with consistent units.
  • Explain why measured performance can sit far below either ceiling.

A kernel can be limited by the rate of arithmetic, the rate of data movement, or mechanisms that neither simple ceiling captures. The Roofline model connects two resource budgets through operational intensity: useful floating-point work divided by bytes transferred at a specified memory boundary. Its value is explanatory. It asks which ceiling constrains a simplified workload and what a proposed optimization changes, without promising that a real processor will attain the resulting number.

Name the bytes before dividing

Operational intensity is not an intrinsic constant of an algorithm name. Count floating-point operations under an explicit convention and count bytes crossing the selected boundary, such as between a last-level cache and main memory. Reuse can make main-memory traffic much smaller than the total volume of load instructions. Write allocation, writebacks, packing, and temporary arrays can increase traffic beyond a minimal source-level estimate. Different boundaries can therefore give different intensities for the same execution.

The numerator needs equal care. A multiply followed by an add is commonly counted as two floating-point operations, including when one fused multiply-add instruction performs both. An integer instruction, a vector instruction, and a floating-point operation are not interchangeable counts. State precision, vector utilization, and the mathematical work being retained. Removing unnecessary operations can lower a reported FLOP rate while improving job time, so useful completion remains the actual outcome to optimize.

I=FD,Proof(I)=min⁡(Pmax⁡,BI)I=\frac{F}{D},\qquad P_{\rm roof}(I)=\min(P_{\max},B I)
F is counted FLOP and D is transferred bytes at one declared boundary; I is FLOP/byte. With B in decimal GB/s and Pmax in GFLOP/s, BI is GFLOP/s. The expression is an ideal ceiling under those supplied resource limits, not a measured throughput prediction.↔ Scroll wide equations horizontally.

The ridge separates two model regimes

At low intensity, the bandwidth slope is lower than the compute ceiling. Increasing reuse can move a kernel rightward and raise this model ceiling without changing available bandwidth. Above the ridge, the compute ceiling is lower, so further reuse alone cannot raise the simplest Roofline limit. Optimizations can also change actual work, achievable vector throughput, or the relevant traffic boundary. Identify those changes explicitly instead of moving a point on a graph without explaining the accounting.

Actual performance may remain far below the roof because of dependency latency, branch behavior, poor vector utilization, synchronization, small problem size, or insufficient outstanding memory requests. A bandwidth number measured by a wide streaming benchmark may not be attainable by an irregular pointer chase. Empirical ceilings characterize their benchmark conditions rather than prove a strict bound for all possible programs. Use compatible precision, thread count, placement, and traffic conventions when comparing a kernel with a reference ceiling.

Iridge=Pmax⁡B,t≥max⁡(FPmax⁡,DB)I_{\rm ridge}=\frac{P_{\max}}{B},\qquad t\geq\max\left(\frac{F}{P_{\max}},\frac{D}{B}\right)
Ridge intensity is FLOP/byte. With consistent base units, each time term is seconds. The lower time bound assumes F and D are unavoidable work and traffic and that Pmax and B truly bound the selected resources; extra overhead can only increase elapsed time.↔ Scroll wide equations horizontally.

Reuse is a hypothesis with costs

Blocking or fusion can retain intermediate values and reduce traffic across a chosen boundary, but larger live working sets may spill elsewhere. Fusion can reduce parallel scheduling opportunities or complicate numerical behavior. Compare the measured transferred bytes, useful result, and elapsed time after the change. If the measured point appears above a supposed roof, first check units, operation conventions, traffic estimation, and whether the chosen empirical ceiling actually applies before declaring a physical contradiction.

Test the calculation in the Roofline lab, whose hypothetical compute ceiling stays fixed at 1,000 GFLOP/s. Reset, set intensity I=4 FLOP/byte and bandwidth B=80 decimal GB/s, and predict the 320 GFLOP/s ceiling and 12.5 FLOP/byte ridge before reading them. For a separate comparison, Reset and re-set both controls to I=16 and B=80: the bandwidth roof becomes 1,280 GFLOP/s, so the compute ceiling limits the displayed bound to 1,000. Play or Step traces the roof without changing the selected kernel parameters or its readouts. The two settings match the worked example's traffic assumptions, but the instrument neither measures those bytes nor guarantees any achieved throughput. Explain which traffic-reduction and utilization measurements a real transformation would still need.

An ideal ceiling is not an achieved result

A hypothetical machine has a valid selected compute limit of 1,000 GFLOP/s and memory-bandwidth limit of 80 decimal GB/s. A kernel performs 400 GFLOP while transferring 100 GB across that memory boundary.

  1. Compute intensity: 400 GFLOP/100 GB=4 FLOP/byte. The model bandwidth roof is 80×4=320 GFLOP/s, below the 1,000 GFLOP/s compute ceiling.

  2. Compute the ridge: 1,000/80=12.5 FLOP/byte. The time lower bound is max(400/1,000,100/80)=max(0.4,1.25)=1.25 seconds.

  3. Suppose a correct reuse transformation reduces traffic to 25 GB without changing 400 GFLOP. Intensity becomes 16 FLOP/byte and the ideal ceiling becomes 1,000 GFLOP/s, giving a 0.4-second bound. Neither bound establishes an actual runtime or guarantees the full improvement.

The result

Reduced traffic changes the active ideal limit from bandwidth to compute in this example. Benchmark the transformed execution to discover its remaining constraints.

Explore the model

Interactive lab

Interactive lab · roofline

Predict the active Roofline ceiling

Reset and set I=4 FLOP/byte, B=80 GB/s: predict a 320 GFLOP/s ceiling and 12.5 FLOP/byte ridge. Reset again and re-set I=16, B=80: predict the fixed 1,000 GFLOP/s compute ceiling. Play or Step traces the roof; it does not change kernel parameters or promise measured attainment.

Predict the active Roofline ceilingSynthetic roofline ceiling min(1000, B·I), in GFLOP/s, with B in decimal GB/s and I in FLOP/byte. Playback traces the roof without changing the selected kernel. This upper-bound model is not a measured throughput prediction, hardware comparison or price model. Current readings: Attainable ceiling: 640 GFLOP/s; Ridge intensity: 12.5 FLOP/byte; Ceiling regime: Memory-bound ceiling. All parameters are adjustable with the labeled controls below.Hypothetical roofline upper bound: 640 GFLOP per second at operational intensity 8 FLOP per byte and bandwidth 80 gigabytes per second.0.1110641101001000Operational intensity · FLOP/byte · log scaleCeiling · GFLOP/s · log scalePeak: 1000
Attainable ceiling / kernelBandwidth roof / traceCompute ceiling
Attainable ceiling
640 GFLOP/s
Ridge intensity
12.5 FLOP/byte
Ceiling regime
Memory-bound ceiling
t = 0 s

Synthetic roofline ceiling min(1000, B·I), in GFLOP/s, with B in decimal GB/s and I in FLOP/byte. Playback traces the roof without changing the selected kernel. This upper-bound model is not a measured throughput prediction, hardware comparison or price model. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forThe smaller of the synthetic bandwidth and compute roofs sets the model ceiling; actual throughput may remain lower.

Check your understanding

A kernel has intensity 2 FLOP/byte, bandwidth limit 100 GB/s, and compute limit 800 GFLOP/s. Which statement follows from the ideal model?

Try it yourself

For the same 800 GFLOP/s and 100 GB/s model, find the ridge intensity. A correct transformation raises intensity from two to five FLOP/byte without changing useful work. What happens to the ideal ceiling, and what remains unproven?

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Divide compute by bandwidth, then evaluate the smaller resource limit twice.

Compare with the solution

The ridge is 800/100=8 FLOP/byte. The ideal ceiling rises from 200 to 500 GFLOP/s, still in the bandwidth region. This is a 2.5-fold ceiling increase, not proof of a 2.5-fold speedup. The transformation may add instructions, reduce parallelism, or fail to achieve the selected bandwidth; measure actual elapsed time and traffic.

Take it with you

  • Operational intensity depends on counted work and a named traffic boundary.
  • Roofline supplies resource ceilings rather than guaranteed throughput.
  • Reuse helps only when its traffic savings survive the costs of the transformation.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.