v9.1.1
Menu

Chapter 1: Why GPUs? The Parallel Computing Mindset

Week 1

Understand why GPUs exist, how their design philosophy differs from CPUs, the difference between latency and throughput, the SIMT execution model, when parallel hardware actually helps, and the hard ceiling Amdahl's law puts on speedup.

Topics
5
Videos
5
Min read
17

Chapter Overview

Before you write a single line of Triton, you need to think like the hardware. GPUs are not 'fast CPUs' — they are a fundamentally different kind of processor built around one idea: do an enormous number of simple operations at the same time.

A modern CPU has a handful of powerful cores, each loaded with branch predictors, deep caches, and out-of-order execution machinery to make a single thread finish as fast as possible. A GPU spends that same silicon budget on thousands of simpler cores. It doesn't try to make any one operation fast — it tries to keep all of those cores busy so that the total amount of work per second is staggering.

This chapter builds the mental model that everything else depends on: the distinction between latency (how long one task takes) and throughput (how much work finishes per second), the SIMT execution model where threads move in lockstep groups called warps, the kinds of problems where this hardware shines, and Amdahl's law, which tells you that the serial part of your program — not the parallel part — ultimately limits your speedup.

This chapter covers:

  • CPUs vs GPUs: two different answers to 'how do we make computers fast?'
  • Latency vs Throughput: the single most important trade-off in this course
  • The SIMT Execution Model: warps, lockstep, and divergence
  • When GPUs Win (and Lose): matching the problem to the hardware
  • Amdahl's Law: the ceiling on every speedup you will ever measure

Chapter Roadmap

Click any topic to jump in

Explainer video
1
CPUs vs GPUs

Two design philosophies: few powerful cores (latency) vs thousands of simple cores (throughput).

Two Design Philosophies
How throughput hardware pays off
2
Latency vs Throughput

GPUs hide latency with massive parallelism instead of reducing it — occupancy keeps the ALUs fed.

Hiding Latency with Parallelism
How threads actually execute
3
SIMT Execution Model

Threads run in lockstep warps of 32; data-dependent branches cause divergence and serialize work.

Warps and Lockstep
Which problems fit the model
4
When GPUs Win (and Lose)

Data-parallel, high-arithmetic-intensity work wins; serial, branchy, or tiny work belongs on the CPU.

Data Parallelism and Arithmetic Intensity
The ceiling on any speedup
5
Amdahl's Law

The serial fraction caps speedup at 1/(1-p) — optimization means shrinking the serial part.

The Speedup Ceiling

Topics

5 topics in this chapter

Suppose you must apply the same arithmetic to fifty million numbers, and two chips sit on your desk. One finishes any single operation in a few nanoseconds but works on only a few dozen values at once; the other is slower per operation but keeps tens of thousands of operations in flight. Which one finishes first depends on the workload, not on which chip is "faster", and that question is the mindset this whole plan builds on. This first topic compares the two design philosophies. A CPU spends its transistor budget on making one instruction stream fast: deep caches, branch prediction and out-of-order execution. A GPU spends it on arithmetic lanes, memory bandwidth and the scheduling hardware that keeps them busy. We will measure what that means on a real machine, where a 50-million-element add runs about 13 times faster on an RTX 2060 than on an 8-core Ryzen, yet becomes almost 6 times slower once the PCIe copies are counted. The topics that follow explain why: latency versus throughput, the SIMT execution model, the shapes of problems GPUs win on, and Amdahl's ceiling on any speedup.

Definition

A CPU is a latency-optimized processor: a few powerful cores with large caches, branch prediction and out-of-order execution, built to finish one instruction stream quickly. A GPU is a throughput-optimized processor: many simple arithmetic lanes grouped into streaming multiprocessors, with little control logic per lane, built to maximize the total operations completed per second across many independent threads.

1 of 1
Two Design Philosophies

A CPU spends most of its transistors on control and cache: branch predictors, out-of-order schedulers and multi-megabyte caches that make one instruction stream run fast. It has a handful to around a hundred very capable cores, plus 8-wide AVX2 SIMD units.

A GPU spends most of its transistors on arithmetic: thousands of simple lanes grouped into Streaming Multiprocessors, with small caches shared by many threads. Each lane is simpler than a CPU core, but there are thousands, fed by far more bandwidth (336 GB/s on an RTX 2060 versus about 51 GB/s for dual-channel DDR4-3200). CPUs win on sequential, branchy work; GPUs win when one operation applies to massive data.

Mathematical Intuition

Peak arithmetic throughput is roughly Nlanes×fclock×FLOP/cycleN_{\text{lanes}} \times f_{\text{clock}} \times \text{FLOP/cycle}. An RTX 2060 has 1,920 FP32 lanes at a 1.68 GHz boost clock doing one fused multiply-add (2 FLOPs) per cycle: about 6.5 TFLOP/s. An 8-core Zen 3 CPU has two 8-wide FMA units per core, 32 FLOPs per cycle per core, so about 1 TFLOP/s near 4 GHz. Measured on a 4096 x 4096 float32 matmul, the CPU reached 0.84 TFLOP/s and the GPU 6.3 (7.5x); with FP16 tensor cores the GPU reached 28.8 TFLOP/s (34x). Lane count, not clock speed, dominates.

Example:

You add two float32 arrays of 50,000,000 elements, c[i] = a[i] + b[i]. With NumPy on an 8-core Ryzen 7 5800X the add takes 26.5 ms; on an RTX 2060 the kernel takes 2.0 ms. Why is the GPU faster, and why does the comparison flip if the arrays start in CPU memory?

Related Problems on PixelBank