Topic 3
Hardware speed-ups depend on the workload
"The GPU is twice as fast" is never true in general. It is true for one phase, one prompt length and one batch size, measured in one run.
Loading measurements…
Read down the last column. Each ratio divides a CPU time by the Apple GPU time from the same run, so both sides share that run's conditions:
- Prefill (the first token): lesson 1 found the GPU 1.6× faster at 16 tokens and 2.3× at 960. Lesson 2 found 2.4× at 16 and 2.3× at 960. The runs disagree on short prompts, because the CPU's 16-token time differed between them (12.8 vs 21.3 ms): the run-to-run problem from the previous page, now inside a ratio.
- Decode at batch 1: about 1.4× in both runs, well below the prefill ratio. That fits lesson 2: decode is limited by memory bandwidth, and the two measured copy ceilings (122.3 and 129.6 GB/s) were close.
- Decode at larger batches: 1.8× at batch 64. At batch 128 the GPU was slower, 0.25×, in a single run we did not repeat or investigate.
AI Engineering (Ch. 9, "AI Accelerators", sidebar "Selecting Accelerators") puts the choice as three questions: can the hardware run your workload, how long does it take, and what does it cost. Compute-bound work favours more FLOP/s; memory-bound work favours more bandwidth and memory. Answering needs your own workload's mix of prefill and decode.
Quick check