Zenaique

Why a self-hosted LLM deployment needs a warm up step before traffic and how it differs from cache priming

Flashcard·Easy·4.0 · 0·~30s·Asked atCognizantDeloitteObserve Ai
Attempt it
TL;DR

Startup loads weights, compiles kernels and pre-allocates the KV cache; warm-up requests then test the full path before traffic. Prompt cache priming warms the provider's KV cache, a different layer. Both are needed.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

Imagine a brand-new bakery oven on opening day. Picture pulling a loaf out at the right time when the oven was room-temperature when you started. The bread comes out raw, the line of customers backs up, and the owner blames the recipe. Getting an LLM pod ready is the same preheat. Load the weights, get the trays in place, allocate the rack space. Cache priming is a different thing. Think of it as making sure the dough you reach for most often is already proofed on the counter, not still frozen in the back. Both matter. Both happen before the first customer order. Skip either and the first hour of service is ugly.

Key concepts

Concept explanation~2 min read

Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.

Cold pods are the single most common cause of bad first-deploy outcomes for self-hosted LLM stacks. A team that has not encountered warm-up before will deploy a new pod, route traffic to it, watch the first batch of user requests time out, see the load balancer mark the pod unhealthy, and conclude that the runtime is broken. The runtime is fine; the deploy missed a step.

Three layers of cold-pod state

Layer 1, Weights in GPU memory. When a vLLM pod starts, the model weights have to load from disk (or a network blob store) into GPU memory. For a Llama 3.3 70B at FP8 this is roughly 70GB of data; transfer times are tens of seconds on fast local SSD, longer on network-attached storage. For 405B-class models the transfer can take minutes. Until weights are loaded the pod cannot serve any request, period.

The mitigations are infrastructure-side: pin the model to a node with fast local storage, use parallel sharded loading across multiple GPUs (vLLM supports this for tensor-parallel deployments), and avoid network-attached storage for the model directory unless the read bandwidth has been measured and is sufficient. A model-registry cache (Hugging Face Hub mirror, or a private blob store with prefetching) can shave additional time off cold starts.

Layer 2, Compiled CUDA kernels and graphs. vLLM uses specialized CUDA kernels (PagedAttention, fused MLPs, sampling). At startup it compiles the model and captures CUDA graphs for a list of batch sizes; later batches are padded to a captured size. All compilation finishes before the server serves any request, so this cost lands in pod start time rather than on the first user requests.

Layer 3, PagedAttention block pool. vLLM pre-allocates the physical KV block pool on the GPU at startup, from a set share of GPU memory (gpu_memory_utilization). The pool exists before the first request, and sequences pull blocks from the free list at near-zero cost. This layer is the cheapest of the three.

What warm-up actually does
Warm-up vs prompt cache priming
Readiness probes and the serialization discipline
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.

Real products, models, and research that use this idea.

  • Llama 3.3 70B served on vLLM with a warm-up script that sends three synthetic requests covering short, medium, and long input lengths before the readiness probe passes.
  • SGLang deployment with a Kubernetes readiness probe that fails until the warm-up endpoint returns success; the LB only routes after warm-up.
Sign in to see more production examples.

What an interviewer would ask next. Try answering before peeking at the approach.

QHow would you design the warm-up script for a workload that has very long input contexts (32K-128K tokens) and unpredictable output lengths?
A

Sample a few representative input lengths from the actual distribution (not synthetic uniform samples), for example one short, one mid, one near-max. For each, generate a representative output length that exercises the long-generation path. Cap the warm-up budget at a few seconds total; you do not need exhaustive coverage. The goal is exercising the hot path end to end, not warming every possible shape. Verify warm-up effectiveness by measuring p99 time to first token on the first 10 production requests; if it matches steady-state, warm-up is sufficient.

1 more follow-up an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Conflating warm-up with prompt cache priming. Warm-up is about the local pod's state; prompt cache priming is about the provider's KV cache for a stable prefix. Different layers, different mitigations.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • The three cold-pod costs: weight loading, kernel compilation, KV-allocator initialization

  • Why warm-up sends representative input lengths rather than one canonical shape

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
Compare the unit of change that LLMOps ships against the unit MLOps ships
Flashcard·Easy