6.2.1 · D3GPU Architecture

Worked examples — GPU vs CPU design philosophy

3,965 words18 min readBack to topic

This page is the drill ground for GPU vs CPU design philosophy. The parent note taught you why CPUs chase latency (finish one task fast) and GPUs chase throughput (finish the most tasks per second). Here we hammer that idea against every kind of workload you could meet — the ones where the GPU wins by a mile, the ones where it loses, and the tricky edge cases in between.

Before any numbers, let us lay out the full battlefield.

The scenario matrix

Think of each workload as landing in exactly one cell below. If you can classify a new problem into one of these cells, you already know who wins before doing arithmetic.

Cell Case class What makes it this class Winner (expected)
A Massively parallel, independent Millions of tasks, no task depends on another GPU (big)
B Strictly sequential Each step needs the previous step's result CPU
C Zero / degenerate size Almost no work () CPU (launch cost matters)
D Limiting case Task count grows without bound GPU (ratio → core ratio)
E Branch divergence Parallel but threads take different paths GPU, but degraded
F Memory-latency bound Lots of slow DRAM reads, little compute GPU (hides latency)
G Partly parallel (Amdahl) A serial fraction refuses to parallelize Capped — see 9.1.02-Amdahls-law
H Real-world word problem A described situation, you must classify it Decide from the story
I Exam twist Looks like one cell, is secretly another Read carefully!

Below, every symbol is the one from the parent's two performance models. Let us re-anchor them so this page stands alone.

Recall The two formulas we will keep using

CPU (latency model): — time for one thread, = number of instructions, = instructions finished per clock tick, = ticks per second. GPU (throughput model): — total time for all tasks spread across cores, = fraction of cores busy, = cycles per instruction (a GPU core needs more clock ticks per instruction than a CPU core — this is why we multiply by it after dividing by ).

Now the examples. Guess the winner before you read the steps.


Read the figure: the left panel shows the CPU's magenta tiles, each stamped "625k" — a few cores swallowing huge slices. The right panel is a dense violet grid of tiny cores, each with a sliver of work. The orange caption "" is exactly step 5: count the tiles on each side, take the ratio.

Figure — GPU vs CPU design philosophy



Read the figure: the magenta curve is the actual speedup as grows along a log axis — it starts below the dotted "break-even" line (CPU winning, the small- region of step 2), crosses it at the orange dot near , then climbs and flattens toward the violet dashed "" ceiling from step 4. The flattening is the limit made visible.

Figure — GPU vs CPU design philosophy



Read the figure: three curves (magenta , violet , orange ) all climb as processors increase but each flattens onto its own dashed ceiling = , , . The smaller the serial slice, the higher the ceiling — but every curve stops rising. That plateau is step 3 made visible.

Figure — GPU vs CPU design philosophy



Recall Rapid self-test (cover the answers)

Independence is the permission to use many cores ::: Without it you're stuck on one core (cell B). The GPU wins big at large but its speedup ceiling is ::: the core ratio (Ex. 1: ; Ex. 4 with slower cores: ). A tiny job runs faster on the ::: CPU, because GPU launch overhead () dwarfs the work (cell C). Warp divergence with 2 equal paths costs ::: (paths serialize; general: paths × path-length). With serial code the max speedup ever is ::: by Amdahl (), no matter how many cores. The GPU beats the CPU on memory-bound blur by ::: hiding the latency behind other warps (latency ÷ overlapping cores = effective cost). Occupancy enters the model by shrinking cores to ::: (Ex. 7); pure penalty , e.g. . A word problem is solved by asking ::: "independent AND many?" — payroll → CPU, 2M particles → GPU (Ex. 8). Prefix sum looks parallel but is secretly ::: a dependency chain (cell I); a parallel scan cuts it to stages.


Next: revisit the parent GPU vs CPU design philosophy and the 6.2.01 GPU vs CPU design philosophy (Hinglish) version, then dig into 6.3.01-SIMD-vs-SIMT for the divergence machinery behind Example 5.