Repository navigation
Conversation
…/EP8) Adds GLM-5.3-Flash-FP8 (Glm5NextForConditionalGeneration) disaggregated serving on MI300X / MI325X to the vllm_dissag harness: EP8 prefill (eager) + EP8 decode with MTP on both legs and a FULL_AND_PIECEWISE decode CUDA graph, max-model-len 760000, MoRIIO READ. - docker/vllm_disagg_inference.glmv53flash.gfx942.ubuntu.amd.Dockerfile: self-contained, builds vLLM (raviguptaamd/vllm@98b24865), AITER (raviguptaamd/aiter@6f65fba0, incl. ROCm/aiter#3913), MoRI (ROCm/mori@78b7a5f3) and vllm-router (raviguptaamd/router@9b2146ec, incl. vllm-project/router#313) from pinned commits on a digest-pinned base; no patch overlay; 18 build-time fix checks. - models.yaml / models.json: GLM-5.3-Flash-FP8-gfx942 (sweep, niah, long_context, agentic conformance_256k / conformance_512k). - connectors/moriio.sh: opt-in MORIIO_READ_MODE and ROUTER_PREFILL_POLICY / ROUTER_DECODE_POLICY (no-ops for other models); run_xPyD_models.slurm gate lists. - skills/: MoRIIO NIC setup for Broadcom Thor2 and ConnectX-7. - results/: validation report (NIAH 256K/512K/750K, concurrent NIAH, perf, AgentX on MI325X and MI300X). - README.MD, tests/gate_check.sh, tests/argv_assert.sh. Co-authored-by: Cursor <[email protected]>
…/EP8) Adds GLM-5.3-Flash-FP8 (Glm5NextForConditionalGeneration) disaggregated serving on MI300X / MI325X to the vllm_dissag harness: EP8 prefill (eager) + EP8 decode with MTP on both legs and a FULL_AND_PIECEWISE decode CUDA graph, max-model-len 760000, MoRIIO READ. - docker/vllm_disagg_inference.glmv53flash.gfx942.ubuntu.amd.Dockerfile: self-contained, builds vLLM (raviguptaamd/vllm@98b24865), AITER (raviguptaamd/aiter@6f65fba0, incl. ROCm/aiter#3913), MoRI (ROCm/mori@78b7a5f3) and vllm-router (raviguptaamd/router@9b2146ec, incl. vllm-project/router#313) from pinned commits on a digest-pinned base; no patch overlay; 18 build-time fix checks. - models.yaml / models.json: GLM-5.3-Flash-FP8-gfx942 (sweep, niah, long_context, agentic conformance_256k / conformance_512k). - connectors/moriio.sh: opt-in MORIIO_READ_MODE and ROUTER_PREFILL_POLICY / ROUTER_DECODE_POLICY (no-ops for other models); run_xPyD_models.slurm gate lists. - skills/: MoRIIO NIC setup for Broadcom Thor2 and ConnectX-7. - results/: validation report (NIAH 256K/512K/750K, concurrent NIAH, perf, AgentX on MI325X and MI300X). - README.MD, tests/gate_check.sh, tests/argv_assert.sh. Co-authored-by: Cursor <[email protected]>
simondanielsson
left a comment
There was a problem hiding this comment.
Thanks for the work!
- DP ranks are never expanded. A DP engine (--data-parallel-size-local N, --api-server-count N) registers ONE http_address for all N ranks. The policy therefore sees a single worker, no host:port@rank reaches the DP-rank parser, so the prefill leg carries no X-data-parallel-rank, the MoRI-IO WRITE decode leg carries no remote_dp_rank, and consistent_hash builds a 1-entry ring. --intra-node-data-parallel-size is silently ignored in this mode.
- Client headers are dropped before the policy. select_worker_with_policy() calls select_worker() (no headers), so consistent_hash never sees X-Session-ID (or any SESSION_HEADER_NAMES entry) and falls back to a per-request body hash, which changes every turn of a multi-turn session.
- consistent_hash is load-blind. Even once affinity works, all traffic for a session-set concentrates on a hot prefill rank while others starve.
On the three points:
- This makes sense, we should find a way to unify the implementation for agg and pd routing.
- Duplicate of #243
- I think consisntent_hash is not considering the load by design? I see there are several PRs/RFC's up suggesting new routing policies that mix hash/load/cache_aware. I'd suggest we follow through with one of those instead of modifying the existing consistent_hash policy.
So for this I'd suggest:
- repurpose this PR to just implement point 1
- see if we can help finalizing and reviewing one/some of the other new policies that would achieve this
…/EP8) Adds GLM-5.3-Flash-FP8 (Glm5NextForConditionalGeneration) disaggregated serving on MI300X / MI325X to the vllm_dissag harness: EP8 prefill (eager) + EP8 decode with MTP on both legs and a FULL_AND_PIECEWISE decode CUDA graph, max-model-len 760000, MoRIIO READ. - docker/vllm_disagg_inference.glmv53flash.gfx942.ubuntu.amd.Dockerfile: self-contained, builds vLLM (raviguptaamd/vllm@98b24865), AITER (raviguptaamd/aiter@6f65fba0, incl. ROCm/aiter#3913), MoRI (ROCm/mori@78b7a5f3) and vllm-router (raviguptaamd/router@9b2146ec, incl. vllm-project/router#313) from pinned commits on a digest-pinned base; no patch overlay; 18 build-time fix checks. - models.yaml / models.json: GLM-5.3-Flash-FP8-gfx942 (sweep, niah, long_context, agentic conformance_256k / conformance_512k). - connectors/moriio.sh: opt-in MORIIO_READ_MODE and ROUTER_PREFILL_POLICY / ROUTER_DECODE_POLICY (no-ops for other models); run_xPyD_models.slurm gate lists. - skills/: MoRIIO NIC setup for Broadcom Thor2 and ConnectX-7. - results/: validation report (NIAH 256K/512K/750K, concurrent NIAH, perf, AgentX on MI325X and MI300X). - README.MD, tests/gate_check.sh, tests/argv_assert.sh. Co-authored-by: Cursor <[email protected]>
… (unified via dp_utils) In --vllm-pd-disaggregation + --vllm-discovery-address, a DP engine registers one http_address for all ranks, so the policy saw a single worker, no X-data-parallel-rank was emitted, and consistent_hash built a 1-entry ring (--intra-node-data-parallel-size silently ignored). Expand each discovered prefill instance into one host:port@rank entry per intra-node DP rank, matching direct-URL mode. Unified via a single shared dp_utils::expand_dp_aware_url primitive (also backing get_dp_aware_workers), so the aggregated, direct-URL PD, and service-discovery PD routers share one DP-expansion implementation. dp_size<=1 is a no-op and already-@rank URLs are not double-expanded; decode is left unexpanded. consistent_hash.rs unchanged. Scope narrowed per review: session-header forwarding dropped (superseded by vllm-project#243) and load-aware consistent_hash dropped (deferred to the hash/load/cache-aware policy RFCs). Signed-off-by: Mohit Deopujari <[email protected]> Co-authored-by: Cursor <[email protected]>
ed54b32 to
3f1abed
Compare
|
Thanks @simondanielsson — I've repurposed this PR to point 1 only, done the unified way you suggested:
Net diff is now 2 files, +136/−6 (down from ~458). Description updated with a discovery-mode repro (1-entry → N-entry ring) and the regression test. PTAL. |
hsliuustc0106
left a comment
There was a problem hiding this comment.
Delta review at 3f1abed4 (after my earlier pass at ed54b326): the DP expansion now lives in a shared expand_dp_aware_url helper used by all three router flavors — no-op for dp_size <= 1, no double-expansion of already-@rank URLs, saturating_sub hardening. That unification removes the drift risk between the direct-URL and discovery paths my earlier review had noted implicitly. DCO is green on this head now. No new findings.
From an automated daily review pass over new/updated PRs (head SHA frozen at 3f1abed4).
|
Benchmarking context (SemiAnalysis AgentX / InferenceX). This change enables the vLLM-router counterpart of AgentX's sticky routing — the generic DP-rank expansion (this PR) is the prerequisite: without it the ring has a single entry, so every conversation-aware scheme collapses regardless of header. Full AgentX-style sticky routing = this PR (multi-replica ring) + |
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
2 open findings
What changed in this PR
Fixes service-discovery mode for vLLM PD disaggregation so prefill instances are expanded into per–data-parallel-rank worker entries (matching direct-URL mode), enabling correct consistent-hash ring sizing and DP-rank-aware routing.
Changes:
- Add shared
dp_utils::expand_dp_aware_url()and route existing DP worker expansion through it. - Expand discovered prefill instances into
...@rankentries per intra-node DP rank inVllmPDRouter. - Add unit/regression tests validating per-rank fan-out and non-collapsing consistent-hash behavior in discovery mode.
| File | Description |
|---|---|
| src/routers/http/vllm_pd_router.rs | Expands discovered prefill instances into per-rank workers; adds regression/unit tests for discovery-mode DP expansion. |
| src/routers/http/dp_utils.rs | Introduces shared URL fan-out helper and updates DP-aware worker expansion to use it; adds helper unit tests. |
🧠 Review effort: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| pub fn expand_dp_aware_url(worker_url: &str, dp_size: usize) -> Vec<String> { | ||
| // No-op for single-rank / DP-disabled setups. | ||
| if dp_size <= 1 { | ||
| return vec![worker_url.to_string()]; | ||
| } | ||
| // Already DP-aware (parseable @rank): don't double-expand. | ||
| if extract_dp_rank(worker_url).is_ok() { | ||
| return vec![worker_url.to_string()]; | ||
| } | ||
| (0..dp_size) | ||
| .map(|rank| format!("{}@{}", worker_url, rank)) | ||
| .collect() | ||
| } |
There was a problem hiding this comment.
Thanks. In this router, worker URLs on both the discovery and direct-URL paths are host:port / http://host:port / IPv6 [host]:port — they do not carry userinfo (user@…), so the unparseable user@host:port@rank case is not reachable here. extract_dp_rank is a pre-existing shared helper, and its rejection of multi-@ inputs is intentional and covered by test_extract_dp_rank_multiple_at (host:port@3@5 → Err). Since this PR was narrowed (per review) to just the DP-rank expansion, I would prefer not to change that shared helper's tested semantics here. If userinfo-bearing URLs become a supported input, happy to switch detection to rsplit_once('@') + a usize-suffix check (updating that test) as a focused follow-up.
| "Expanding worker {} to {} DP-aware URLs (ranks 0..{})", | ||
| url, | ||
| dp_size, | ||
| dp_size - 1 | ||
| dp_size.saturating_sub(1) | ||
| ); | ||
|
|
||
| // Expand each worker URL to multiple DP-aware URLs | ||
| for rank in 0..dp_size { | ||
| dp_aware_workers.push(format!("{}@{}", url, rank)); | ||
| } | ||
| // Expand each worker URL to multiple DP-aware URLs via the shared helper. | ||
| dp_aware_workers.extend(expand_dp_aware_url(url, dp_size)); |
There was a problem hiding this comment.
Good catch on the log — addressed in c79687b. dp_size=0 is not reachable from the call sites: fan-out only happens when intra_node_data_parallel_size > 1 (the knob defaults to 1), so real expansion only sees dp_size >= 2; dp_size <= 1 is an intentional single-rank / DP-disabled pass-through that returns the URL unchanged. The commit logs only when actually expanding, and extends the no-op test to pin dp_size 0 and 1 → single unchanged entry. I would rather not add an error path for a value the config layer already prevents.
…p contract Address review: the expansion log was misleading for dp_size<=1 (expand_dp_aware_url returns the URL unchanged there). Log only when actually fanning out, and extend the no-op test to cover dp_size=0 as well as 1. Signed-off-by: Mohit Deopujari <[email protected]> Co-authored-by: Cursor <[email protected]>
wuhang2014
left a comment
There was a problem hiding this comment.
Reviewed at a9deb1a (post main-merge). fmt / strict clippy / 941 lib tests (+7 new) green locally; DCO green. Downstream plumbing verified: process_vllm_two_stage_request_discovered parses the @rank suffix, strips it for URLs/kv keys, and emits X-data-parallel-rank; decode rank correctly follows the prefill rank. Findings below — 1 warning, 2 nits.
| let prefill_instances = self.service_registry.get_prefill_instances(); | ||
| let prefill_instances = Self::expand_dp_instances( | ||
| self.service_registry.get_prefill_instances(), | ||
| self.intra_node_data_parallel_size, |
There was a problem hiding this comment.
warning: The expansion trusts only the global --intra-node-data-parallel-size flag, but the registry already holds the true per-instance DP size for MoRI-IO registrations — ServiceRegistration.dp_size is stored on every ServiceInstance (vllm_service_discovery.rs:274) and exposed via get_tp_dp_size() (:424). Two failure modes:
- Flag omitted or wrong → the router silently keeps the 1-entry ring this PR fixes, even though every registration heartbeat told it the real
dp_size. - Heterogeneous prefill fleet (e.g. one dp=2 and one dp=8 engine behind the same discovery address) → the dp=2 engine is fanned out to 8 entries and consistent-hash will send real traffic to phantom ranks 2..7 (
X-data-parallel-rank≥ engine dp_size).
Direct-URL mode already solved this per worker: discover_dp_size() probes /metrics and only falls back to the config value (pd_router.rs:512). Here no probe is even needed — the value is already registered. Suggested shape: use the registered dp_size when it is > 1, fall back to intra_node_data_parallel_size otherwise (nixl/mooncake registrations default to 1, so the fallback covers them), and/or warn! when a moriio prefill registers a dp_size that disagrees with the configured flag. I realize remote_dp_size in build_prefill_kv_transfer_params also uses the global flag today, so this is consistent with the file's existing convention — hence warning rather than blocker.
|
|
||
| /// Expand each discovered prefill instance into one `host:port@rank` entry per DP | ||
| /// rank via the shared `dp_utils::expand_dp_aware_url`. Called on the prefill list | ||
| /// only (decode keeps the engine's own DP balancer); the instance's shared ZMQ |
There was a problem hiding this comment.
nit: The doc comment (and PR description) say decode is left unexpanded because it "keeps the engine's own DP balancer" — but that's not what happens when intra_node_data_parallel_size > 1: the decode leg is explicitly rank-pinned to the prefill's rank via effective_decode_dp_rank = prefill_dp_rank + X-data-parallel-rank (lines 1226–1233 below), so the engine's balancer is bypassed there too. The actual (and correct) reason not to expand decode is that prefill and decode must agree on the rank for the KV transfer (e.g. moriio WRITE remote_dp_rank = prefill rank), so decode cannot select its rank independently. Worth rewording so a future reader doesn't "fix" the decode side based on the stated rationale.
|
|
||
| // Get available instances from service discovery | ||
| let prefill_instances = self.service_registry.get_prefill_instances(); | ||
| let prefill_instances = Self::expand_dp_instances( |
There was a problem hiding this comment.
nit: The expansion output only changes when the registry snapshot or intra_node_data_parallel_size changes, but it's recomputed (N × dp_size URL format!s + zmq clones, plus the instances_to_workers rebuild) on every request. Optional cleanup: perform the expansion at registration/expiry time (or cache it keyed by a registry generation counter) so the per-request path just clones the pre-expanded list. Purely structural — not blocking.
…/EP8) Adds GLM-5.3-Flash-FP8 (Glm5NextForConditionalGeneration) disaggregated serving on MI300X / MI325X to the vllm_dissag harness: EP8 prefill (eager) + EP8 decode with MTP on both legs and a FULL_AND_PIECEWISE decode CUDA graph, max-model-len 760000, MoRIIO READ. - docker/vllm_disagg_inference.glmv53flash.gfx942.ubuntu.amd.Dockerfile: self-contained, builds vLLM (raviguptaamd/vllm@98b24865), AITER (raviguptaamd/aiter@6f65fba0, incl. ROCm/aiter#3913), MoRI (ROCm/mori@78b7a5f3) and vllm-router (raviguptaamd/router@9b2146ec, incl. vllm-project/router#313) from pinned commits on a digest-pinned base; no patch overlay; 18 build-time fix checks. - models.yaml / models.json: GLM-5.3-Flash-FP8-gfx942 (sweep, niah, long_context, agentic conformance_256k / conformance_512k). - connectors/moriio.sh: opt-in MORIIO_READ_MODE and ROUTER_PREFILL_POLICY / ROUTER_DECODE_POLICY (no-ops for other models); run_xPyD_models.slurm gate lists. - skills/: MoRIIO NIC setup for Broadcom Thor2 and ConnectX-7. - results/: validation report (NIAH 256K/512K/750K, concurrent NIAH, perf, AgentX on MI325X and MI300X). - README.MD, tests/gate_check.sh, tests/argv_assert.sh. Co-authored-by: Cursor <[email protected]>
…/EP8) Adds GLM-5.3-Flash-FP8 (Glm5NextForConditionalGeneration) disaggregated serving on MI300X / MI325X to the vllm_dissag harness: EP8 prefill (eager) + EP8 decode with MTP on both legs and a FULL_AND_PIECEWISE decode CUDA graph, max-model-len 760000, MoRIIO READ. - docker/vllm_disagg_inference.glmv53flash.gfx942.ubuntu.amd.Dockerfile: self-contained, builds vLLM (raviguptaamd/vllm@98b24865), AITER (raviguptaamd/aiter@6f65fba0, incl. ROCm/aiter#3913), MoRI (ROCm/mori@78b7a5f3) and vllm-router (raviguptaamd/router@9b2146ec, incl. vllm-project/router#313) from pinned commits on a digest-pinned base; no patch overlay; 18 build-time fix checks. - models.yaml / models.json: GLM-5.3-Flash-FP8-gfx942 (sweep, niah, long_context, agentic conformance_256k / conformance_512k). - connectors/moriio.sh: opt-in MORIIO_READ_MODE and ROUTER_PREFILL_POLICY / ROUTER_DECODE_POLICY (no-ops for other models); run_xPyD_models.slurm gate lists. - skills/: MoRIIO NIC setup for Broadcom Thor2 and ConnectX-7. - results/: validation report (NIAH 256K/512K/750K, concurrent NIAH, perf, AgentX on MI325X and MI300X). - README.MD, tests/gate_check.sh, tests/argv_assert.sh. Co-authored-by: Cursor <[email protected]>


What
In
--vllm-pd-disaggregation+--vllm-discovery-address, a DP engine registers ONEhttp_address for all its ranks, so the policy saw a single worker, no
X-data-parallel-rankwas ever emitted, andconsistent_hashbuilt a 1-entry ring(
--intra-node-data-parallel-sizewas silently ignored). This expands each discoveredprefill instance into one
host:port@rankentry per intra-node DP rank so the router canaddress every rank — matching what direct-URL mode already does.
Why it matters
This is the prerequisite for prefix-cache / session affinity on data-parallel engines:
with a 1-entry ring every turn of a multi-turn conversation can only land on one rank, so
routing cannot steer a session to the rank holding its cached prefix. Exposing all N ranks
(this PR) lets a session-aware policy (session-id routing lands in #243) keep a conversation
on its cached rank. This PR itself is routing plumbing and does not change model numerics.
Reproduction (fails on main)
Run the router in discovery mode with DP > 1:
Updated consistent hash ring with 1 workers ...(the 8 DP ranks collapse to one)Updated consistent hash ring with 8 workers ...Unified implementation
Adds one shared primitive
dp_utils::expand_dp_aware_url(url, dp_size)and routes allcallers through it — the aggregated and direct-URL PD routers (via
get_dp_aware_workers)and the service-discovery PD router (
expand_dp_instances).dp_size <= 1is a no-op andalready-
@rankURLs are not double-expanded. Decode is intentionally left unexpanded.Net result is smaller and de-duplicated;
consistent_hash.rsis unchanged (0-diff).Scope (narrowed per review)
Only the DP-rank expansion. Dropped from the earlier version:
consistent_hash(PrefillLoadGuard/ bounded-load /PREFILL_LOAD_AWARE)→ deferred to the dedicated hash/load/cache-aware policy RFCs;
consistent_hash.rsisreverted to unchanged.
Tests
cargo test --lib— touched areas green (pre-existingwasm_middlewareWASI-linkerfailures are unrelated/environmental). Regression that fails on main and passes with the
fix:
test_discovered_dp_ranks_are_distinct_under_consistent_hash— builds the discoveryring and asserts requests spread across >1 DP rank (a 1-entry ring on main collapses them
to one). Supporting unit tests cover rank fan-out,
dp_size<=1no-op, and already-@ranktolerance.