GPU vs CPU for inference: which is cheaper to serve on
GPUs accelerate inference but cost far more per hour; CPUs are cheaper but slower per request. For small models, low throughput, or latency-tolerant workloads, CPU is often cheaper per inference. Here is how to decide.
Quick answer
GPUs run inference far faster per request but cost much more per hour; CPUs are cheaper per hour but slower per request. The right choice is cost per inference, not per hour. For large models or high sustained throughput, a GPU's speed makes its cost-per-inference lower despite the higher hourly rate. For small models, low or bursty throughput, or latency-tolerant workloads, a CPU is often cheaper per inference, and it scales to zero more cheaply. Measure both on your model.
A common assumption is that ML inference needs a GPU, but that is a cost question, not a given. GPUs are faster per request but far more expensive per hour, so the right hardware depends on which delivers a lower cost per inference for your model and load, and for many workloads that is a CPU.
The real metric: cost per inference
| CPU | GPU | |
|---|---|---|
| Cost per hour | Low | High |
| Throughput per instance | Lower | Much higher |
| Best for | Small models, low/bursty load | Large models, high sustained load |
| Scale-to-zero economics | Cheap | Expensive to idle |
What matters is cost per inference: hourly cost divided by inferences served per hour. A GPU costs more per hour but may serve so many more inferences that its cost per inference is lower, for large models at high throughput. A CPU costs little per hour and, for a small model or modest load, can serve enough to have a lower cost per inference. So compute the metric for your actual model and load.
When CPU wins
CPU inference tends to win for small or optimized models (quantized, distilled), low or bursty request volume, latency-tolerant workloads, and anything that benefits from cheap scale-to-zero (an idle CPU costs little; an idle GPU is expensive). Many production models, especially smaller ones, serve perfectly well and more cheaply on CPU, and CPU capacity is easier to autoscale and get.
When GPU wins
GPU inference wins for large models (where CPU would be too slow to meet latency), high sustained throughput (where the GPU's parallelism serves far more per hour), and latency-critical serving of heavy models. There, the GPU's speed makes its cost per inference lower despite the higher hourly rate, and CPU simply cannot meet the requirement.
Deciding for your workload
Do not assume GPU. Measure cost per inference on both for your model and expected load: divide the hourly cost by the inferences each serves per hour. Optimize the model (quantization, distillation) to make CPU viable where possible, since CPU is cheaper and scales to zero more economically. Use GPU where the model is large or throughput high enough that its speed wins on cost per inference. The answer is workload-specific, so measure rather than assume, part of inference cost optimization.
FAQ
Is CPU or GPU cheaper for inference?
It depends on cost per inference, not per hour. GPUs cost more per hour but serve far more inferences, so for large models at high throughput their cost per inference is lower. CPUs cost little per hour and, for small models or low/bursty load, can have a lower cost per inference. Measure both on your model and load rather than assuming GPU.
When is CPU cheaper for inference?
For small or optimized models (quantized, distilled), low or bursty request volume, latency-tolerant workloads, and anything benefiting from cheap scale-to-zero (an idle CPU costs little; an idle GPU is expensive). Many production models, especially smaller ones, serve well and more cheaply on CPU, which is also easier to autoscale and obtain.
When is GPU cheaper for inference?
For large models where CPU would be too slow to meet latency, high sustained throughput where the GPU's parallelism serves far more per hour, and latency-critical serving of heavy models. There the GPU's speed makes its cost per inference lower despite the higher hourly rate, and CPU may not meet the requirement at all.
How do I compare CPU and GPU inference cost?
Compute cost per inference on both: divide each option's hourly cost by the inferences it serves per hour for your model and load. The lower cost-per-inference wins. Also weigh scale-to-zero economics (cheap on CPU, expensive to idle a GPU) and whether latency requirements force the GPU regardless.
Can I make CPU inference viable for more models?
Often yes, by optimizing the model. Quantization (lower-precision weights) and distillation (a smaller model approximating a larger one) reduce the compute per inference, making CPU serving fast enough for models that would otherwise need a GPU. Since CPU is cheaper and scales to zero economically, model optimization to enable CPU inference is a strong cost lever.
Does C3X estimate inference hardware cost?
C3X prices both CPU and GPU serving instances from your Terraform against a live catalog, so you can compare their hourly cost before deploy. Cost per inference depends on your model's throughput on each, which you measure, but C3X gives the hourly rates to combine with those measurements.
What to do next
Compare CPU and GPU serving costs for your model. C3X reads your Terraform and prices your resources against a live catalog. Start with the quickstart.
Share this post
Try C3X on your own Terraform
Free and open source. No API key required. One command to install, one command to estimate.