Skip to main content
🎓 Claude Code Masterclass Learn AI-assisted development on Udemy — plus the companion book on Leanpub & Amazon. Start Learning

GPU Cost Optimization

GPU Cost Optimization

GPU bills spiral because utilization is invisible until the invoice arrives — a cluster can look "busy" on a dashboard and still be burning most of its budget on idle capacity. This page is the methodology behind that math; the free calculator is where you apply it to your own numbers.

You reduce GPU infrastructure costs by attacking utilization first, then pricing: right-size the number and type of GPUs to actual measured load, use MIG partitioning to fit multiple low-usage workloads onto one physical GPU instead of dedicating a full GPU to each, buy spot or preemptible capacity for interruptible training jobs and reserved or committed-use pricing for steady-state inference, autoscale inference replicas to traffic instead of running peak capacity around the clock, and raise throughput per GPU on the serving side with quantization (INT8/FP8) and continuous request batching. Luca Berton, an AI & Cloud Advisor with 18+ years of enterprise infrastructure experience, has helped clients achieve a 30% average cloud cost reduction using this combination of levers.

Where GPU spend actually goes

Most GPU bills break down into four categories, and the same four categories drive the model behind the GPU Cost Calculator: training, inference, storage, and egress. Training cost is GPU-hours × utilization × price, and it's bursty by nature — a run starts, consumes a cluster for hours or days, and stops. Inference is different: it's always-on GPU count × utilization × hours in the month, and because those GPUs are usually kept running to guarantee latency, inference is the silent, ongoing line item that keeps billing even when traffic is light. Storage and egress are smaller in most workloads, but they compound — checkpoints and datasets accumulate, and data movement between regions or out to the public internet adds up.

In practice, inference is usually the larger recurring cost over a full year, even when a single training run looks more expensive on paper — because training ends and inference doesn't.

CategoryBilling patternMain driverTypical optimization lever
TrainingBursty — GPU-hours per run × runs/monthNumber of runs, hours per run, GPU countSpot/preemptible pricing, checkpointing
InferenceContinuous — always-on GPUs × hours/monthIdle capacity held for peak trafficAutoscaling, MIG, batching, quantization
Storage$/TB-month, accumulates over timeDataset and checkpoint retentionLifecycle policies, checkpoint pruning
Egress$/GB transferred outCross-region traffic, external API responsesCo-locate compute and data, cache responses

The cost levers

Each lever attacks a different inefficiency. None of them is free — here's the honest tradeoff for each.

🔀

MIG partitioning

NVIDIA Multi-Instance GPU splits a single physical GPU into several isolated instances, so multiple low-utilization services — a small classifier, an embedding model, a lightweight API — can share one card instead of each reserving a full GPU. It meaningfully lowers cost for fleets of small models, but it caps the memory and compute available to any one instance, so it isn't the right fit for a workload that needs the whole GPU's memory.

🎯

Spot / preemptible instances

Spot capacity is priced at a large discount to on-demand because the provider can reclaim it with little notice. It's often the single biggest lever for training jobs that checkpoint regularly and can resume from the last saved state. The tradeoff is real: a job can be interrupted mid-run, so it only works with checkpointing and retry logic already in place.

📅

Reserved / committed-use pricing

Cloud providers discount hourly rates in exchange for a capacity commitment over a term — typically one or three years. This can cut steady-state inference cost meaningfully, since inference workloads run continuously and rarely need the flexibility spot or on-demand pricing is built for. The tradeoff is commitment risk: you're paying for capacity whether or not demand materializes as forecast.

📈

Autoscaling

Instead of holding peak capacity 24/7, autoscaling adds and removes inference replicas as traffic rises and falls. Since most inference traffic has a daily or weekly pattern, this can cut idle-hour spend substantially. The tradeoff is cold-start latency — scaling up takes time, so autoscaling needs headroom margin and warm-up strategy to avoid hurting the traffic spikes it's meant to serve.

🔢

Quantization

Running inference in INT8 or FP8 instead of FP16/FP32 cuts the memory footprint of a model and can raise throughput per GPU, since more requests fit in memory and more compute is available per token. The tradeoff is a small, workload-dependent accuracy cost — it should be validated against your own evaluation set, not assumed to be lossless.

📦

Continuous batching

Serving frameworks like vLLM and TGI batch concurrent requests together dynamically, rather than processing one request per GPU pass, which raises effective throughput per GPU for LLM serving. It's frequently the highest-leverage change for LLM inference cost, though the achievable gain depends on request-size variance and latency targets — very latency-sensitive workloads can't batch as aggressively.

None of these numbers are universal — the actual savings from any lever depend on your GPU type, utilization, and traffic pattern. Use the free GPU Cost Calculator to model spot pricing, reserved discounts, and utilization changes against your own inputs.

Modeling cost per request

Once inference is the dominant recurring cost, the metric that actually matters is cost per request, not cost per GPU-hour. The mechanism is simple:

cost per request = (GPU price per hour) ÷ (requests served per hour at your target latency and batch size)

Everything else in this page — MIG, batching, quantization, autoscaling — is really a way of moving one of those two numbers: lowering the effective GPU price, or raising the number of requests a GPU can serve per hour without breaking your latency target.

Illustrative example — not a benchmark

Say a GPU costs $2/hour and, at your target latency, serves 500 requests per hour — that's $2 ÷ 500 = $0.004 per request before overhead. Doubling throughput per GPU through continuous batching or a smaller quantized model halves that to $0.002 per request, with no change to the hourly GPU price. The same arithmetic works in reverse: if utilization drops and a GPU only serves 250 requests/hour, cost per request doubles even though nothing about the hardware or pricing changed.

Capacity planning

Training and inference need different planning models because their demand shapes are different. Training capacity should be planned around how many runs you expect per month and how many hours each run takes — it's a scheduling problem, and spare capacity between runs is straightforward to release or use for other work. Inference capacity should be planned around peak concurrent traffic plus a headroom margin for spikes and failover, with autoscaling handling the gap between peak and average so you aren't paying peak-capacity prices around the clock.

The free GPU Cost Calculator models exactly this split — separate GPU type, count, utilization, and run parameters for training and inference — so you can see how a change in run frequency or peak headroom moves your monthly bill before you commit to a cluster size.

Cloud vs on-premises

Cloud GPUs win when demand is bursty or uncertain: you pay for what you use, provision in minutes, and avoid a capital commitment before you know your real utilization pattern. On-premises or colocated GPUs can win when a workload runs at high, steady utilization over a multi-year horizon, since owned hardware amortizes below cloud on-demand and even reserved rates at high enough utilization — but it requires upfront capital, longer lead times to procure and deploy, and the operational burden of running the hardware yourself.

There is no fixed crossover point that applies to every organization — the right answer depends on your utilization and time horizon, which is exactly what scenario comparison in the GPU Cost Calculator is built to help you reason about before signing a multi-year contract either way.

Frequently asked questions

What is the biggest driver of GPU cost?
For most teams it's idle inference capacity, not training. Training runs are bursty and end, but inference GPUs are usually left running 24/7 to guarantee low latency, even when real traffic only uses a fraction of that capacity. Utilization — not the hourly GPU price — is typically the single biggest lever, which is why right-sizing and autoscaling tend to deliver more savings than chasing a cheaper GPU SKU.
Does quantization hurt model quality?
It can, but the impact is usually small and workload-dependent. Moving from FP16/FP32 to INT8 or FP8 reduces memory footprint and can raise throughput per GPU, but it introduces some numerical approximation that may show up as a small accuracy or quality regression on sensitive tasks. The right approach is to quantize, then evaluate on your own held-out test set before rolling it into production — don't assume the tradeoff is free, and don't assume it's prohibitive either.
Are spot instances safe for production inference?
They can be, but only with a design that tolerates preemption — think stateless replicas behind a load balancer with fast health checks and automatic replacement, or a spot/on-demand mix where a baseline of reserved or on-demand capacity absorbs traffic if spot is reclaimed. Spot is a much easier fit for training, where checkpointing lets a job resume after interruption. Running production inference entirely on spot with no fallback capacity is a reliability risk, not just a cost decision.
What's the difference between MIG and autoscaling for cost savings?
MIG partitions a single physical GPU into multiple isolated instances so several low-utilization workloads can share hardware instead of each getting a dedicated full GPU. Autoscaling changes how many GPU replicas are running over time, matching capacity to traffic instead of holding peak capacity around the clock. They solve different inefficiencies — MIG addresses workloads too small to fill a whole GPU, autoscaling addresses demand that varies by time of day — and most inference platforms benefit from combining both.
How do I estimate my monthly GPU bill before committing to a cluster size?
Model it explicitly rather than guessing: separate training GPU-hours (price × GPU count × utilization × hours per run × runs per month) from inference GPU-hours (always-on GPU count × utilization × hours per month), then add storage and egress. The free GPU Cost Calculator at /gpu-cost-calculator/ does exactly this and lets you compare scenarios — more training GPUs, lower utilization, spot pricing, reserved instances — before you commit to a cluster size or a vendor contract.

Want to know exactly what you'd save?

Run your own numbers through the free calculator, or bring your architecture to a cost review call and we'll model MIG, spot, reserved, and batching strategies against your actual workloads.

Written by Luca Berton — AI & Cloud Advisor, Docker Captain, former Red Hat engineer, 18+ years in enterprise infrastructure. More about Luca →

Free 30-min AI & Cloud consultation

Book Now