Skip to content
tezvyn:
Menu

Right-Size Inference and Stop Paying for Idle GPUs

MediumHow cards are made

Instance right-sizing matches inference to the smallest hardware that serves it without choking. It matters when GPU endpoints idle at 10% utilization. The footgun is copying your training spec into production; inference rarely needs that memory or multi-GPU.

Why it exists

Training and inference have fundamentally different hardware appetites. Training hammers GPUs for hours or days with massive gradients, large batches, and checkpoint memory. Inference usually serves one or a few requests at a time, often with smaller batches and no backpropagation. If you deploy on the same instance type you trained on, you are likely paying for silicon that sits idle.

The mental model

Think of inference hardware like a delivery vehicle fleet. A training cluster is a fleet of heavy freight trucks built to haul maximum load across long hauls. Inference is last-mile delivery: you need enough scooters and vans to handle peak dinner rush, but running freight trucks for pizza drops burns fuel and money while most of the cargo bed stays empty. Right-sizing means matching the vehicle to the package.

How it works

Start by profiling your model's actual inference behavior. Measure GPU memory utilization, CPU load, network ingress and egress, and latency percentiles under realistic traffic. Then map those metrics to the smallest instance family that holds the model weights in memory with enough headroom for the largest expected batch. Use load testing to find the saturation point where latency spikes. If you are on a cloud provider, this often means dropping from a multi-GPU training instance to a single-GPU or even CPU-optimized instance, or switching to inference-specific chips like AWS Inferentia or Google TPUs. Autoscaling groups can help, but only if the underlying instance type is itself right-sized.

When to use it

Use right-sizing when you move from research to production, when cost per prediction matters, or when your inference traffic is steady enough to baseline. It is especially valuable for models that fit in CPU memory or a single GPU but were trained on multi-GPU nodes. Also use it when you are running many microservices behind a model gateway; aggregate their loads and downsize individual instances rather than overprovisioning each one.

When not to use it

Do not right-size during initial load testing or chaos engineering, because artificial traffic patterns can hide real peaks. Avoid aggressive downsizing if your traffic is extremely spiky and cold-start latency from autoscaling would hurt user experience more than the savings. Also skip it if your model is memory-bound and already near the limit of the smallest available instance; shaving one percent of cost to risk out-of-memory kills is a bad trade.

One canonical example

A computer vision team trains a ResNet-style classifier on p3.8xlarge instances with four V100 GPUs and 64 GB of GPU memory. In production, the model receives an average of ten requests per second with batch size one. Profiling shows it uses 3 GB of GPU memory and one V100 runs at 15% utilization. The team migrates the endpoint to a g4dn.xlarge with a single T4 GPU and 16 GB of memory. Latency stays under 50 milliseconds, throughput exceeds demand, and the infrastructure cost drops by roughly two thirds.

Interview question

A model trained on a multi-GPU instance shows 15% GPU utilization when deployed to production inference on identical hardware. What is the most likely cause?

  • a.Inference workloads typically use smaller batches and no backpropagation, requiring far less compute than trainingCorrect
  • b.The inference framework is not configured to shard the model across all GPUs
  • c.Gradient checkpointing from training is still reserving GPU memory during inference
  • d.Network ingress is bottlenecking the GPU and preventing full utilization
Why?

The card states that training and inference have fundamentally different hardware appetites: inference uses smaller batches and no backpropagation, so deploying on training hardware leaves most silicon idle. Option B is tempting because it suggests a fixable configuration issue, but low utilization here reflects a natural workload mismatch, not a sharding error.

Just read this? Test yourself on what you have been reading.

Put your scrolling time to good use

Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Open roles that interview on mlops — each one lists the topics its interview covers.

See open roles