Repository navigation
Conversation
✅ Deploy Preview for llm-d ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
65ba158 to
d42fc8a
Compare
|
/assign @ahg-g |
…ng and llm-d Signed-off-by: Yuchen Tian <[email protected]>
Signed-off-by: Yuchen Tian <[email protected]>
eb5cd50 to
9de3c62
Compare
ahg-g
left a comment
There was a problem hiding this comment.
Thanks for putting this together, I think this is good, but we should not regress from what we guided before on using wide-ep with data parallelism for GLM agentic deployments.
| * 78 transformer layers | ||
| * Compressed KV latent vector: $512\text{ (kv\_lora\_rank)} + 64\text{ (qk\_rope\_head\_dim)} = 576\text{ elements/layer}$ | ||
| * KV cache precision: FP8 (1 byte per element) | ||
| * **KV Footprint:** $576 \times 78 \times 1\text{ byte} = \mathbf{44.93\text{ KB per token}}$ (replicated across all 8 GPU ranks under TP=8). |
There was a problem hiding this comment.
Using TP=8 is not ideal as demonstrated previously in https://llm-d.ai/blog/serving-glm-5-2-agentic-workloads-on-llm-d#wide-expert-parallelism; the issue is that with TP=8, the kv-cache has to be duplicated across all ranks within a node, while with EP+DP the kv-cache is sharded. I am not sure this evaluation will look credible/useful if we only show TP=8.
| * **The Problem — KV Cache Capacity Collapse:** GLM-5.2's Multi-Head Latent Attention (MLA) compresses the KV cache to 44.93 KB/token. However, with ~744 GB of model weights on an 8× B200 node (1,440 GB total HBM), remaining HBM holds only ~1.16M tokens (~14 sessions of 80k tokens). Beyond 14 concurrent sessions, prefix eviction triggers a **10.8× compute surge**, causing queue timeouts and 429 shedding. | ||
| * **The Solution — 3-Tier Storage Hierarchy:** | ||
| 1. **Tier 1 (L1 GPU HBM):** Ultra-low latency for active decoding. | ||
| 2. **Tier 2 (L2 Host CPU DRAM):** Allocating 2.0 TB of Host DRAM per node (`--hicache-size=250`) expands resident KV cache capacity by **38.4× to 44.5 Million tokens**, retrieving cached prefixes over PCIe Gen5 in **10–20 ms**. |
There was a problem hiding this comment.
Is this true? since we are using TP=8, the kv-cache will be duplicated, not sharded across the ranks, and so the calculation should be 250GB/44K ~= 5.5M tokens only, not 44.5M.
| * KV cache precision: FP8 (1 byte per element) | ||
| * **KV Footprint:** $576 \times 78 \times 1\text{ byte} = \mathbf{44.93\text{ KB per token}}$ (replicated across all 8 GPU ranks under TP=8). | ||
|
|
||
| A single `a4-highgpu-8g` node features 8× NVIDIA B200 GPUs (180 GB HBM3e each, totaling 1,440 GB HBM). Model weights consume ~744 GB. At standard memory reservation fractions, roughly **696 GB remains for KV cache**, accommodating approximately **1.16 Million KV cache tokens**. |
There was a problem hiding this comment.
roughly 696 GB remains for KV cache, accommodating approximately 1.16 Million KV cache tokens.
A couple of things:
- a significant part of HBM memory goes to memory buffers, cuda graphs and whatnot, the amount left for kv-cache is materially less than 696GB, we should be precise on how much memory was actually left for kv-cache from the experiment.
- If we assume 696GB, then the number 1.16M tokens doesn't sound right: 44KB x 8 ranks (since the kv-cache is duplicated), that adds up to 352KB / token, so 696GB/352KB ~= 1.9M tokens on a single node. Based on the actual memory we managed to allocate, the math should add up as to how many tokens that kv-cache can hold.
| As soon as concurrency exceeds 14 active sessions: | ||
| 1. **Eviction Storm:** GPU HBM fills up, and SGLang's radix tree evicts the oldest session prefixes. | ||
| 2. **Recomputation Penalty:** When an evicted session resumes, the GPU must re-prefill all 80k–130k tokens. At a measured single-node B200 prefill throughput of **24,027 tokens/second**, recomputing 130k tokens takes **5.41 seconds of 100% GPU compute**. | ||
| 3. **Queue Collapse:** As multiple sessions resume concurrently, incoming prefill demand explodes to over **260,000 tokens/second**—surpassing physical GPU compute by **10.8×**. The request queue saturates, time-to-first-token spikes to 30+ seconds, and ingress gateways begin rejecting traffic with HTTP 429 (Too Many Requests). |
There was a problem hiding this comment.
With TP=1, EP=8 and DP=8, the concurrency that the node can sustain will likely be much higher than 14 (roughly 8x higher), similar to the other comment, using TP=8 is not going to be looked at as credible baseline.
|
|
||
| ## Decision Matrix: When is KV Cache Offloading Helpful? | ||
|
|
||
| Before diving into hardware math and benchmark traces, platform engineers evaluating SGLang should understand under what workload conditions hierarchical offloading delivers substantial ROI: |
There was a problem hiding this comment.
this is not specific to sglang
| | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | | ||
| | **$C = 2$** | Tier 1: Hot GPU HBM | 74 turns | **2.34 s** | 5.21 s | 6.29 ms | **159.1 tok/s** | 3.22 s | | ||
| | **$C = 8$** | Tier 2: HiCache Host DRAM | 149 turns | **3.42 s** | 12.27 s | 8.15 ms | **122.6 tok/s** | 4.17 s | | ||
| | **$C = 16$** | Tier 2: DRAM Saturation | 305 turns | **3.74 s** | 10.18 s | 7.49 ms | **133.5 tok/s** | 3.68 s | |
There was a problem hiding this comment.
pls be consistent in the naming of the storage tiers
|
|
||
| | Concurrency Level | Primary Storage Tier | Total Turns Served | P50 TTFT (s) | P90 TTFT (s) | Median TPOT (ms) | Gen Speed (tok/s) | P50 Request Latency (s) | | ||
| | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | | ||
| | **$C = 2$** | Tier 1: Hot GPU HBM | 74 turns | **2.34 s** | 5.21 s | 6.29 ms | **159.1 tok/s** | 3.22 s | |
There was a problem hiding this comment.
I suspect that if we switch to EP/DP=8, TPOT will rise (roughly 2x or 3x), but since we will have 8 servers running in parallel, we will get 8x the throughput
| | Concurrency Level | Primary Storage Tier | Total Turns Served | P50 TTFT (s) | P90 TTFT (s) | Median TPOT (ms) | Gen Speed (tok/s) | P50 Request Latency (s) | | ||
| | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | | ||
| | **$C = 2$** | Tier 1: Hot GPU HBM | 74 turns | **2.34 s** | 5.21 s | 6.29 ms | **159.1 tok/s** | 3.22 s | | ||
| | **$C = 8$** | Tier 2: HiCache Host DRAM | 149 turns | **3.42 s** | 12.27 s | 8.15 ms | **122.6 tok/s** | 4.17 s | |
There was a problem hiding this comment.
The tok/s here is a bit misleading, IIUC this is calculated as 1/ , which means it doesn't factor in prefill time, right?
|
|
||
| --- | ||
|
|
||
| ### 3. Fleet Scaling Fronted by llm-d Router (EPP) |
There was a problem hiding this comment.
"Multiple Replicas Fronted"
| | Benchmark Stage | Concurrency (Sessions) | Successful Turns Completed | Prompt Tokens (Mean / P90) | Output Tokens (Mean / P90) | TPOT Med (ms) | Gen Speed (tok/s) | | ||
| | :--- | :--- | :--- | :--- | :--- | :--- | :--- | | ||
| | **10 QPS Target Fleet Load** | **20 concurrent** | **871 turns** | 68,372 / 115,447 | 1,353 / 3,485 | **7.10 ms** | **140.8 tok/s** | | ||
| | **20 QPS Peak Fleet Load** | **50 concurrent** | **89 turns** | 25,897 / 59,879 | 452 / 926 | **4.36 ms** | **229.2 tok/s** | |
There was a problem hiding this comment.
I assume the toks /s reported here is per node, we should report it for the whole deployment
|
This PR is marked as stale after 21d of inactivity. After an additional 14d of inactivity (7d to become rotten, then 7d more), it will be closed. To prevent this PR from being closed, add a comment or remove the |
|
Closing in favor of #530 — thanks @ahg-g for the thorough review. We extended the upstream SGLang wide-EP P/D recipe ( |
Add "Serving GLM-5.2 on SGLang with llm-d: Wide-EP, Host DRAM, and Shared Storage" with six figures. The post benchmarks the SGLang variant of the GLM-5.2 well-lit path (v0.5.23, DEP8 prefill + DEP8 decode on 16x H200) across a three-tier KV cache: L1 GPU HBM, L2 host DRAM (HiCache) and shared L3 storage (hicache-fs on a ReadWriteMany volume). It answers two questions with 900 s aiperf sweeps and paused multi-turn replays: when each KV tier helps and by how much (L1 alone thrashes past concurrency 32; host DRAM raises c128 output 3.94x; shared storage costs 14-33% median TTFT in steady state but restores cold ranks and restarted pods 49-57% faster than recomputing), and how SGLang compares with the earlier vLLM wide-EP runs under the same protocol, labeled indicative with the cluster, fabric, build and router differences spelled out. A sizing table maps agentic workload scenarios to tier sizes. Authors: tyuchn, nishjain, zetxqx and sagearc (the last two built the upstream SGLang wide-EP recipe the post extends). Adds the gke tag. Supersedes llm-d#490. Signed-off-by: Yuchen Tian <[email protected]>
* blog: Serving GLM-5.2 on SGLang with llm-d Add "Serving GLM-5.2 on SGLang with llm-d: Wide-EP, Host DRAM, and Shared Storage" with six figures. The post benchmarks the SGLang variant of the GLM-5.2 well-lit path (v0.5.23, DEP8 prefill + DEP8 decode on 16x H200) across a three-tier KV cache: L1 GPU HBM, L2 host DRAM (HiCache) and shared L3 storage (hicache-fs on a ReadWriteMany volume). It answers two questions with 900 s aiperf sweeps and paused multi-turn replays: when each KV tier helps and by how much (L1 alone thrashes past concurrency 32; host DRAM raises c128 output 3.94x; shared storage costs 14-33% median TTFT in steady state but restores cold ranks and restarted pods 49-57% faster than recomputing), and how SGLang compares with the earlier vLLM wide-EP runs under the same protocol, labeled indicative with the cluster, fabric, build and router differences spelled out. A sizing table maps agentic workload scenarios to tier sizes. Authors: tyuchn, nishjain, zetxqx and sagearc (the last two built the upstream SGLang wide-EP recipe the post extends). Adds the gke tag. Supersedes #490. Signed-off-by: Yuchen Tian <[email protected]> * blog(glm-5-2): drop the GKE-specific appendix Remove the deployment-details appendix (cluster, node, driver and version table), which was specific to the GKE testbed. Keep the cloud-agnostic part, the AIPerf invocation behind every load-sweep number, as the last step of 'Running the recipe'. Signed-off-by: Yuchen Tian <[email protected]> * blog(glm-5-2): align deepep_v2 bullet with uniform hybrid mode Signed-off-by: Yuchen Tian <[email protected]> * blog(glm-5-2): fix L2 hit-rate range, PCIe DMA wording, and L3 overhead split Signed-off-by: Yuchen Tian <[email protected]> * blog(glm-5-2): restructure around Wide-EP and L3 trade-off, improve prose clarity Signed-off-by: Yuchen Tian <[email protected]> * blog(sglang): reposition around first-class llm-d integration, multi-replica L3, and co-authors Signed-off-by: Yuchen Tian <[email protected]> * blog(sglang): add author photo for Nishtha Jain Signed-off-by: Yuchen Tian <[email protected]> * blog(sglang): remove redundant benchmark tables in Section 3 Signed-off-by: Yuchen Tian <[email protected]> * blog(sglang): tighten title and prose, address DisaggregatedSet and L3 failover feedback Signed-off-by: Yuchen Tian <[email protected]> * blog(sglang): clarify observability changes, L3 filesystem overhead, and GiB units Signed-off-by: Yuchen Tian <[email protected]> * blog(sglang): dedup authors, update Figure 1, and clarify routing and L3 benchmarks Signed-off-by: Yuchen Tian <[email protected]> * blog(sglang): set publish date to 2026-11-23 Signed-off-by: Yuchen Tian <[email protected]> --------- Signed-off-by: Yuchen Tian <[email protected]>
What does this PR do?
Adds a blog post sharing our production evaluation of hierarchical KV cache offloading with
SGLang and llm-d on GKE with NVIDIA B200 GPUs (
a4-highgpu-8g), serving GLM-5.2-FP8 underreal multi-turn agentic coding traces. The post covers:
holds only ~1.16M tokens (~14 concurrent 80k-token sessions), and eviction beyond that forces a
~5.4s full prefill recompute per resumed turn
L2 Host CPU DRAM (
--hicache-size=250, 2.0 TB/node), and L3 shared remote storage(
--hicache-storage-backend=file) backed by Google Cloud Managed Lustrestorage tiers each one needs
inference-perf:528 multi-turn requests over 68 minutes, with zero OOMs, crashes, or restarts
reduction (14.28s → 0.89s) on an isolated sequential 124k-token turn-2 resumption
llm-d-router(EPP):871 turns at 10 QPS target load and 229.2 tok/s generation at 20 QPS peak
llm-d-routerEndpointPickerConfig, includingsizing
lruCapacityPerServerto cover the combined HBM + Host DRAM poolSupporting changes:
blog/authors.yml: addtyuchnandnishjainblog/tags.yml: add thegketagdocusaurus.config.js: enableremarkMath/rehypeKatexon the blog plugin so LaTeX in blogposts renders (they were already enabled for docs, but not for blog)
Why is this change needed?
Agentic coding workloads (65k–130k+ token prompts, dozens of turns, long tool-execution pauses)
break the assumptions behind HBM-only KV caching. This post gives platform teams the capacity math,
the measured trade-offs of each storage tier, and a reproducible configuration for SGLang HiCache
plus
llm-d-routerso they can size and deploy tiered prefix caching instead of paying repeatedfull-prefill recomputes.
How was this tested?
npm test)npm run build:all)npm run check-links)npm run serve)Verified the rendered post on the Netlify deploy preview: KaTeX formulas, tables, Mermaid diagram,
figures, and both author cards render correctly. The link checker reports no broken links
introduced by this PR (the two remaining failures are pre-existing, in synced
llm-d/llm-ddocs).Checklist
git commit -s) per DCOnpm test)npm run build:all)npm run check-links)Related Issues
None.