Log inStart free
LESSON 32.08 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

FLOPs and bytes per token

Count one step's FLOPs, bytes and link traffic, then predict its speed.


Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 32.08 · PERF BAY150 GFLOP PER TOKEN
01
Stage 1 of 6 · FLOPs per token
Each token does 2 FLOPs per weight: 139 GFLOP. Attention over 4,096 cached tokens adds 10.7 GFLOP.
Explain it simply

Every weight meets every token once, as one multiply and one add. So a 70 billion weight model costs about 140 billion FLOPs per token. Attention adds a smaller part, 10.7 GFLOP, for reading back the earlier tokens. That count barely changes with the batch.

A bar of 150 GFLOP per token: matmuls 139 GFLOP, attention 10.7 GFLOP.

FLOPs, computeweights, roofsKV cache, HBMlink, kernel gapsridge point
FLOPs per token150 GFLOP2 FLOPs × 69.5 billion weights + attention 10.7 GFLOPattention reads 4,096 cached tokens per new tokenFLOPs per token150 GFLOP2 FLOPs × 69.5 billion weights + attention 10.7 GFLOPattention reads 4,096 cached tokens per new token
Toy: Llama 3 70B shape on 8 H100s, 4K context · efficiencies and gaps are typical
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
Ftok≈2 P+4 L h dh c\sy{F}{out}{F_{tok}} \approx 2\,\sy{P}{param}{P} + 4\,L\,h\,d_h\,\sy{c}{data}{c}
Ftok≈139+10.7≈150 GFLOPF_{tok} \approx 139 + 10.7 \approx 150\text{ GFLOP}

About 2 FLOPs per weight, plus attention over c tokens.

Common mix-ups

MYTHA big enough batch makes decode compute-bound.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01Raise the batch from 64 to 256 requests. Do the bytes per token go up or down?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.