The Maths You Actually NeedLesson 62 of 76

Module 7 · Counting the cost: complexity and the arithmetic of scale

Why a GPU idles: memory-bound versus compute-bound

In this lesson

  • 10 min read
  • 8 reading sections
  • Knowledge check
  • Lesson 5 of 9 in this chapter

This chapter’s goalCount the FLOPs of a forward pass and a training run from a parameter count, compute the memory a model needs at each precision and in training, say from arithmetic intensity whether a workload is bound by compute or by memory bandwidth, recognise a quadratic cost in a pipeline and name the sub-quadratic replacement, and estimate the time or cost of an ML job to within a factor of three before running it.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available
The roof: what a chip achieves against what the work asks of it02505001600Arithmetic intensity, FLOPs per byte movedAchieved throughput, trillions of FLOPs a second—— 2 TB a second of bandwidth, then a 312 TFLOP ceilingGenerating one token at a time sits at intensity 1, at the far left: the arithmetic units idle and thespeed is 14 GB divided by 2 TB a second, about seven milliseconds a token. Batching 256 sequencesmoves the same work past the ridge, where a FLOP count finally predicts the time.
Generating one token at a time sits at intensity 1, at the far left: the arithmetic units idle and the speed is 14 GB divided by 2 TB a second, about seven milliseconds a token. Batching 256 sequences moves the same work past the ridge, where a FLOP count finally predicts the time.

Figure

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 9Free · no account needed
Lesson steps

Two ceilings, not one

A chip can only do so many floating-point operations per second: its compute ceiling. It can also only move so many bytes per second between memory and the units that do the arithmetic: its bandwidth ceiling. Every computation needs both, and it runs at the speed of whichever ceiling it hits first. FLOP counts, from three lessons ago, see only the first. Most of the surprises in ML performance come from the second.

The numbers for an A100-class GPU:

Text
compute:    312 × 10^12 FLOP/s (half precision)
bandwidth:    2 × 10^12 bytes/s

For a laptop CPU, roughly 10^11 FLOP/s and 5 × 10^10 bytes/s.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Stuck on something?Ask Funke, your AI tutor

How to cite: Addaly (2026) ‘Why a GPU idles: memory-bound versus compute-bound’, in The Maths You Actually Need. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/maths-you-need/arithmetic-intensity-and-the-roofline (Accessed: 29 November 2026).