No processor wins the CPU vs GPU vs TPU comparison for AI everywhere. A 2019 benchmarking study of all three platforms concluded that no one platform is best for every scenario, and that each one has an advantage on different models because of how those models are built. Which one wins depends on batch size, model size, the latency limit the service has to meet and, for language models, the balance between input and output length. That means the only speedup figure worth carrying into a purchase is one you measured on your own workload.
As a rough map, the evidence points this way. TPUs are tuned for large batches and CNNs. GPUs cope better with small batches, irregular computation and large fully connected models. CPUs are the most programmable and support the largest models. The rest of this article explains why each part of that map holds, where it stops holding, and how a headline speedup can point a hardware decision the wrong way.
How a CPU, a GPU and a TPU Run the Same Neural Network
Google’s TPU documentation describes the CPU as loading values from memory, computing and writing the result back for every calculation, so memory access can limit its throughput. A GPU packs thousands of arithmetic logic units (its CUDA cores) into one processor (Google puts a typical modern GPU at 2,500 to 5,000) so it can run thousands of multiplications and additions at once, and on a typical deep learning training workload it can deliver an order of magnitude more throughput than a CPU. A TPU is an application-specific integrated circuit built for the large matrix operations at the centre of machine learning.
All three are bounded by the same three limits. NVIDIA’s GPU performance guide says a function’s performance is bounded by memory bandwidth, math bandwidth or latency. The guide gives a rule for which limit applies: latency when there is not enough parallelism, math when the algorithm’s arithmetic intensity is above the processor’s ops:byte ratio, and memory when it is below. That rule matters more for a hardware decision than any brand comparison does, because the same model can sit on different sides of it depending on how it is served.
What a TPU Is, and How Its Design Differs from a GPU’s
DeepMind’s scaling guide describes a TPU as a compute core that specialises in matrix multiplication (the TensorCore) attached to a stack of high-bandwidth memory (HBM). The matrix work happens in systolic arrays called MXUs: according to Google, each 128 x 128 MXU on TPU v5p and earlier performs 16K multiply-accumulates per cycle, and each 256 x 256 MXU on TPU v6e and TPU7x performs 128K bfloat16 multiply-accumulates per cycle. Multiplies take bfloat16 inputs, or lower-precision formats on supported generations, and accumulate in FP32. Google states that no memory access is needed during the matrix multiplication itself, which is where the TPU gets its high throughput on neural network maths.
The trade is generality. Google’s 2017 paper on the first datacenter TPU explains that the chip omits features CPUs and GPUs spend transistors and energy on: caches, branch prediction, out-of-order execution, multithreading, context switching and more. Those features help the average case but not the 99th-percentile case. By using 8-bit integer multipliers instead of the K80 GPU’s 32-bit floating-point datapaths, that TPU fitted 65,536 MACs against the K80’s 2,496, and 28 MiB of on-chip memory against 8 MiB, while drawing less than half the K80’s power.
The two families also scale differently. The DeepMind guide notes that GPUs connect through a hierarchy of switches that approximates point-to-point links, so any GPU can reach any other in a few hops. TPUs use local connections that are cheaper, simpler to wire and able to scale to larger topologies, because links and bandwidth per device stay constant.
Is a TPU Faster than a GPU for AI Training and Inference?
A TPU is faster on a specific class of work, and the margin swings from a large win to a loss. Google’s 2017 paper reports that, on Google’s own production inference mix, the TPU was on average about 15 to 30 times faster than a contemporary K80 GPU or Haswell CPU, with TOPS per watt about 30 to 80 times higher.
The ParaDnn study uses a parameterised benchmark suite, which gives a more complete view of potential workloads. All CNNs ran better on the TPU, and the TPU’s advantage grew with batch size and with the number of filters and blocks. With fully connected models it was split: 62% ran faster on the TPU, and large batch size was the key to that advantage. The GPU was the better choice for small batches, because warp scheduling packs small batches onto streaming multiprocessors easily. It also did better on large fully connected models, where little weight reuse puts pressure on the memory system and the GPU’s higher bandwidth paid off. Across the parameterised models, TPU-over-GPU speedup ranged from less than 1 to 10 times.
Scaling out across TPU cores has its own cost. In the same study, maximum FLOPS utilisation for fully connected models fell from 100% on one TPU core to 62% on eight, because more weights have to be synchronised across cores.
Where a TPU Is the Wrong Tool
Google’s own documentation lists workloads where a TPU may not be the best choice: linear algebra with frequent branching or many element-wise operations, models that depend on custom JAX or PyTorch operators running on CPUs, and scientific work that needs FP64. A program dominated by non-matrix operations such as add, reshape or concatenate is unlikely to get high MXU utilisation.
Shape matters as well. The XLA compiler needs either the batch size or a feature dimension to be a multiple of 128, and otherwise pads it. Padded tensors under-use the TPU core and take more on-chip memory, which can lead to out-of-memory errors.
The LLM Case: Prefill Versus Decode Flips the Winner
A 21-case benchmark served Gemma 4 31B with vLLM on a TPU v6e-4 and on two A100 80GB GPUs. The TPU won saturation throughput on short requests, and the A100s won on medium and long ones. The authors trace the cause to the two phases of LLM inference. On short requests (1,024 tokens in, 256 out), decode dominates and the TPU’s per-token decode efficiency wins. On long requests (8,000 in, 1,000 out), prefill dominates and the A100’s prefill compute pays off. Time per output token was lower on the TPU at every profile and request rate, by 2.5 to 5.8 times.
That comparison has a fairness caveat. vLLM’s Gemma 4 attention path rejected the fp8 KV-cache formats the A100 could use, so the A100 ran a bf16 KV cache while the TPU ran fp8. The authors estimate this left the A100 with roughly half the TPU’s concurrent capacity, and it still won medium and long throughput. In a companion benchmark on an 8B model, the TPU was cheaper per output token on every profile until raising A100 concurrency to 128 flipped short and medium; long stayed TPU-cheapest. The authors conclude that workload shape and serving settings, not hardware alone, decide the winner.
For a wider view of the trade-offs once the shortlist is down to these two families, see our piece on choosing between TPUs and NVIDIA GPUs for modern AI workloads.
Why a 99th-Percentile Latency Limit Changes the Ranking
Inference behind user-facing services has response-time limits, and throughput that misses the limit is wasted. Google’s TPU paper reports that its developers set a 7 ms 99th-percentile limit for one MLP application. Under that limit the Haswell CPU ran at 42% and the K80 at 37% of the throughput they could reach without it, while the TPU ran at 80%. Larger batches raise throughput but stretch response time, so the CPU and GPU had to use batches of 16 while the TPU used 200. The paper’s conclusion was that under these latency limits the K80 was underused and only a little faster than the Haswell CPU.
The developers’ requirement also tightened in practice: one team that had quoted a 10 ms limit cut it to 7 ms when they actually ported to the TPU. We would treat the tail-latency target as a design input fixed before any benchmark runs. A throughput number measured without it describes a machine you will not be running. The money that idle silicon wastes under a latency cap is the subject of the hidden cost of GPU underutilisation.
When Is a CPU Good Enough for AI Inference?
A CPU is good enough when the model is small, the task has little parallelism, and the service does not need very low latency. Hugging Face’s Sapphire Rapids guide names model size as the most important factor: larger models gain more from a GPU, smaller ones run efficiently on a CPU, and a task without much parallelism may be better on a CPU. The same guide adds that a CPU can be the more cost-effective and flexible option when the use case does not need extremely low latency or has to scale workers up and down across varied hardware. Google’s TPU guidance lists CPU-shaped work in similar terms: quick prototyping, simple or small models with small effective batch sizes, many custom C++ operations, and models limited by host I/O or networking.
Measured results show the boundary. A 2025 study on the iPhone 15 Pro found a CPU-only configuration (two threads, F16) reached 17 tokens per second on a 1-billion-parameter LLM, against 12.8 with GPU acceleration. For Qwen2-0.5B and LLaMA-3.2-1B the CPU was 1.31 and 1.33 times faster than the GPU, but above 1.5B parameters the GPU generally kept higher throughput. The authors attribute the CPU win to small matrix multiplications that a CPU runs directly, while a GPU pays kernel-launch costs on small workloads. They also warn the result may not carry to other mobile chips, because cache hierarchies, memory bandwidth and GPU efficiency differ.
On server hardware, a hosting provider’s April 2026 benchmark (a vendor blog, so read it as the vendor’s claim) measured a dual-socket AMD EPYC 9334 at 8.1 and 26.2 tokens per second at FP16 on DeepSeek-R1-8B and GPT-OSS-20B, against 16.7 and 58.6 on an NVIDIA L4. On its figures CPU throughput is about half the GPU’s, and the vendor argues the lower hourly cost makes it the right choice for batch summarisation, transcription queues, overnight reports and lightweight TTS. It keeps the GPU for real-time, high-concurrency serving and unquantised models above 20B parameters. The ParaDnn study adds one more CPU strength: only the CPU supported the largest models, because of its memory capacity.
If you are asking whether the CPU-or-GPU question is even the right one for your pipeline, our article on why the CPU versus GPU question is usually misdirected takes it up. Moving an existing model onto cheaper hardware without changing the model is covered in porting AI inference across runtimes and hardware.
Decision Table: What Each Workload Trait Tends to Favour
| Workload trait | Tends to favour | What can overturn it |
|---|---|---|
| Large effective batch, dense matmul, CNNs | TPU | Shapes that force heavy padding or non-matmul ops |
| Small batches, irregular or non-matmul computation | GPU | Very small models, where CPU avoids kernel-launch overhead |
| Large fully connected models | GPU | Small fully connected models with large batches prefer TPU |
| RNNs | CPU: highest FLOPS utilisation in the ParaDnn study, up to 46%, against under 26% (TPU) and under 9% (GPU) | |
| Strict 99th-percentile latency limit | TPU in the 2017 study: 80% of unconstrained throughput, against 42% (CPU) and 37% (K80 GPU) | 2017 hardware; the paper expects GPU successors to add inference optimisations |
| LLM serving, decode-heavy (chat) | TPU v6e in one 2026 vLLM benchmark | KV-cache precision and concurrency settings |
| LLM serving, prefill-heavy (long context) | A100 in the same benchmark | Streaming UX as the priority, where TPU’s TPOT is faster |
| Small models, low parallelism, batch or async jobs | CPU | Latency-critical or high-concurrency serving |
| FP64, frequent branching, custom ops on host | Not TPU; GPU for custom ops that run partly on CPUs | - |
Why Published CPU vs GPU vs TPU Speedups Mislead
TPU-over-GPU speedup depends heavily on the workload measured, which a single number hides. Google’s TPU paper calls inferences per second an inaccurate summary metric, because the figure mostly reflects how complex the model is: the same TPU ran the 4-layer MLP1 at 360,000 IPS and the 89-layer CNN1 at 4,700, a 75-fold spread on one chip. The ParaDnn authors make the same point about famous models: Transformer trains 3.5 times faster on a TPU than a GPU, but looking only at that model would hide a severe TPU memory-bandwidth bottleneck on fully connected layers above 4k nodes. Real workloads in that study ranged from 3 times (DenseNet) to 6.8 times (SqueezeNet), and parameterised models from below 1 to 10 times.
The baseline is the second trap. Lee et al.’s ISCA 2010 paper examined claims of one to two orders of magnitude GPU advantage over CPU. It showed most of the gap could be recovered with proper algorithm-architecture co-design on the CPU, the same kind of work already done for the GPU. Their rule is that two architectures should not be compared unless each gets its own best algorithm. Google’s TPU paper also explains an apparently contradictory result from the Fathom benchmark: Fathom’s CPU had only four cores, did not use AVX instructions, and was tested without a response-time cutoff.
Precision and generation are the third trap. The same TPU paper reports that an 8-bit CPU path gave about 3.5 times on the one DNN where it was built. If every model had sped up that much, the TPU’s performance-per-watt advantage would have dropped from 41 to 83 times to 12 to 24 times. Bailey’s well-known list of ways to fool an audience with parallel performance results includes quoting lower-precision results against higher-precision rivals, and presenting an inner kernel’s speed as the whole application’s. The 2026 vLLM benchmark’s bf16 versus fp8 KV-cache mismatch is a modern example, and its authors at least state it openly.
How to Measure Performance and Efficiency on Your Own Workload
Our position is to profile before choosing or optimising, and to treat any best practice (“use the largest batch”, “avoid branches”, “always quantise”) as something that only makes sense in a context profiling has established. The same goes for software stacks: a vendor-specific API does not make the same code faster on its own. It exposes lower-level features that allow deeper optimisation, and using them takes real commitment that is not always worth it. That trade comes up again when choosing a GPU compute API such as CUDA, OpenCL or SYCL.
The roofline model is the frame. Williams, Waterman and Patterson’s 2008 formulation bounds attainable performance at the minimum of peak compute and peak memory bandwidth multiplied by operational intensity. They found the ridge point (the minimum intensity needed for peak performance) predicted performance better than clock rate or peak throughput. Lee et al. argue that any performance claim should be sanity-checked against that kind of model, which rules out unoptimised baselines automatically. Batch size moves a workload across the ridge: NVIDIA’s guide puts a 4096x1024 linear layer at 315 FLOPS per byte with batch 512 and 1 FLOPS per byte with batch 1.
A measurement sequence we would follow, in order:
- Fix the service constraints first: the tail-latency target, the realistic batch or concurrency range, and the precision the model is allowed to run at, since each of these changes the ranking.
- Profile the model on hardware you already have, and place each dominant operation on the roofline as memory-, compute- or latency-bound. Google’s TPU guide makes profiling the first step in performance troubleshooting.
- Write a harness that warms up before timing, synchronises CUDA devices, and uses thread settings that match production. The PyTorch benchmark recipe shows the faster of two implementations can change with thread count and tensor size.
- Sweep realistic inputs rather than one shape: sequence lengths, batch sizes and request rates, as the 2026 vLLM benchmark did with 3 profiles and 7 rates.
- Tune each candidate fairly before comparing: thread count matched to performance cores on CPUs, tensor dimensions in multiples of 128 on TPUs, matching KV-cache precision on GPUs.
- Check the host. The ParaDnn study found that fixing host-to-device infeed bottlenecks improved some workloads by at least 34%.
- Report cost per useful output (tokens, requests or images within the latency limit), not peak throughput, with the method written down so the run can be repeated.
For cross-architecture comparability, the MLPerf Inference benchmark (ISCA 2020) sets out rules and best practices designed to make systems with very different architectures comparable. Its scenarios are a sensible template for your own harness, though a standard model is still not your model. Keeping the host fast enough to feed the accelerator is crucial to using it fully, which is why GPUs are part of a larger system is worth reading next to any benchmark plan.
LynxBenchAI’s results in the AI hardware directory compare candidate accelerators on one scale (throughput, latency, memory, energy and cost per unit of work). LynxBenchAI’s directory results come from stock PyTorch runs, not your workload, so use them to narrow the shortlist rather than replace step 2. Once the hardware is chosen, making the model run faster and cheaper on it is the work of TechnoLynx’s GPU Performance Engineering.
The question left after all this is not “which chip is fastest” but “which constraint binds first on our workload”: tail latency, memory bandwidth, KV-cache capacity or the host feeding the device. The chip that removes that constraint at the lowest cost per useful output is the right one, and it may change when the workload changes.