Why Embedding Inference Is the New Production Bottleneck
Every semantic search box, recommender feed, and RAG pipeline quietly depends on one thing: embedding models. They translate raw text, images, and audio into dense vector math that captures meaning — so that "cat" lands closer to "feline" than to "hat", even though the strings look nothing alike.
Prototyping with a small text embedding model is trivial. Scaling it to millions of queries per day with dynamic traffic spikes is a different sport entirely. The two walls every team hits:
- Elastic accelerator capacity — you can't spin up GPUs fast enough when traffic surges.
- Cost/performance efficiency — long-context and multimodal inputs burn HBM and compute fast.
Google Cloud's answer: bake native TPU support directly into vLLM, the open-source LLM serving engine the industry already standardizes on. That means one serving stack across GPUs and TPUs, with true elasticity via GKE Custom Compute Classes.
💡 For a broader picture of how AI is reshaping the developer workflow itself, see our analysis of how Spotify scaled developer experience for teams and agents.

The Engineering: What It Actually Takes to Run Embeddings on TPU
Serving next-gen embedding models in production means handling 4K+ token text contexts and 15K+ token multimodal inputs — while maintaining strict mathematical parity against reference hardware. Here's the four-part surgery the team performed on vLLM-TPU:
1. Hardware-Safe Vocabulary Padding
TPU Matrix Execution Units (MXUs) enforce strict divisibility constraints when sharding vocab matrices across topology meshes via Tensor Parallelism. The fix: a unified padding strategy that guarantees exact tensor alignment during All-Gather.
2. Lazy-Loader Compatibility
vLLM lazy-loads weights on TPU to cut cold-start latency. But lazy tensor transformations were breaking model init. The fix: attribute promotion inside the unquantization pipeline, making weight loading fully compatible with the lazy loader for zero-failure startup.
3. Sharding-Aware Pre-Warming
Runtime JIT compilation in multi-process deployments was causing compilation traps. The fix: pre-warm compilation caches (JAX/XLA) before inference so production rollouts stay stable.
4. StepPool for Chunked Prefill
Ultra-long contexts require chunked prefill to avoid HBM exhaustion — but that risks losing pooling state across step boundaries. The fix: a hybrid StepPool with metadata migrated into CachedRequestState, so pooling accumulates correctly and survives request preemptions.
Minimal Working Example
from vllm import LLM
# Initialize Qwen3-Embedding-8B on Cloud TPU using vLLM's native pooling runner
llm = LLM(
model="Qwen/Qwen3-Embedding-8B",
runner="pooling", # Enables dense pooling output
tensor_parallel_size=2, # Sharded across TPU topology mesh
max_model_len=16384,
max_num_batched_tokens=512,
dtype="bfloat16",
trust_remote_code=True
)
# Extract dense vector embeddings across inputs
prompts = ["Enterprise-grade semantic retrieval on TPUs with vLLM."]
results = llm.embed(prompts)
embedding_vector = results[0].outputs.embedding
That's it — a single LLM() call with runner="pooling" gets you dense embeddings on TPU. Full setup scripts live in the AI-Hypercomputer Qwen3-Embedding-8B recipe on GitHub.

Numerical Parity: The Non-Negotiable Requirement
Enterprise teams don't care about "good enough" embeddings. They care about reproducibility across hardware. If you train on XPU and serve on TPU, the vectors must match.
How Parity Is Measured
Given a TPU embedding v_Tpu and a reference XPU embedding v_Ref, the team computes cosine similarity:
cos_sim(v_Tpu, v_Ref) = (v_Tpu · v_Ref) / (||v_Tpu|| × ||v_Ref||)
Pass Thresholds
| Workload Type | Target Cosine Similarity |
|---|---|
| Text embedding | ≥ 0.999 |
| Multimodal (text + image) | ≥ 0.995 |
A score approaching 1.0 means near-perfect numerical parity — the TPU-optimized stack produces the same vectors as the golden reference, without sacrificing accuracy.
TPU vs. XPU Serving Tradeoffs
| Dimension | Cloud TPU + vLLM | Traditional XPU |
|---|---|---|
| Elastic scaling | GKE Custom Compute Classes, priority-based autoscaling | Manual node pools |
| Cost at scale | Optimized for long-context + multimodal | HBM-bound, expensive |
| Ecosystem maturity | Growing, backed by vLLM community | Mature |
| Parity risk | Requires padding + pre-warm tuning | Baseline reference |
⚠️ Limitations to Watch
- Compilation cold-start still exists; pre-warming mitigates but doesn't eliminate it.
- TPU topology constraints (MXU divisibility) mean some model shapes need padding — extra memory overhead.
- Multimodal parity (0.995) is a lower bar than text (0.999) — image embeddings remain harder to align.
- Community recipes are still young; expect rough edges in non-Qwen model families.
If you're building agentic systems that consume these embeddings, our deep dive on the Universal Commerce Protocol (UCP) for agentic commerce is worth a read next.

What This Means for Your Team
If you're running embedding inference at scale, the calculus has shifted:
- Stop treating TPU as a niche. vLLM's native pooling runner means the same code that serves LLMs can serve embeddings — no separate stack.
- Demand parity metrics. Ask your vendor (or your infra team) for cosine similarity benchmarks against a golden reference. Anything under 0.999 for text is a red flag.
- Plan for chunked prefill. Long-context embeddings without StepPool-style state handling will silently drop accuracy at step boundaries.
Next Steps to Learn
- Start here: Qwen3-Embedding-8B TPU Recipe — copy-paste setup scripts.
- Go multimodal: Qwen3-VL-Embedding-8B Recipe for text + image embeddings.
- Understand the engine: vllm-project/tpu-inference — the vLLM TPU backend source.
- Provision hardware: Google Cloud TPU Portal.
The bottleneck has moved. It's no longer whether you can serve embeddings — it's whether you can do it elastically, cheaply, and with mathematical precision across heterogeneous hardware. That's the bar now.
Source: Enterprise-Grade Precision for Long-Context Multimodal Embedding Inference on Cloud TPU — Google Developers Blog.