What is Arithmetic intensity?

Operations performed divided by bytes moved to and from memory. High values tend toward compute-bound, low values toward memory-bound.

Field: AI Hardware & Software Stack

Japanese name: 演算強度

Roofline model 0.1 1 10 100 1000 Arithmetic intensity (FLOP/byte, log scale) Performance (FLOP/s, log scale) Ridge point Peak compute Slope = memory BW ← Memory-bound Compute-bound → e.g. matrix × vector e.g. large matrix multiply Ridge = peak ÷ bandwidth
Roofline model · View in diagrams

How to calculate it

Arithmetic intensity is operations performed divided by bytes moved between memory and the processor, usually counted as FLOP per byte of DRAM traffic. For the product of two N × N FP16 matrices, read once and written once, the work is 2N32N^3 operations and the traffic is 3N23N^2 elements or 6N26N^2 bytes, giving N/3, about 340 for N = 1024. A matrix-vector product reuses each weight only once, giving about 1 FLOP/byte in FP16, and element-wise operations such as ReLU fall below 1. Intensity depends on the algorithm, the data type and how well the implementation reuses data.

The roofline model

The roofline model, which sometimes uses the term operational intensity, plots attainable performance against arithmetic intensity. Performance is the smaller of peak compute and memory bandwidth times intensity, so the chart has a slanted bandwidth ceiling and a flat compute ceiling. They meet at the ridge point, peak divided by bandwidth. With 100 TFLOPS and 2 TB/s the ridge is at 50 FLOP/byte, so a workload at 10 FLOP/byte is memory-bound at 2 TB/s × 10 = 20 TFLOPS. Below the ridge, extra arithmetic units do not help; above it, memory bandwidth is no longer the limit.

How to raise it

When a workload sits under the slanted roof, the fix is to do more work per byte or move fewer bytes. Blocking (tiling) keeps sub-matrices in caches or on-chip memory so each value fetched from DRAM is used many times. Operator fusion applies element-wise steps such as activations or normalization while data is still on chip, instead of writing it out and reading it back. Batching lets one read of the weights serve several inputs. Lower-precision data types cut the bytes per value, which raises operations per byte for the same computation.

Where you will meet it

Arithmetic intensity explains much of AI accelerator behavior. Large matrix multiplications are compute-bound and can approach peak throughput, while element-wise layers can take a noticeable share of runtime despite few operations. Inference at batch size 1 is a matrix-vector workload with intensity near 1, so it is limited by how fast weights stream from memory, which is why batching and weight quantization help. Compare it with the hardware's ridge point: the intensity belongs to the workload, the ridge point to the machine, and their ratio tells you which resource to optimize.

Try it: questions about Arithmetic intensity

Which model plots whether a program's performance is limited by compute throughput or memory bandwidth, using arithmetic intensity (operations per byte) on the horizontal axis?

  1. AAmdahl's law
  2. BThe roofline model
  3. CThe Poisson model
Show answer and explanation

Answer: B. The roofline model

The roofline model plots performance against arithmetic intensity (operations per byte transferred to or from memory). Low-intensity workloads hit a slanted ceiling set by memory bandwidth; high-intensity workloads hit a flat ceiling at peak compute. With 1 TB/s of bandwidth and 100 TFLOPS of compute, for example, anything below 100 FLOP/byte is memory-bound. The model guides whether to improve data reuse or compute efficiency.

For the product of two N × N FP16 (2-byte) matrices, assuming each input is read once and the result written once, roughly what is the arithmetic intensity (operations per byte)?

  1. A1/3
  2. BN/3
  3. C3N
Show answer and explanation

Answer: B. N/3

The operation count is 2N³, and memory traffic is 3N² elements for the three matrices, or 6N² bytes in FP16. Arithmetic intensity is2N36N2=N32N³ ÷ 6N² = N/3, about 340 for N = 1024. The larger a matrix product, the more computation per byte, so it easily exploits arithmetic performance. By contrast, element-wise addition has intensity below 1 and is limited by memory bandwidth.

FAQ

How do you calculate arithmetic intensity?

Divide the number of operations (usually FLOPs) by the bytes transferred to and from memory. For an N × N FP16 matrix multiply this is2N36N2=N32N^3 / 6N^2 = N/3.

What is the ridge point in a roofline model?

It is peak compute divided by memory bandwidth, the arithmetic intensity at which a workload switches from memory-bound to compute-bound. For 100 TFLOPS and 2 TB/s it is 50 FLOP/byte.

Why is batch-size-1 inference memory-bound?

Each weight is read from memory and used for just one multiply-add, so arithmetic intensity is about 1 FLOP/byte in FP16, far below the ridge point of typical accelerators.

Questions that mention Arithmetic intensity (5)

Arithmetic intensity appears in 7 practice questions across 3 topics, including AI Hardware & Software Stack, CPUs and architecture, Performance Analysis.

  1. On an accelerator with 100 TFLOPS peak and 2 TB/s memory bandwidth, a workload with arithmetic intensity 10 FLOP/byte runs. What performance does the Roofline model predict?
  2. Why does a fully connected layer (a weight-matrix-by-vector product) tend to be memory-bound with a single input (batch size 1)?
  3. Why does increasing the batch size (the number of inputs processed together) tend to improve inference efficiency?
  4. Why do operations with little computation per element, such as ReLU or layer normalization, tend to take a lot of time relative to their operation count in AI workloads?
  5. When the Roofline model shows a workload in the memory-bandwidth-limited region, which direction improves performance?

Books on AI Hardware & Software Stack Ad

As an Amazon Associate I earn from qualifying purchases.

This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.

Back to the glossary