Comparing Architecture Families Fairly › Hardware Efficiency: The Roofline View
Language AI HandbookAll chapters Arithmetic intensity is FLOPs performed per byte moved. It helps identify which idealized hardware ceiling is tighter.
Every accelerator has a ridge point: the intensity at which it stops being bandwidth-bound and becomes compute-bound. That ridge point is
where:
- : the arithmetic intensity at which an accelerator stops being bandwidth-bound and becomes compute-bound, in FLOP/byte
- peak FLOP/s: the accelerator's peak floating-point throughput
- peak bytes/s: the accelerator's peak memory bandwidth
For the NVIDIA H100 SXM, using the dense BF16 rate of about FLOP/s and the listed bandwidth of bytes/s puts the ideal ridge near 295 FLOP/byte. In a weight-streaming approximation, a 7B BF16 model performs about 14 billion multiply-add FLOPs and reads about 14 GB of weights for one token. This weight-only estimate is about 1 FLOP/byte. Actual decode also moves persistent state and other tensors, and feasible batching can amortize weight reads.
Per-sequence resident memory limits the batch that fits on a device. Memory traffic per step affects latency and throughput. In an illustrative 50 GB state budget, a 100 MB state fits 500 sequences and a 20 GB state fits two before any other per-sequence overhead.
The roofline model is an upper bound. Arithmetic intensity helps identify which ceiling is tighter under its assumptions. Measure time separately to see how closely a kernel approaches that ceiling.
The diagonal gives the bandwidth ceiling and the plateau gives the compute ceiling. They meet at the ridge. The lower of the two sets the ideal performance bound.
PythonIn [7]Expand
import numpy as np
roofline_intensity = np.logspace(-1.0, 4.0, 300)
peak_tflops = 9.89e14 / 1e12
ridge_intensity = 9.89e14 / 3.35e12
bandwidth_tflops = roofline_intensity * 3.35e12 / 1e12
roofline_throughput = np.minimum(peak_tflops, bandwidth_tflops)VisualizationOut [8]Expand

When you report a throughput comparison, report it at a stated batch, a stated context, and a stated roofline position. Otherwise the reader cannot tell whether they are looking at an architecture property or a memory-bandwidth ceiling.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!