Arithmetic intensity measures compute work per byte moved to and from memory. It helps identify whether a model layer is memory bound or compute bound on a given GPU. section 4.3.1 section 4.4
It is used as a hardware-agnostic way to compare an algorithm’s demand against memory traffic, then decide where optimization should focus. In Transformer inference, attention layers are highlighted because they are computationally intensive. section 4.3.1
A practical reading of the metric follows this sequence:
- Compute arithmetic intensity as total compute divided by total memory movement. section 4.3.1
- Compare the result with the hardware’s ops-per-byte capacity to classify the bottleneck. section 4.3.1
- Use the bottleneck diagnosis to target either memory traffic or compute utilization. section 4.3.1
Transformer inference with KV cache
Sampling is split into prefill and autoregressive phases. KV caching stores attention state so later tokens avoid recomputing prior attention, and tests show a large speedup when caching is enabled. A worked attention example computes total memory movement, total compute, and an arithmetic intensity of 30.29 ops/byte. section 4.3.1 section 4.4
