Repository navigation
[Blog]: Bringing First-Class SGLang Serving to llm-d - #530
Conversation
👷 Deploy request for llm-d pending review.Visit the deploys page to approve it
|
45c59bb to
a52bcad
Compare
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]>
8f56d41 to
2dcaf3c
Compare
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]>
Signed-off-by: Yuchen Tian <[email protected]>
zetxqx
left a comment
There was a problem hiding this comment.
Thanks for putting this together! A few high-level thoughts before the line-level comments:
-
Overlap with the earlier post. This post covers much of the same ground as Serving GLM-5.2 for Agentic Workloads on llm-d: same model, hardware, trace, and benchmark protocol, and the same conclusions on the traffic shape, MLA/DEP memory fit, CPU/DRAM offloading, MTP, and prefill being the bottleneck. The new part is Shared L3. cc @ahg-g: do we want to reshape this post around what's new, or add more distinct value before publishing?
-
vLLM comparison. I'd drop it entirely: the comparison section (L192-223) and Figure 5, the TL;DR bullet (L49), the vLLM reference in Figure 2 / L127, and the engine A/B item in "Where this goes next". llm-d is engine-neutral, and I don't think we want to run engine-vs-engine comparisons in our blog.
-
Showing the value of Shared L3. The steady-state load sweep isn't the best fit: there, L3 mostly adds write-through overhead on top of L2. L3 helps when local tiers are empty or out of reach, so these cases would show its value more directly:
- Cold start: a new or restarted prefill pod serving returning sessions.
- Scale-out: adding a prefill replica mid-run and measuring how quickly it serves warm prefixes.
- Rolling upgrades or Spot preemption during a sustained run.
- Cross-replica routing: sessions landing on a replica that has never seen them (for example multi-replica
p2w1d1w2). - Long-idle resumes: sessions that come back after their prefix was evicted from host DRAM.
The cold-DRAM recovery runs (
-49%–57%TTFT) are a good start; a TTFT time series around a restart or scale-out event would make the case clearer.
…ad split Signed-off-by: Yuchen Tian <[email protected]>
Signed-off-by: Yuchen Tian <[email protected]>
|
Thanks for the thorough review @zetxqx! I updated the two inline comments in On (3), just in case it got buried after the I'll check with @ahg-g on the structural questions in (1) and (2) before reshaping the sections. |
|
@zetxqx good points, strongly agree with 1 |
…rose clarity Signed-off-by: Yuchen Tian <[email protected]>
|
Thanks again for the thoughtful reviews @sagearc @zetxqx! Pushed
PTAL when you get a chance! |
Signed-off-by: Yuchen Tian <[email protected]>
…replica L3, and co-authors Signed-off-by: Yuchen Tian <[email protected]>
Signed-off-by: Yuchen Tian <[email protected]>
Signed-off-by: Yuchen Tian <[email protected]>
…3 failover feedback Signed-off-by: Yuchen Tian <[email protected]>
ShangmingCai
left a comment
There was a problem hiding this comment.
Great E2E PoC blog. No other comment, just some minor issues.
| | :--- | :--- | :--- | | ||
| | **One node-level port hid eight separate KV caches behind a single endpoint.** | Leveraged the embedded Rust HTTP server for each DP rank with per-rank warmup readiness. | Every DP rank across single- and multi-node pools is a routable `InferencePool` endpoint. | | ||
| | **`P/D` pairing only worked on rank 0; routing to any other rank failed during the handshake.** | Replicated `P/D` pairing state across all rank listeners, carried routing metadata across OpenAI and native APIs, used standard Linux `DMA-BUF` RDMA for KV transfers, and added clean decode cancellation on prefill failure. | `EPP` can pair any prefill rank with any decode rank across nodes on standard GPU nodes. | | ||
| | **Operators and routers lacked per-rank visibility into serving and cache hits.** | Surfaced `cached_tokens` in responses, correlated `P/D` traces and logs across nodes, and added DP-aware KV-event handling in `EPP`. | Per-endpoint visibility in logs and traces, supporting zero-scrape approximate routing today and preparing exact KV-event tracking. | |
There was a problem hiding this comment.
For OpenAI usage, might need --enable-cache-report to enable this?
There was a problem hiding this comment.
Checked the Rust server path (SGLANG_RUST_SERVER=1): --enable-cache-report isn't wired on its OpenAI endpoints yet, and sgl-project/sglang#43365 (for native /generate cached_tokens metadata) is still open, so in our benchmarks we read cache hits from the prefill scheduler logs. Updated this row in 3fe9915 to reflect what actually shipped (/server_info metadata parity, correlated P/D logs and traces, and SGLang KV-event decoding in EPP).
048613e to
5b06a7a
Compare
…and GiB units Signed-off-by: Yuchen Tian <[email protected]>
5b06a7a to
3fe9915
Compare
ahg-g
left a comment
There was a problem hiding this comment.
Great post overall. The architecture, recipes, and benchmark claims hold up well. Left a few inline comments (including regenerating Figure 1 and deduping authors.yml).
| socials: | ||
| github: https://github.com/jtechapps | ||
|
|
||
| tyuchn: |
There was a problem hiding this comment.
some of the authors already exist in the authors.yml list, please dedup
There was a problem hiding this comment.
Done in 33064d0: removed the duplicate ahg-g entry and switched the frontmatter to abdullahgharaibeh (the other 6 entries are new).
| <!-- reading-time-exclude:end --> | ||
|
|
||
| <Figure | ||
| src="/img/blogs/glm52-sglang-tiered-kv/topology-tiered-architecture.png" |
There was a problem hiding this comment.
Regenerate Figure 1 to remove "Surfaces cached_tokens in responses" from the Per-Rank Observability card, and update routing-proxy (:8000->:8200) to (:8000-8007->:8200-8207).
Why: The Section 2 table was updated in 3fe9915 because cached_tokens is not yet wired on the Rust server OpenAI or native /generate paths, so Figure 1 currently contradicts the text and shipped behavior. Showing all eight proxy ports also matches --data-parallel-size=8 and InferencePool (:8000-8007/pod).
There was a problem hiding this comment.
Done in 33064d0: regenerated Figure 1 with (:8000-8007->:8200-8207) on routing-proxy and updated the Per-Rank Observability card to match Section 2.
|
|
||
| * **Declarative disaggregated orchestration:** Multi-node prefill and decode pools run as native Kubernetes workloads through `DisaggregatedSet`, with coordinated gang scheduling, rolling updates, and Dynamic Resource Allocation for GPUs and RDMA NICs. Scaling from a single-replica `16`-GPU deployment to multi-replica `32`- or `64`-GPU Wide-EP pools uses the same declarative overlays and operational lifecycle across engines. | ||
| * **Per-DP-rank `InferencePool` endpoint discovery:** Rather than exposing a multi-GPU pod as one aggregated endpoint, `llm-d` registers each attention-DP rank as its own `InferencePool` endpoint, following the design from the [earlier GLM-5.2 post](/blog/serving-glm-5-2-agentic-workloads-on-llm-d#fitting-repository-scale-sessions-in-memory). This lets the router see and target each GPU's separate KV cache directly. | ||
| * **Pluggable `Endpoint Picker` (`EPP`) routing pipeline:** Fronted by Envoy and the Kubernetes Gateway API, the `EPP` inference router parses each request and tracks, per rank, which prefixes are cached and how many tokens are in flight. It sends prefill requests back to the rank that holds the warm prefix, spreads decode requests by active request count, and coordinates the prefill-to-decode transfer. |
There was a problem hiding this comment.
Clarify that EPP selects the prefill and decode endpoints while the decode routing-proxy sidecar coordinates the prefill-to-decode transfer.
Why: EPP runs in the control path and sets the prefill target header, whereas routing-proxy on the decode pod performs the SGLang P/D bootstrap handshake and dispatches both legs.
There was a problem hiding this comment.
Done in 33064d0: clarified that EPP selects the prefill and decode ranks while the decode routing-proxy sidecar runs the P/D handshake and dispatches both stages.
| <strong>Figure 3:</strong> L2 host RAM eliminates the L1 thrashing cliff on a single 16-GPU replica. | ||
| </Figure> | ||
|
|
||
| Past concurrency `32`, active sessions exceed the `2.09M`-token `HBM` budget and evict one another, dropping the cache hit rate to `6.0%` and pushing median TTFT to `174.2 s` at concurrency `128`. Offloading to `L2` host RAM preserves `85%–95%` cache reuse across the full sweep, cuts concurrency-`128` median TTFT **`8.7x`**, and raises output **`3.94x`**—whereas adding `Shared L3` on a single warm pod pays network filesystem read, metadata, and backup overhead, raising median TTFT by `~26%–30%` and trimming concurrency-`128` output by `~9%` for no significant extra benefit. |
There was a problem hiding this comment.
Qualify the Shared L3 steady-state overhead with the tested file backend settings (write_through + wait_complete), and verify whether the 1P1D range should read +14%–33% (full c16–c128 sweep) or state the concurrency points.
Why: Without naming write_through and wait_complete, readers can attribute the +26%–66% TTFT overhead to all Shared L3 backends or async/timeout prefetch policies. On 1P1D, c64 in Figure 3 is also slightly above 30% (3.8 s vs ~5.0 s).
There was a problem hiding this comment.
Done in 33064d0: qualified the Shared L3 overhead with our file backend settings (write_through backups + synchronous wait_complete prefetches) and updated the 1P1D range to 14%-33% across concurrencies 16 to 128 (+14.4% at c16, +25.9% at c32, +32.6% at c64, +29.6% at c128).
|
|
||
| ### Multi-replica Shared L3 on 32x H200 | ||
|
|
||
| `Shared L3` pays off across multi-replica failover, pod evictions, and cold restarts. To test this, we scale out to `32` H200 GPUs across two 8-GPU prefill pods and one 2-node 16-GPU decode pool. We measure both sustained load at `64` and `128` concurrent sessions and a live failover test: with `24` active `~98K`-token sessions split across `prefill-0` with `11` sessions and `prefill-1` with `13` sessions, we delete `prefill-0` at `t = 95 s` so `EPP` moves all `11` of its sessions onto `prefill-1`: |
There was a problem hiding this comment.
Add one sentence describing the cold-replica recovery test (16 sessions of ~92K tokens replayed against a freshly restarted prefill pod) and note that the 26% to 66% L3 overhead spans c64 and c128.
Why: Both the TL;DR and Section 3 headline the 57% cold-start TTFT drop (38.8 s -> 16.8 s), but the prose never explains what the cold-start experiment measured. Figure 4 also only plots c128 (+66%), leaving the 26% lower bound unanchored without naming c64.
There was a problem hiding this comment.
Done in 33064d0: added the cold-replica recovery setup (16 ~92K-token sessions replayed against a freshly restarted prefill pod) and anchored the 26% and 66% steady-state overhead to concurrencies 64 and 128.
… L3 benchmarks Signed-off-by: Yuchen Tian <[email protected]>
Signed-off-by: Yuchen Tian <[email protected]>
|
/approve Thanks! |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahg-g The full list of commands accepted by this bot can be found here. Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What does this PR do?
Adds "Bringing First-Class SGLang Serving to llm-d" (
blog/2026-11-02_serving-glm-5-2-sglang-tiered-kv-cache-on-llm-d.mdx) with four figures (static/img/blogs/glm52-sglang-tiered-kv/). Building on Serving GLM-5.2 for Agentic Workloads on llm-d without repeating its trace and MLA fundamentals, the post covers three parts on the SGLang variant of the GLM-5.2 well-lit path:llm-darchitecture: Howllm-ddecouplesDisaggregatedSetorchestration, per-DP-rankInferencePoolendpoint discovery, andEPPprefix-affinity routing from individual model servers so vLLM and SGLang share one Kubernetes operational stack.llm-dand SGLang communities adapted SGLang's Wide-EP runtime to act as independent, routable, and observable Kubernetes endpoints across per-rank Rust HTTP servers, replicatedP/Dpairing state with LinuxDMA-BUFRDMA transfers, and per-rank cache/trace metadata.L1→L2→Shared L3) and multi-replica performance: Evaluating SGLang'sHiCacheacross single-replica16x H200 and multi-replica32x H200 deployments under sustained concurrency sweeps, live prefill pod eviction/failover, and cold-replica recovery.Key Figures Preview
Why is this change needed?
Documents the community effort that brought first-class SGLang Wide-EP serving to
llm-d(llm-d/llm-d#2198) and provides measured guidance for configuringHiCacheacross single- and multi-replica clusters:L2host RAM (16x H200): Eliminates theL1HBM thrashing cliff past concurrency32(6.0%hit and174.2 smedian TTFT atc128onL1alone), keeping cache hit rates at85%–95%, cuttingc128median TTFT8.7x(20.1 s), and raising output3.94x(1,257 tok/s).Shared L3(32x H200): Scaling to two prefill replicas with a 2-node decode pool cutsc128median TTFT5.9x(3.43 s,1,903 tok/soutput). AddingShared L3(hicache-fson aReadWriteManyPVC) restores99.94%of evicted session prefixes (1.08Mtokens) from storage on the surviving replica during live pod failover — cutting failover median TTFT by25%(38.4 s→28.8 s) and survivor queue recovery time in half — and cuts cold-replica recovery TTFT by57%(38.8 s→16.8 s).How was this tested?
npm run sync && npm run build)Checklist
git commit -s) per DCOnpm run build)Related Issues