To keep the architecture evolvable without sacrificing reliability, random or round-robin load balancing destroys prefix cache hit rates across 64 GPUs; prefix-aware consistent hashing with bounded-load fallback preserves > 85% hit rates while preventing single-GPU hot spots.
TL;DR30-second simplified summary▾
Hashing the salted prefix onto a consistent-hash ring keeps warm prefixes localized on specific H100s. Bounded-load checks (1.25x cap) prevent hot-GPU queuing.
Offloading evicted GPU pages to 512 GB CPU DRAM cuts reload latency 10x compared to cold prefill.
Why Prefix Caching Is Mandatory at 2,000 Req/Sec.
Why this matters: Quantify why 2,000 req/sec on a 70B model requires RadixAttention prefix sharing to fit 8K-token prefixes in HBM.
Assume a 70B-parameter model (GQA, ~320 KB KV/token in FP16, or ~160 KB in FP8). An 8K-token prefix occupies 8,192 * 160 KB ≈ 1.3 GB per copy.
With 80% prefix sharing, RadixAttention stores that 1.3 GB once per active tenant/prompt instead of duplicating it per concurrent request, freeing 40+ GB HBM per GPU for higher batch sizes and cutting prefill compute by ~85%.
Why Prefix Caching Is Mandatory at 2,000 Req/Sec
1.KV Memory Math: 8,192 tokens x 160 KB/token (FP8) = ~1.3 GB per prompt prefix.
2.Prefill Bottleneck: Recomputing 8K prefixes at 2,000 req/sec would saturate dozens of extra H100s on redundant prefill.
3.Sharing Multiplier: Storing one physical 1.3 GB Radix prefix per active pod lets hundreds of requests reuse it zero-copy.
RadixAttention shares 1.3 GB 8K-token prefixes zero-copy across requests, cutting prefill FLOPs 5x at 2,000 req/sec.
Consistent Hashing with Bounded Loads on `(tenant_id, prefix_hash)`.
Why this matters: Route requests by consistent hashing on (tenant_id, prefix_hash) with bounded-load spillover to protect pod queues.
At the API gateway/router, tokenize (or hash normalized UTF-8 chunks) of the leading K=512 tokens combined with tenant_id. Look up the target GPU pod on a consistent-hash ring.
Before forwarding, check the pod's real-time active_prefill_tokens telemetry: if overloaded (> 1.25x cluster average), walk clockwise on the ring to the secondary replica.
Consistent Hashing with Bounded Loads on `(tenant_id, prefix_hash)`
1.Bounded-Load Routing: If the primary warm pod's queue exceeds 1.25x cluster average, spill to the next ring node.
2.Tenant Salt in Hash: Including tenant_id in the routing key prevents cross-tenant cache affinity probing.
3.512-Token Prefix Key: Hashing the first 512 tokens balances cache hit affinity with multi-turn conversation growth.
Consistent hashing with 1.25x bounded-load spillover preserves prefix cache affinity without overloading hot pods.
- Problem
- How to implement Design a Multi-Tenant LLM Inference Router with Zero-Copy RadixAttention Prefix Caching without hitting unbounded tail latency, state divergence, or operational fragility.
- Naive Solution
- Use a single unpartitioned path with unbounded retries and synchronous global coordination.
- Why It Fails
- Global coordination serializes throughput under load, while unbounded retries amplify transient stalls into full outages.
- Alternatives
- Compare synchronous strict-consistency paths against bounded asynchronous replication, local caching, or partitioned ownership.
- Engineering Decision
- To keep the architecture evolvable without sacrificing reliability, random or round-robin load balancing destroys prefix cache hit rates across 64 GPUs; prefix-aware consistent hashing with bounded-load fallback preserves > 85% hit rates while preventing single-GPU hot spots.
- Trade-Offs
- Gains predictable p99 latency and fault isolation in exchange for explicit bounding, observability, and slightly higher implementation complexity.
When Design a Multi-Tenant LLM Inference Router with Zero-Copy RadixAttention Prefix Caching experiences a sudden 5x traffic spike alongside a slow downstream dependency, which engineering choice best protects system stability?
Implementing Tenant-Isolated Prefix-Aware Routing.
Why this matters: Implement PrefixAwareRouter.select_pod to hash (tenant_id, prefix) and walk the ring until a non-overloaded pod is found.
import hashlib
class PrefixAwareRouter:
def __init__(self, ring, max_load_factor: float = 1.25) -> None:
self.ring = ring
self.max_load_factor = max_load_factorImplementing Tenant-Isolated Prefix-Aware Routing
1.Deterministic Ring Walk: Walking the ring in deterministic clockwise order concentrates spilled traffic on warm backups.
2.No Infinite Loop: If every candidate exceeds max_load_factor, pick the least-loaded pod or shed with 429.
3.Sub-Millisecond Route: SHA-256 + binary search over ring vnodes executes in <50 microseconds.
Clockwise ring walking with 1.25x bounded-load checks keeps routing sub-millisecond and queues balanced.
GPU HBM Radix Tree + Async CPU DRAM L2 Cache.
Why this matters: Tier GPU HBM Radix Trees with async PCIe Gen5 offloading to a 512 GB CPU-DRAM L2 KV cache.
Each GPU worker runs a local Radix Tree over PagedAttention blocks. When HBM utilization crosses 85%, leaf nodes with ref_count == 0 offload asynchronously over PCIe Gen5 (~64 GB/s) to a 512 GB CPU-DRAM L2 pool.
Reloading an 8K prefix (1.3 GB) from CPU DRAM takes ~20 ms—over 10x faster than cold GPU prefill.
GPU HBM Radix Tree + Async CPU DRAM L2 Cache
1.85% Watermark: Start background PCIe offloading at 85% HBM so active decodes never stall waiting for free pages.
2.16-Token Page Granularity: Fixed PagedAttention blocks transfer cleanly over pinned DMA buffers.
3.Leaf-First Eviction: Evict unreferenced leaf suffixes first, keeping shared system-prompt roots in HBM.
Async PCIe Gen5 offloading to 512 GB CPU DRAM retains 10x more KV prefixes and reloads 15x faster than recompute.
Integrating RadixAttention with Disaggregated Prefill/Decode Pods.
Why this matters: Disaggregate Prefill and Decode pods so heavy 16K-token prefills never cause inter-token latency spikes on decode.
Think of Integrating RadixAttention with Disaggregated Prefill/Decode Pods as the intuition layer for Design a Multi-Tenant LLM Inference Router with Zero-Copy RadixAttention Prefix Caching: Disaggregate Prefill and Decode pods so heavy 16K-token prefills never cause inter-token latency spikes on decode.
At 2,000 req/sec, mixing 16K-token prefills with active decode batches causes inter-token latency (ITL) spikes. Route cache misses and partial suffix prefills to dedicated Prefill Pods (which own the Radix Tree), then RDMA/NVLink-transfer only the final KV blocks to Decode Pods for smooth token streaming.
Integrating RadixAttention with Disaggregated Prefill/Decode Pods
1.Why Disaggregate: A single 16K-token prefill stalls all co-located decode streams for ~250 ms if run on the same GPU.
2.Prefill Owns Radix: Prefill pods maintain the Radix Tree and only transfer the active request's KV blocks to Decode.
3.Independent Scaling: Scale Prefill GPUs for TTFT and Decode GPUs for token throughput independently.
Disaggregating Prefill (Radix-owning) and Decode pods over RDMA eliminates prefill-induced decode jitter.
Enforcing Tenant Quotas & Zero Cross-Tenant Leakage.
Why this matters: Enforce zero cross-tenant leakage and noisy-neighbor isolation via salted Radix roots and per-tenant HBM quotas.
Think of Enforcing Tenant Quotas & Zero Cross-Tenant Leakage as the intuition layer for Design a Multi-Tenant LLM Inference Router with Zero-Copy RadixAttention Prefix Caching: Enforce zero cross-tenant leakage and noisy-neighbor isolation via salted Radix roots and per-tenant HBM quotas.
Salt every Radix Tree root with (tenant_id, model_version, lora_id) so cross-tenant hits are impossible. Pair global LRU with per-tenant HBM soft caps (e.g., max 25% of HBM per tenant) so a single tenant's 16K-token sweep cannot thrash other tenants' warm caches.
Enforcing Tenant Quotas & Zero Cross-Tenant Leakage
1.Side-Channel Closure: Salting every Radix root with tenant_id ensures Tenant B can never probe Tenant A's TTFT.
2.25% Soft Quota: One tenant flooding 32K-token prompts only evicts its own older leaves once above 25% HBM.
3.LoRA / Version Safety: Including model_version and lora_id prevents corrupt KV reuse across adapter switches.
Salted Radix roots and 25% per-tenant HBM caps eliminate timing side channels and noisy-neighbor cache eviction.
Scaling on Prefix Hit Rate, TTFT & KV Eviction Churn.
Why this matters: Track prefix hit ratio, TTFT p99, bounded-load spill rate, and graceful virtual-node draining during scale-in.
Think of Scaling on Prefix Hit Rate, TTFT & KV Eviction Churn as the intuition layer for Design a Multi-Tenant LLM Inference Router with Zero-Copy RadixAttention Prefix Caching: Track prefix hit ratio, TTFT p99, bounded-load spill rate, and graceful virtual-node draining during scale-in.
Monitor prefix_cache_hit_ratio, ttft_p99_ms, hbm_to_dram_offload_rate, and bounded_load_spill_rate. Use consistent-hash virtual-node draining during scale-in so only 1/N keys remap, and pre-warm newly added pods from a shared NIXL/RDMA KV store when traffic ramps.
Scaling on Prefix Hit Rate, TTFT & KV Eviction Churn
1.Spill-Rate Tuning: High bounded_load_spill_rate signals a hot tenant needs more vnode replicas or dedicated pods.
2.Graceful Scale-In: Drain departing pods' vnodes gradually so only 1/N prefixes cold-miss during autoscaling.
3.DRAM Offload Alert: Alert if PCIe offload bandwidth saturates, indicating HBM working set exceeded pod capacity.
Tracking prefix hit ratios, spill rates, and graceful vnode draining keeps multi-tenant TTFT fast during scaling.
Practice: Make the trade-off yourself.
Why does standard round-robin load balancing ruin RadixAttention prefix cache hit rates across 64 GPUs?