L1 Beginner · Module 2: Why GPUs: hardware first principles

2.1Why CPUs can't have 10,000 cores

A CPU core is a marvel built to make one thread fast, and that is exactly why you cannot fit ten thousand of them on a chip. GPUs make the opposite bet, and the bet only pays off when there is enough parallel work to feed it.

~15 min

By the end you will be able to

  • ✓Explain where a CPU core's transistors and power go, and why
  • ✓Distinguish latency-optimized from throughput-optimized design
  • ✓Explain why clock speeds stopped rising and what that did to chip design
  • ✓Say what a GPU gives up to fit tens of thousands of lanes on one chip

An H100 has 16,896 FP32 lanes. A top server CPU has about 96 to 192 cores. Both are made on similar processes with tens of billions of transistors. So why doesn’t someone just put 10,000 CPU cores on a chip?

Where a CPU core’s transistors go

A modern CPU core runs a single thread as fast as it possibly can. Very little of its area does arithmetic. Most of it exists to keep that one instruction stream from ever waiting:

  • Out-of-order execution. Hundreds of instructions in flight, reordered on the fly so independent ones run while others wait.
  • Branch prediction. Guess which way each if goes, long before the condition is known, and speculatively run ahead.
  • Large caches. Megabytes of L1, L2 and L3 per core, so that most loads return in a few nanoseconds instead of ~100 ns from DRAM.
  • Wide decode and rename logic, prefetchers, store buffers, and the bookkeeping to undo every wrong guess.

All of that machinery attacks one problem: latency. It makes a single chain of dependent instructions finish sooner.

The power wall

Until the mid-2000s, each process shrink made transistors faster and lower-power at the same time (Dennard scaling), so clocks kept rising. Then leakage current stopped voltage from falling with size, and since dynamic power grows roughly as

P∝C V2f,P \propto C\,V^2 f,

raising ff meant raising VV, and power went up much faster than speed. Clocks have sat around 3–5 GHz ever since. More transistors kept arriving, but they could no longer be spent on making one thread faster. The only way to use them was more parallel units, each simpler and slower than a CPU core, running at a power level the chip can cool.

The GPU’s bet

A GPU spends its transistors the other way round:

CPU coreGPU streaming multiprocessor (SM)
Goalfinish one thread soonfinish many threads per second
Hides memory latency withbig caches, speculation, reorderingswitching between thousands of waiting threads
Arithmetic per unita few wide SIMD units128 FP32 lanes + 4 tensor cores
Instruction controlper threadshared by 32 threads (a warp, 2.4)
Count on chip~100132 SMs on an H100

The GPU drops speculation and most of the cache, and shares one instruction decoder across 32 lanes. In exchange it fits far more arithmetic per square millimetre and per watt. An H100 reaches about 67 TFLOP/s in plain FP32 and 989 TFLOP/s in BF16 on its tensor cores. A large server CPU manages a few TFLOP/s.

Why this matters for inference

An LLM forward pass is almost entirely matrix multiplication: billions of independent multiply-adds per token (1.2). That is exactly the work a throughput machine is built for. But generation also has a strictly sequential outer loop (1.4), and each step has to fetch every weight from memory. The GPU’s huge arithmetic rate only helps if the data arrives fast enough, which is the subject of 2.3 and 2.6.

Sources

repo · BGEBEFORE-GPU-ENGINEERINGBEFORE-GPU-ENGINEERINGPhase 1: why CPUs are built for latency, the power wall, and why that leads to GPUs.
book · FREGLYAI Systems Performance EngineeringChris FreglyGPU architecture chapters: SMs, CUDA cores and tensor cores compared with CPU cores.

Check your understanding

0 / 4 answered
  1. 1.What does most of a modern CPU core's area exist to do?

  2. 2.Why did clock speeds stop rising in the mid-2000s?

  3. 3.How does a GPU hide memory latency instead of relying on big caches and speculation?

  4. 4.When does a GPU lose to a CPU?