A CPU has a few dozen fast, flexible cores for sequential logic; a GPU has thousands of simpler cores and tensor cores for parallel maths, with much faster memory. For AI a GPU is typically 10–50× faster: an H100 PCIe reads memory at 2.0 TB/s, a desktop CPU at about 90 GB/s.
- Desktop CPU memory bandwidth
- ~80–100 GB/s (dual-channel DDR5)
- 12-channel DDR5-4800 server
- 12 × 38.4 = ~461 GB/s
- RTX 4090 bandwidth
- 1,008 GB/s
- H100 PCIe bandwidth
- 2.0 TB/s
- B200 bandwidth
- 8 TB/s
- 8B BF16 model, desktop CPU (est.)
- ~3–4 tokens/s
- 8B BF16 model, RTX 4090 (est.)
- ~38–47 tokens/s
CPUs and GPUs are both processors, but they are built for opposite kinds of work. A CPU is designed to run a few complicated tasks very quickly one after another. A GPU is designed to run the same simple operation on thousands of numbers at once. Modern AI is almost entirely the second kind of work, which is why GPUs dominate it.
This article explains the difference in plain terms, puts numbers on it, and shows where a CPU is still the right tool. It is part of our series on GPU cloud computing.
What is the difference between a GPU and a CPU?
A CPU (central processing unit) is a general-purpose processor with a small number of powerful cores optimised for low latency and complex control flow. A GPU (graphics processing unit) is a parallel processor with thousands of simpler cores optimised for throughput on uniform maths, plus its own high-bandwidth memory.
| Property | Server CPU | Data-centre GPU |
|---|---|---|
| Cores | Tens to ~200 complex cores | Thousands of simple cores grouped into streaming multiprocessors |
| Clock speed | ~2–5 GHz | ~1–2.5 GHz |
| Designed for | Low latency per task, branching, varied work | High throughput on many identical operations |
| Special units | Vector extensions (AVX-512, AMX on some Xeons) | Tensor cores for matrix maths in FP16, BF16, FP8, FP4 |
| Memory | System DDR5, hundreds of GB to TBs | On-package HBM or GDDR, 24–288 GB |
| Memory bandwidth | ~90 GB/s desktop, ~460 GB/s 12-channel server | 864 GB/s (L40S) to 8 TB/s (B200, B300) |
| Good at | Operating systems, databases, web servers, logic, small models | Neural networks, rendering, simulation, video |
A helpful image: a CPU is a few expert chefs, each able to cook any dish quickly. A GPU is a hall of thousands of kitchen assistants who can each only chop, but all chop at once. If the job is "chop ten thousand onions", the hall wins easily.
Why are GPUs faster for AI?
GPUs are faster for AI because neural networks are mostly matrix multiplications, which split naturally into thousands of independent multiply-add operations, and because GPUs pair that parallelism with memory several times faster than a CPU's. Both effects matter, and for LLM inference the memory effect usually matters more.
Start with the maths. A transformer model performs roughly 2 floating-point operations per parameter for each token it processes. For an 8B model:
FLOPs per token ≈ 2 × 8 × 10^9 = 16 GFLOPs
Prompt of 2,000 tokens ≈ 2,000 × 16 GFLOPs = 32 TFLOPsNVIDIA publishes about 756 TFLOPS of dense BF16 tensor throughput for the H100 PCIe. Even at a realistic 40–50% utilisation, the GPU gets through that 2,000-token prompt in roughly 85–105 milliseconds. A high-end server CPU delivers on the order of a few TFLOPS in BF16 (a rough estimate that varies widely by model and instruction set), so the same prompt takes seconds. That phase is called prefill, and it is compute-bound.
Then generation starts. Each new token requires reading all the model's weights from memory once, and the maths per byte read is small. This decode phase is limited by memory bandwidth, not compute. That is where the gap in the next section comes from. Our article on GPU parallel processing explains how the GPU schedules all that work, and memory bandwidth, FLOPS and compute performance explains which limit applies when.
How much faster is a GPU for LLM inference? A worked estimate
For single-user LLM generation, a GPU is typically 10–25× faster than a desktop CPU and 2–5× faster than a large server CPU, because speed scales with memory bandwidth. The rule of thumb is tokens per second ≈ 0.6–0.75 × bandwidth ÷ bytes read per token. The figures below are estimates from that rule, not benchmarks.
For an 8B model in BF16, the bytes read per token are about 16 GB.
| Processor | Memory bandwidth | Calculation | Estimated tokens/s, one user |
|---|---|---|---|
| Desktop CPU, dual-channel DDR5 | ~90 GB/s | 0.6–0.75 × 90 ÷ 16 | ~3.4–4.2 |
| Server CPU, 12-channel DDR5-4800 | ~461 GB/s | 0.6–0.75 × 461 ÷ 16 | ~17–22 |
| L40S | 864 GB/s | 0.6–0.75 × 864 ÷ 16 | ~32–41 |
| RTX 4090 | 1,008 GB/s | 0.6–0.75 × 1,008 ÷ 16 | ~38–47 |
| H100 PCIe | 2,000 GB/s | 0.6–0.75 × 2,000 ÷ 16 | ~75–94 |
| H200 | 4,800 GB/s | 0.6–0.75 × 4,800 ÷ 16 | ~180–225 |
Two caveats keep the server CPU from looking better than it is. First, CPUs rarely reach their theoretical bandwidth during inference, so treat the CPU rows as optimistic. Second, this table ignores prefill. With a long prompt, the CPU may spend many seconds before writing the first word, while the GPU takes a fraction of a second.
The gap widens with more users. A GPU server such as vLLM batches many requests into each pass over the weights, so aggregate throughput grows several-fold or more with concurrency. A CPU has far less compute to spare for batching, so it gains much less.
Can you run an LLM on a CPU?
Yes. You can run small and medium LLMs on a CPU with llama.cpp, Ollama or similar tools, using a quantised model to cut the bytes read per token. It works well for one person, for testing, or for edge devices. It does not work well for serving a team or for large models.
With llama.cpp, a 4-bit GGUF file and a recent build:
# Assumes a recent llama.cpp build; binary names changed in 2024 to the llama- prefix
./llama-cli -m ./models/qwen2.5-7b-instruct-q4_k_m.gguf -p "Summarise what a KV cache is." -n 200 -t 16Or with Ollama, which uses a GPU when it finds one and falls back to CPU when it does not:
ollama run qwen3:8bQuantising to 4-bit cuts an 8B model from about 16 GB to about 4.5–5 GB, so the desktop-CPU estimate rises from ~3–4 tokens/s to roughly 11–15 tokens/s (0.6–0.75 × 90 ÷ 4.5). That is readable speed for one person. A 70B model at 4-bit is about 40 GB, which drops the same desktop to roughly 1–2 tokens/s. Quantisation trade-offs are covered in quantization explained.
What does a CPU still do better than a GPU?
A CPU is better for anything with heavy branching, small amounts of data, strict sequencing, or system-level work. Most of the software around an AI model is in that category.
- Running the operating system, web servers and APIs. Request routing, authentication and JSON handling are CPU work.
- Databases and vector search at modest scale. Postgres, SQLite and most vector indexes run on CPUs.
- Data preparation. Parsing files, cleaning text, resizing images and tokenising.
- Classical machine learning. Gradient-boosted trees (XGBoost, LightGBM), linear models and small scikit-learn pipelines are often faster end-to-end on CPU.
- Agent tooling. Browsers, code execution sandboxes, shell commands and file operations. GPU vs CPU for AI agents breaks down which parts of an agent actually need a GPU.
- Tiny models with tiny batches. A small embedding model handling a handful of requests may not justify a GPU.
When do you need a GPU, and when is a CPU enough?
You need a GPU when your workload is dominated by neural-network maths at a scale where CPU speed becomes the bottleneck for users or for your timeline. A CPU is enough when the model is small, the volume is low, or the work is mostly logic and I/O.
| Workload | CPU enough? | GPU needed? | Smallest sensible GPU |
|---|---|---|---|
| Chat with a 1–8B model for yourself | Yes, at 4-bit | Nicer | RTX 4090 |
| Serve an 8B model to a team | Rarely | Yes | RTX 4090 or L40S |
| Serve a 32B–70B model | No | Yes | L40S (4-bit) to H100 (FP8) |
| Stable Diffusion or FLUX images | Minutes per image on CPU | Yes | RTX 4090 |
| Transcribe hours of audio with Whisper | Slow but possible | For volume | RTX 4090 |
| Fine-tune an LLM with LoRA | No | Yes | RTX 4090 (small) to A100 |
| Train XGBoost on tabular data | Yes | Optional | Usually none |
| Run an agent that calls a hosted model API | Yes | No | None |
| Embed a few thousand documents once | Yes | Faster | Any |
When you do need a GPU, size it by memory first. Our guide on how to choose the right GPU for your AI workload walks through that process.
How do CPUs and GPUs work together in a GPU server?
In a GPU server, the CPU acts as the coordinator: it loads data, prepares batches, launches GPU kernels and handles everything outside the model. If the CPU side is too slow, the GPU sits idle while you still pay for it.
Common symptoms and fixes:
- GPU utilisation jumps between 0% and 100%. The data loader is not keeping up. Increase workers:
from torch.utils.data import DataLoader
loader = DataLoader(dataset, batch_size=32, num_workers=8, pin_memory=True, persistent_workers=True)- Slow first token on long prompts with fast decode. Normal; that is prefill. Prefix caching in your server helps with repeated system prompts.
- High CPU, low GPU when serving. Tokenisation, JSON parsing or a Python bottleneck in your app. Profile before buying a bigger GPU.
A balanced machine has enough CPU cores and RAM to keep each GPU busy. For image training a common starting point is 4–8 CPU cores per GPU; LLM inference needs fewer.
Is a GPU more expensive than a CPU per unit of work?
Per hour, a GPU costs more than a CPU server. Per unit of AI work, it is usually far cheaper, because it finishes so much more work in each hour. Cost per million tokens is the clearest way to compare:
cost per million tokens = hourly price ÷ (tokens per second × 3,600 ÷ 1,000,000)Take an RTX 4090 serving an 8B model. Single-stream at an estimated 40 tokens/s, it produces 144,000 tokens an hour. Batched for several users, aggregate throughput of several hundred tokens per second is a reasonable estimate, depending on prompt and output lengths and concurrency. At 500 tokens/s, that is 1.8 million tokens an hour.
| Setup | Tokens per hour (estimate) | Cost per million tokens |
|---|---|---|
| RTX 4090, one user, ~40 tok/s | 0.144 M | $1.59/hr ÷ 0.144 ≈ $11.04 |
| RTX 4090, batched, ~500 tok/s | 1.8 M | $1.59/hr ÷ 1.8 ≈ $0.88 |
| H100, batched, ~1,000 tok/s (70B FP8) | 3.6 M | $4.99/hr ÷ 3.6 ≈ $1.39 |
To match the batched 4090 on CPU, you would need many CPU servers. The GPU wins on cost as soon as there is steady demand.
When does renting a GPU from Wandering Giants Compute fit?
Renting a GPU from Wandering Giants Compute fits when your CPU has become the bottleneck and you want to move the model onto a GPU without buying hardware. You can start with a 24 GB RTX 4090 at $1.59/hr and move up to a 48 GB L40S at $1.89/hr or an 80 GB H100 at $4.99/hr when the model or the user count grows.
| If on CPU you are running… | Move to | Price per hour | How |
|---|---|---|---|
| A 7–8B model via llama.cpp or Ollama | RTX 4090 (24 GB) | $1.59/hr | Chat with Qwen3 8B, or Root and keep your Ollama setup |
| An app calling a local model over HTTP | RTX 4090 or L40S (48 GB) | $1.89/hr | API: OpenAI-compatible, change the base URL |
| A 70B model that crawls at 1–2 tokens/s | H100 (80 GB) | $4.99/hr | Chat or API with Llama 3.3 70B FP8 |
Billing is by the minute from prepaid credit, so a one-hour experiment costs one hour. If credit runs out, the machine stops itself and its disk is kept free for 7 days. Your prompts and outputs stay on your machine; we don't read them or train on them. Keep your agents, databases and web servers on CPU; rent the GPU just for the model. See the GPUs and prices.
Frequently asked questions
Is a GPU always faster than a CPU?
No. A GPU is faster for large, parallel, uniform maths such as neural networks, rendering and simulations. A CPU is faster for branching logic, small tasks, operating-system work, databases and anything that cannot be split into thousands of identical operations.
Can I run a large language model on a CPU?
Yes, with tools such as llama.cpp or Ollama and a quantised model. Small models (1–8B at 4-bit) give usable single-user speeds on a modern CPU. Prompt processing is slow, though, and serving many users or running 70B models on CPU is rarely practical.
Why do AI models need so much memory bandwidth?
Generating each token of an LLM means reading every active weight from memory once. An 8B model in BF16 is 16 GB, so 40 tokens per second needs about 640 GB/s. Desktop CPUs cannot supply that; GPU memory can.
Do I still need a good CPU in a GPU server?
Yes. The CPU tokenises text, decodes images, runs data loaders and handles the web server. Too few CPU cores can leave an expensive GPU waiting. For training on images, a few CPU cores per GPU is a common minimum.
Should I train machine learning models on a CPU?
Only small classical models such as gradient-boosted trees, linear models or tiny neural networks. Deep learning training on a CPU is usually tens of times slower than on a GPU, which makes even a short GPU rental cheaper in total.
Do AI agents need a GPU?
The agent's tools, browser and code execution run fine on CPUs. Only the model needs a GPU, and only if you host it yourself. If you call a hosted model API, the agent itself can run on a small CPU server.
Rent the GPU for this, by the minute.
Move your model from CPU to a 24 GB RTX 4090 or larger GPU in minutes, billed by the minute with no contract.
Prepaid credit, billed by the minute, stops itself when credit runs out. Prices in £, $, €, ¥, CA$, A$, CHF and S$; UK prices include VAT.
Keep reading
- Complete guideWhat Is GPU Cloud Computing? The Complete Guide
- GuideWhat Is GPU Parallel Processing? Explained for AI Developers
- GuideUnderstanding GPU Memory Bandwidth, FLOPS and Compute Performance
- GuideGPU vs CPU for AI Agents: What Actually Needs a GPU?
- GuideHow to Choose the Right GPU for Your AI Workload
- GuideHow GPU Cloud Computing Works: From Hardware to Workload
About this article. Written by the Wandering Giants Compute team, the people who run Wandering Giants Compute. Hardware figures are the manufacturers’ published specifications. Speeds and costs marked as estimates are worked out from those specifications and our current prices, with the method shown; they are not measured benchmarks. Wandering Giants prices are taken live from our price list each time this page is built.
Last reviewed 25 November 2026.