Why GPUs beat CPUs at AI, shown with datasheet numbers: parallel cores, memory bandwidth and tensor units. Includes a token-speed ceiling you can calculate, plus TPUs, NPUs and the jobs where a CPU is enough.
The Brilliant Mathematician vs. the Stadium Full of Students
A model’s README says it needs a GPU with 24 GB of memory, and your laptop has a fast CPU and 32 GB of RAM. Why is that not enough? Picture a CPU as one brilliant mathematician who solves problems one at a time, and a GPU as a stadium packed with 16,000 average math students. Hand out 10,000 multiplication problems and the stadium finishes first. That contest is the whole story of why graphics cards run AI.
The reason is the work itself. Training and running a neural network is dominated by matrix multiplication: multiply large grids of numbers together, pass the results to the next layer, and repeat. Every output in a matrix product can be computed independently of the others, so the work splits across thousands of workers with no waiting. CPU cores are built for the opposite pattern, a single thread of instructions that depend on each other, with branch prediction and out-of-order execution to keep it fast. A GPU trades that sophistication for count. According to NVIDIA’s Hopper architecture write-up, a full H100 SXM5 has 132 streaming multiprocessors with 128 FP32 CUDA cores each, which is 16,896 CUDA cores, plus 528 fourth-generation Tensor Cores.
How much faster is that in practice? No single multiplier holds across workloads, so be wary of any article that quotes one. Measure it on your own machine instead. Try this yourself: the script below times the same matrix product on the CPU and, if you have one, a CUDA GPU. It follows the PyTorch CUDA notes, which warn that GPU work is queued asynchronously, so “time measurements without synchronizations are not accurate”, and which note that TF32 matrix multiplication is off by default in current PyTorch, so the FP32 line measures plain FP32. An N x N product takes 2 × N³ operations, which is how the script converts time to TFLOPS.
import time
import torch
N = 4096 # raise it if the GPU finishes too quickly to time well
def seconds(a, b, runs=5):
a @ b # warm-up, not timed
if a.is_cuda:
torch.cuda.synchronize()
start = time.perf_counter()
for _ in range(runs):
a @ b
if a.is_cuda:
torch.cuda.synchronize()
return (time.perf_counter() - start) / runs
a = torch.randn(N, N)
b = torch.randn(N, N)
flops = 2 * N**3
cpu_s = seconds(a, b)
print(f"CPU: {cpu_s:.4f} s, {flops / cpu_s / 1e12:.2f} TFLOPS")
if torch.cuda.is_available():
a, b = a.cuda(), b.cuda()
gpu_s = seconds(a, b)
print(f"GPU float32: {gpu_s:.4f} s, {flops / gpu_s / 1e12:.2f} TFLOPS")
a, b = a.half(), b.half()
half_s = seconds(a, b)
print(f"GPU float16: {half_s:.4f} s, {flops / half_s / 1e12:.2f} TFLOPS")
Memory Bandwidth: The Number That Sets Chatbot Speed
Core counts explain training. For running a language model, the number that matters more is how fast the chip can read the model’s weights. Databricks’ LLM inference guide says that after the first token, decoding is “memory-bound”: “the speed is dependent on how quickly we can load model parameters from GPU memory”, which makes memory bandwidth “a better predictor of speed of token generation than their peak compute performance.” Each new token needs the whole set of weights streamed through the chip once, so a ceiling follows: tokens per second cannot exceed memory bandwidth divided by the bytes of weights. The ceiling is a derivation from that statement, not a figure Databricks publishes; its own worked example is a 7B model in 16-bit precision, which moves 14 GB per token, and at 14 ms per token it uses 1 TB/s of a 2 TB/s peak, a 50% utilization.
Take a 7-billion-parameter model quantized to 4 bits, about 7B × 0.5 byte = 3.5 GB of weights. The ceiling for one user:
| Hardware | Memory bandwidth | Ceiling for 3.5 GB of weights |
|---|---|---|
| Desktop CPU, dual-channel DDR5-6000 | 96 GB/s (2 channels × 8 bytes × 6,000 MT/s) | 96 / 3.5 = about 27 tokens/s |
| Apple M5 (10-core GPU) | 153 GB/s | about 44 tokens/s |
| Apple M5 Max (40-core GPU) | 614 GB/s | about 175 tokens/s |
| NVIDIA GeForce RTX 5090 | 1,792 GB/s | 512 tokens/s |
| NVIDIA H100 SXM | 3.35 TB/s | about 957 tokens/s |
Read the table as upper bounds. Real systems land below them (the Databricks example runs at half of peak), the attention cache adds more reading as the conversation grows, and batching many users at once changes the picture. The Apple figures come from Apple’s MacBook Pro specifications and the NVIDIA ones from NVIDIA’s GeForce comparison and H100 page. The DDR5 row is calculated from the 8-byte width of a memory channel, so it varies with the speed and number of channels in your machine. Even so, the shape is clear: the RTX 5090 reads memory about 19 times faster than that desktop and the H100 about 35 times, and capacity is the second constraint, since the model has to fit (32 GB on the RTX 5090, 80 GB on the H100, up to 128 GB on an M5 Max).
Tensor Cores and What a Spec Sheet Really Says
CUDA cores are the general-purpose workers. Tensor cores are matrix units built for the multiply-accumulate step that dominates neural networks. NVIDIA says the H100’s Tensor Cores deliver 2 times the matrix-multiply rate of the A100 per streaming multiprocessor on equivalent data types, and 4 times with FP8. The table puts the hardware side by side with the vendors’ own figures.
| Hardware | Memory | Bandwidth | Vendor compute figures |
|---|---|---|---|
| NVIDIA H100 SXM | 80 GB HBM3 | 3.35 TB/s | 16,896 CUDA cores, 528 Tensor Cores. 67 TFLOPS FP32. FP16 Tensor Core 1,979 TFLOPS (with sparsity). |
| NVIDIA GeForce RTX 5090 | 32 GB GDDR7 | 1,792 GB/s | 21,760 CUDA cores, 5th-generation Tensor Cores, 3,352 AI TOPS, 575 W. Launch price $1,999. |
| NVIDIA Rubin GPU (listed on NVIDIA’s HGX page) | 288 GB HBM4 | 22 TB/s | FP16/BF16 4 PFLOPS (dense). |
| Apple M5 Max | Up to 128 GB unified | 460 to 614 GB/s | 16-core Neural Engine. |
Handle the compute column with care. NVIDIA marks the H100’s Tensor Core rows “With sparsity”, while its FP32 row has no such marker, and on the HGX page it states that for the Blackwell FP8 and FP16 rows the dense figure is half of the sparse one. The RTX 5090’s “3,352 AI TOPS” is a low-precision throughput number, and NVIDIA’s page does not state the precision. TOPS and TFLOPS count different kinds of operations, so compare them only when precision and sparsity match. The sources for the table are the H100 page, HGX page, GeForce comparison and launch announcement.
TPUs and NPUs: Two Other Kinds of AI Chip
TPUs are Google’s answer to the same problem. Google Cloud’s TPU documentation describes Tensor Processing Units as “Google’s custom-developed, application-specific integrated circuits (ASICs)” used to accelerate machine learning workloads. Google Cloud offers them as a rented service, Cloud TPU. The compiler is XLA, which takes the graph from your framework and compiles it for the chip, and the OpenXLA page says it is integrated in TensorFlow, PyTorch and JAX. JAX’s docs say the same code runs on CPU, GPU and TPU. One fact shows the scale: Google’s announcement of Ironwood, its seventh-generation TPU, lists 4,614 TFLOPs of peak compute per chip, 192 GB of HBM at 7.37 TB/s, and up to 9,216 chips in a pod. A caveat on the PyTorch side: the PyTorch/XLA docs carry an April 22, 2026 notice that “Once TorchTPU is public it will replace PyTorch/XLA”, so check which path your PyTorch version supports.
NPUs sit at the other end, inside laptops and phones. Microsoft’s Copilot+ PC developer guide describes a Neural Processing Unit as a specialized chip for AI-intensive processes like real-time translation and image generation, designed to execute the deep learning math behind AI models. Microsoft says an NPU uses energy on AI tasks more efficiently than a CPU or GPU, which is where the longer battery life comes from. The fact to remember is its bar for entry: Copilot+ PCs are built around an NPU that performs more than 40 trillion operations per second (40 TOPS). The same guide gives the main limit. Many NPUs only support integer math in lower-bit formats such as INT8, so a model usually has to be quantized before it can run there, and Microsoft recommends Windows ML for running inference on the NPU. Apple’s chips follow the same idea: every M5 variant on Apple’s spec sheet has a 16-core Neural Engine. In short, a GPU or TPU is where you train and serve large models, and an NPU is where small, quantized models run all day without draining the battery.
Where CPUs Still Hold Their Ground
Before you conclude that CPUs are obsolete for AI, look at what happens around the GPU’s work. Raw data arrives as messy JSON, inconsistent database rows and broken image folders. Cleaning, transforming and augmenting it involves string handling, branching logic and irregular memory access, which suit CPU cores better than thousands of lockstep workers.
Classical machine learning is a mixed case rather than a CPU monopoly. XGBoost’s GPU documentation says most of its algorithms, including training, prediction and evaluation, can be accelerated with CUDA GPUs by setting device="cuda". It also lists the costs: CUDA 12.9 or newer, and working memory that grows with the number of rows. And “the model can be used on any device regardless of the one used to train it”, so a GPU-trained model can still serve from a CPU-only machine. Whether a GPU helps on your own dataset is another thing you can time yourself.
Local language models are the other case. llama.cpp’s README lists AVX, AVX2, AVX512 and AMX support for x86 CPUs, 1.5-bit to 8-bit quantization, CUDA, HIP, Vulkan, SYCL and Metal backends, and “CPU+GPU hybrid inference to partially accelerate models larger than the total VRAM capacity.” The bandwidth table shows why this works for one user: a quantized 7B model has a ceiling near 27 tokens per second even on an ordinary desktop, and hybrid mode lets a model that does not fit in VRAM spill into system RAM at a speed cost.
So the practical rule is to split the work by what each chip does well: CPUs for data pipelines, orchestration and small or occasional inference, GPUs for training and for serving large models to many users. Before you rent or buy anything, calculate two numbers for your model: the weights in gigabytes (parameters × bytes per parameter) and the bandwidth ceiling (memory bandwidth ÷ weights). If the model fits and the ceiling is above the speed you need, a bigger GPU would not make it faster in any way you can feel. For more on this topic, see AI hardware.
Frequently Asked Questions
For small models and small datasets, yes, and the benchmark above tells you how slow your CPU really is for the matrix work. For anything larger, renting beats waiting. Lambda’s on-demand price list showed these per-GPU hourly rates when checked in October 2026 (the page carries no date): A10 24 GB at $1.29, A100 40 GB at $1.99, H100 PCIe 80 GB at $3.29, H100 SXM 80 GB at $3.99 to $4.29, and B200 at $6.69 to $6.99. A 40-hour fine-tuning run on the H100 PCIe is 40 × $3.29 = $131.60. For comparison, an RTX 5090 at its $1,999 launch price equals about 608 hours of that rental (1,999 / 3.29), but it has 32 GB of memory against 80 GB, so check that your model fits before treating them as equivalents.
Not strictly, but check the support table of the exact library you plan to use. The PyTorch 2.14.0 release notes list ROCm 7.14 wheels for AMD, Intel XPU graph capture and native linear algebra on Apple Silicon, and llama.cpp lists CUDA, HIP, Vulkan, SYCL and Metal backends. Being supported is not the same as being equally fast or equally tested, so run your own model on the hardware you can get before you buy it.
Apple’s spec sheet lists a single unified memory size and bandwidth per chip: 153 GB/s and up to 32 GB for the M5, 307 GB/s and up to 64 GB for the M5 Pro, and 460 to 614 GB/s and up to 128 GB for the M5 Max. That capacity is the draw, because a 70B-parameter model at 4 bits needs about 35 GB of weights, more than a 32 GB RTX 5090 can hold. Bandwidth is the limit: 614 GB/s is about a third of the RTX 5090’s 1,792 GB/s and under a fifth of the H100’s 3.35 TB/s, so the token-speed ceiling is proportionally lower. Apple says the M5 has “over 4x the peak GPU compute performance for AI compared to M4” (its own testing), which narrows the compute side but not the memory side.