liveBook · Manning

Ops/byte ratio

As explained in Domain-Specific Small Language Models

The number of floating-point operations available per byte of memory accessed on a given device.

Ops/byte ratio measures floating-point operations performed for each byte transferred from memory. Comparing this ratio with a GPU’s threshold indicates whether inference is memory bound or compute bound. section 4.3.1

Use the ratio to connect hardware characteristics with model behavior:

  • A T4 provides 65 TFLOPS and 300 GB/sec bandwidth, producing a threshold of 216.6 ops/byte. section 4.3.1
  • Below 216.6 ops/byte, memory movement limits performance; above it, available compute limits performance. section 4.3.1
  • Compare this hardware threshold with arithmetic intensity, computed as operations divided by bytes accessed, then inspect demanding layers such as attention. section 4.3.1

Attention arithmetic intensity

For a cached attention computation, explicit memory-movement and compute counts yield 71,303,168 bytes, 2,160,066,560 operations, and 30.29 ops/byte.

How Domain-Specific Small Language Models covers it

How deep it goes
Defines the ratio, calculates a T4 threshold, and connects it to arithmetic intensity without developing broader model-layer optimization.
Examples
Uses NVIDIA Tesla T4 specifications and a worked attention calculation producing 30.29 ops/byte.
What it assumes
Assumes familiarity with GPU compute throughput, memory capacity, memory bandwidth, and floating-point operations.
What you can do after
Diagnose inference bottlenecks by comparing model arithmetic intensity with the ops/byte threshold of available hardware.
How it connects
Connects GPU inference with memory bandwidth, compute throughput, arithmetic intensity, attention layers, and Transformer inference.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Domain-Specific Small Language Models. The section links point to the parts of the book it draws on.