LIVE
News

Scaling AI Workloads: Why Containers and Kubernetes Are Essential for Production

You've got a model that works beautifully on your dev machine — great inference speed, clean outputs, the whole nine yards.

Tara Linsley·updated August 22, 2026

Scaling AI Workloads: Why Containers and Kubernetes Are Essential for Production

Then you push it to a shared GPU server and everything falls apart: a CUDA version mismatch silently corrupts outputs, a colleague's training job eats all the VRAM, and your carefully tuned vLLM config is now a crash log. If that pain point sounds familiar, it's because packaging AI workloads for real infrastructure is still one of the most underestimated gotchas in the ML stack — and containers plus Kubernetes remain the most battle-tested way to solve it.

Why containers matter more for ML than for typical apps

A container bundles your model, its runtime — PyTorch, TensorFlow, vLLM, whatever you're shipping — its Python dependencies, and its configuration into one portable image. That portability is nice for web apps, but it's critical for ML because our dependency trees are notoriously fragile. A stray library update or a CUDA driver mismatch can silently break inference accuracy or tank a training job without any obvious error. Locking everything into an image means the model behaves identically on your laptop, your on-prem GPU box, and your cloud cluster. If you've Dockerized a web service before, the workflow will feel familiar — right up until you hit the GPU driver dependency wall, which is where the real sanity-checking begins.

Kubernetes then takes that container and handles the operational plumbing: restarting failed pods, distributing load across nodes, and scaling replicas based on demand. Google's own experience illustrates the ceiling here — the company benchmarked a Google Kubernetes Engine cluster spanning 65,000 nodes specifically for AI workloads, a scale that would be unmanageable without container orchestration doing the heavy lifting.

The training-vs-inference split you can't skip

One of the most common mistakes teams make early on is treating training and inference as the same workload just because both involve a model. They're not — and packing them into the same container or the same cluster node pool creates headaches fast. Training jobs are bursty, resource-hungry, and tolerant of interruption: you spin up a fleet of high-end GPUs (A100s, H100s), run a batch job for hours or days, and release the hardware. Inference is the opposite — latency-sensitive, expected to run continuously, and usually fine on smaller, cheaper accelerators.

A widely referenced architecture pattern for production ML on Kubernetes recommends separating GPU node pools by workload type entirely: dedicated pools for training on pre-emptible A100/H100 instances, separate pools for inference on smaller on-demand GPUs like T4 or L4, and yet another pool for development work using GPU time-slicing to share hardware across engineers. The payoff isn't just tidiness — it lets you buy training capacity as cheap spot instances, with guidance pointing to savings of 60–70% on compute, while keeping inference infrastructure stable enough to meet SLAs. Industry commentary on running AI at scale pushes the isolation logic even further, arguing that training, inference, and shared services belong in genuinely separate clusters, not just separate node pools, so a failure stays contained to one layer instead of spreading.

Portable inference optimization is catching up

The container story doesn't end at deployment — optimizing inference itself is increasingly becoming agent-driven work. dstack recently released a preview of Presets, an open-source toolkit and portable format that records serving configurations, workloads, benchmarks, and verified hardware so optimized deployments can be reproduced across clouds, Kubernetes clusters, and bare-metal fleets. The idea is Docker-image-simple: you define a model, a fleet, constraints, and trial count, and an agent handles the profiling, patching, and experiment logging. In one documented example, optimizing Qwen3.8-27B on a single MI300X with a 1,000,000-token context window climbed from 184.81 tok/s to 440.91 tok/s across linked sessions — each inheriting the previous best and its findings so nothing gets re-derived.

What to check before you containerize your next model

Start with a clean base image that pins your CUDA and driver versions explicitly — don't rely on latest tags for anything touching GPU libraries. Separate your training and inference workloads into distinct node pools at minimum, and into separate clusters if your scale and budget allow it. Use pre-emptible or spot instances for training to cut costs, but keep inference on stable, on-demand capacity. And if you're optimizing inference across multiple hardware targets, look at emerging portable formats like Presets that let you carry your benchmarks and configurations with you instead of re-deriving them every time you change silicon. The boilerplate is boring, but it's what keeps your model running the same way tomorrow as it does today.