When serving >100 LoRA adapters with skewed traffic, pair Punica SGMV kernels with unified HBM paging and consistent-hash routing to keep cold misses under 15 ms.
TL;DR30-second simplified summary▾
By keeping W_0 frozen and shared, SGMV batches mixed-tenant tokens in one Tensor Core pass. Unified Paging prevents HBM fragmentation, while pinned CPU RAM absorbs cold adapter prefetches over PCIe Gen5 in ~2.3 ms.
P & R: The Multi-Tenant HBM Bottleneck & Intuition.
An H100 GPU has 80 GB of HBM3 at 3.35 TB/s. After loading a 4-bit/FP8 70B base model (~38 GB) and CUDA runtime (~4 GB), only 38 GB remains for both KV-cache blocks and tenant adapters. If you merge LoRA weights into W_0 per request, you cannot batch Tenant A and Tenant B in the same forward pass. Instead, linearity of matrix multiplication lets us factor Y = X(W_0 + BA) = XW_0 + X(BA). Every tenant's token shares the exact same XW_0 GEMM, while only the tiny rank-r (r=16) correction XBA differs per tenant.
Linearity Factorization for Shared Base Batching
I & M: Punica SGMV Kernel & Unified Paged HBM Pool.
Punica's SGMV kernel accepts a batch of hidden states X, a segment pointer array mapping contiguous token slices to adapter IDs, and page-table pointers to each adapter's non-contiguous A and B tiles in HBM. S-LoRA eliminates external HBM fragmentation by allocating both KV-cache blocks and LoRA adapter weights from the same fixed-size page pool (e.g., 64 KB pages). When a cold adapter misses HBM, an asynchronous CUDA stream prefetches its 146.8 MB safetensors pages from pinned CPU host RAM over PCIe Gen5 (64 GB/s -> ~2.3 ms) or local NVMe (<15 ms) without stalling active decode steps.
Unified Paged HBM Pool & PCIe Prefetch Hierarchy
E: Edge Cases, Adapter Thrashing & When NOT to Use S-LoRA.
If a burst of 200 distinct cold adapters hits a single GPU node simultaneously, PCIe prefetch queues saturate and LRU eviction thrashes active adapters. Mitigate this via bounded-load consistent hashing (capping per-node queue depth at 1.25x average) and admission shedding for unpinned free-tier adapters when HBM hit rate drops below 80%. When NOT to use S-LoRA: if you serve fewer than 3 high-QPS adapters per cluster, offline-merging W_0 + BA into dedicated TensorRT-LLM/vLLM replicas eliminates the ~5-8% SGMV kernel overhead.
Adapter Cache Admission & Thrashing Circuit Breaker
Interactive Visual Simulation
Mixed-Tenant SGMV Decode Step Trace
Inference Gateway
Bounded-Load Consistent Hash
Pod 07 Batch Scheduler
Continuous Batching
Unified HBM Page Pool
KV + LoRA Page Table
H100 Tensor Core + SGMV
Shared W_0 + Delta Compute
adapter_id
tenant-42-v2
target_pod
Pod 07
load_factor
1.08x
- Problem
- How to serve 100 to 10,000+ tenant LoRA adapters on shared 80 GB H100 GPUs without duplicating the 140 GB base model W_0 or breaking continuous batching.
- Naive Solution
- Deploy dedicated GPU replicas per adapter or dynamically merge W_0 + (alpha/r)BA into GPU memory on every incoming request.
- Why It Fails
- Dedicated replicas exhaust GPU fleets at low utilization, while per-request weight merging serializes batches and triggers 500 ms to 2 s swap stalls.
- Alternatives
- Compare S-LoRA unified paging with Punica SGMV kernels against offline-merged dedicated replicas (TensorRT-LLM/vLLM) or naive dynamic LoRA swapping.
- Engineering Decision
- Use S-LoRA unified KV-plus-adapter paging with Punica SGMV kernels and bounded-load consistent hashing when serving 100+ Zipfian adapters; use offline-merged dedicated replicas only when serving fewer than 3 high-QPS flagship adapters.
- Trade-Offs
- Eliminates base model duplication and swap stalls for long-tail adapters, at the cost of ~5-8% SGMV kernel overhead and custom CUDA kernel maintenance.
During a product launch, 150 cold enterprise tenants hit Pod 07 simultaneously, dropping HBM adapter cache hit rate from 95% to 62% and spiking decode p99 from 45 ms to 320 ms. What is the root cause and immediate fix?
Practice: Make the trade-off yourself.
Why does merging LoRA weights (W_0 + BA) per request fail in high-throughput multi-tenant LLM serving?