CPU vs GPU vs TPU: What's the Difference?
CPUs excel at sequential logic, GPUs at parallel math, and TPUs at the specific matrix operations behind neural networks. Here's how they compare.
A CPU is built for fast sequential logic and general-purpose control flow, a GPU is built for massively parallel math across thousands of simple cores, and a TPU is built even narrower — for the specific matrix-multiplication pattern that dominates neural network training and inference. Each trades away generality for speed at a different point on the same spectrum: the more specialized the chip, the faster it is at its narrow job and the worse it is at everything else.
CPU: general-purpose and sequential
A central processing unit has a small number of powerful cores — typically single digits to a few dozen — each capable of executing a wide variety of instructions with sophisticated branch prediction, out-of-order execution, and deep caches. This design is optimized for tasks with a lot of conditional logic and unpredictable control flow: running an operating system, executing a web server, or handling one request at a time in sequence.
CPUs are the only one of the three that can run arbitrary general-purpose code — an operating system kernel, a compiler, a database engine. GPUs and TPUs are accelerators that a CPU offloads specific work to; neither can boot a computer or run your application logic on its own.
GPU: parallel by design
A graphics processing unit flips the CPU’s design priorities. Instead of a few complex cores, a GPU has thousands of much simpler cores, all executing the same instruction across different pieces of data simultaneously — a pattern called SIMD (single instruction, multiple data). This was originally built for rendering: shading millions of pixels independently is exactly the kind of embarrassingly parallel workload GPUs excel at.
That same architecture turned out to be a near-perfect fit for the linear algebra behind deep learning — matrix multiplications applied to huge batches of numbers, where every element can be computed independently of the others. This is why GPUs, not CPUs, became the default hardware for training and running large language models, well before AI-specific chips existed.
TPU: purpose-built for tensor math
A tensor processing unit narrows the specialization further. Where a GPU is general-purpose parallel hardware that happens to be good at neural network math, a TPU is designed from the ground up around one operation: multiplying and accumulating large matrices, the core computation in a neural network’s forward and backward passes. TPUs use a systolic array architecture, where data flows through a grid of arithmetic units in a fixed pattern, keeping the chip’s math units fed without constantly reading and writing memory the way a more general architecture would.
The tradeoff is flexibility. A TPU is excellent at the specific tensor operations neural networks need and comparatively poor at anything outside that lane — it’s not a chip you’d use for general parallel computing the way you might repurpose a GPU. This is the same specialization logic behind other AI-specific accelerators, including the NPUs now built into consumer laptops and phones for on-device inference at low power.
Comparing the three
| CPU | GPU | TPU | |
|---|---|---|---|
| Core count | Few, complex | Thousands, simple | Grid of matrix units |
| Best at | Sequential logic, branching | Parallel math, graphics, ML | Neural network tensor ops |
| Flexibility | Fully general-purpose | General parallel compute | Narrow, ML-specific |
| Typical role | Runs the OS, orchestrates work | Trains/runs ML models, renders graphics | Trains/runs ML models at scale |
Why AI workloads use all three together
A real machine learning system rarely uses just one of these in isolation. The CPU orchestrates the overall program — loading data, managing the training loop, handling I/O — and hands the actual matrix math off to a GPU or TPU, which does the heavy numerical lifting far faster than a CPU could. Memory bandwidth to feed those accelerators matters as much as raw compute; this is part of why HBM memory, stacked directly next to the compute die, has become standard on high-end AI accelerators rather than conventional off-chip memory.
Which accelerator a given workload uses often comes down to availability and software ecosystem as much as raw architecture — GPUs have a much broader software ecosystem built up over more than a decade of general-purpose GPU computing, while TPUs are tied more closely to specific cloud providers and frameworks.
The takeaway
CPUs, GPUs, and TPUs sit on a spectrum from general-purpose to highly specialized: a CPU can run anything but isn’t fast at parallel math, a GPU trades generality for massive parallelism that happens to suit neural networks well, and a TPU narrows further into hardware built specifically for the tensor operations at the heart of deep learning. None of them is simply “faster” than the others in an absolute sense — each wins by giving up flexibility the others keep, and a real AI system leans on all three, using the CPU to orchestrate work it hands off to whichever accelerator fits the job.
Tagged
Keep reading
Chisato · · 4 min read What Is a Systolic Array? The Grid Behind Fast Matrix Math
A systolic array is a grid of processing elements that pass data to their neighbors in rhythm, built to accelerate matrix multiplication in AI chips like TPUs.
Chisato · · 4 min read What Is an NPU? The AI Chip Inside Your Next Laptop
An NPU is a processor built for one job: running AI models fast at very low power. What TOPS numbers actually mean and why every new laptop ships with one.
Chisato · · 6 min read Google TurboQuant: 6x AI Memory Compression, Explained
Google TurboQuant compresses AI model memory ~6x with no accuracy loss or retraining, and speeds attention up to 8x. How it works and what it means for HBM.