Skip to content

fix(pd): route MoRIIO KV-notify to the correct decode DP rank in 2P2D - #181

Closed
raviguptaamd wants to merge 1 commit into
vllm-project:mainfrom
raviguptaamd:ravgupta/discovery-dp-rank-roundrobin
Closed

raviguptaamd wants to merge 1 commit into
vllm-project:mainfrom
raviguptaamd:ravgupta/discovery-dp-rank-roundrobin

Conversation

@raviguptaamd

@raviguptaamd raviguptaamd commented Jun 2, 2026

Copy link
Copy Markdown

Rebased onto current main (1d10e71) and reduced to a single commit. This PR was previously 2 commits and conflicted; it is now 1 commit, no conflicts.

What changed about this PR

The round-robin DP-rank commit that used to ride along here (11841c0d) is already upstreamprefill_dp_round_robin is in vllm_pd_router.rs on main today. Keeping it was the main source of the conflicts, so it's dropped. What remains is the one fix that is still missing upstream.

The fix

In 2P2D disaggregated serving over the MoRIIO connector, the decode side's KV-notify is addressed using the intra-node DP size, so with more than one decode pod the notify targets the wrong DP rank. The transfer is then never acknowledged and the request wedges until the deferred write expires:

remote blocks never arrived
Reaped deferred sends

This adds moriio_dp_size and routes notify through effective_dp_size(), falling back to the intra-node value when the flag isn't set — so single-pod behaviour is byte-for-byte unchanged. remote_dp_rank_override carries the resolved rank across the pod boundary.

--moriio-dp-size is opt-in. Without it, effective_dp_size() returns the intra-node size and nothing about existing deployments changes.

Validation

Built into a GLM-5.1-FP8 disaggregated image and run on MI300X (8 nodes, 2P/2D EP16, MoRI-EP wideEP):

  • NIAH 3 seeds: 2k 9.7/10, 8k 9.7/10
  • Perf 8192/1024 con32: TPOT 60.0 ms median, 440 output tok/s, 0 failed requests
  • No remote blocks never arrived, no Reaped deferred sends — the wedge this fixes does not reproduce

Also perf-neutral against the pre-rebase router: 60.0 ms / 440 tok/s here vs 59.5 ms / 444 tok/s on the old branch, i.e. within noise. The router compiles clean (vllm_router_rs, release).

Consumed by ROCm/MAD#206, which currently has to pin a fork of this repo until this merges.

raviguptaamd added a commit to raviguptaamd/router that referenced this pull request Jun 16, 2026
…uting

Captures the uncommitted working-tree edits (from /tmp/router-inspect, the tree
that built the validated vllm-router-2p2d-dpfix binary on 2026-06-14) on top of
PR vllm-project#181 (11841c0). Without these, the decode->prefill notify targets a different
DP rank than the prefill was pinned to -> "remote blocks never arrived" deferred
write expiry under 2P2D EP=16 load (reproduced: clean vllm-project#181 wedges, this serves).
Adds remote_dp_rank_override flag + remote_dp_size so the MoRIIO connector's rank
arithmetic (blake2s(rid)%dp_size) matches the topology on both legs.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6409ac1409

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

"remote_block_ids": serde_json::Value::Null,
"transfer_id": transfer_id.unwrap_or(""),
"remote_dp_size": self.intra_node_data_parallel_size,
"remote_dp_size": self.effective_dp_size(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep READ-mode DP size consistent on decode

When --moriio-dp-size is set and MoRI-IO registers READ mode, this sends the prefill leg remote_dp_size as the effective cross-pod size, but the READ decode path still overwrites remote_dp_size with self.intra_node_data_parallel_size in build_decode_kv_transfer_params. In a 2P2D setup such as moriio_dp_size=16 and intra_node_data_parallel_size=8, the two legs of the same transfer disagree about the DP world size, so the decode handshake only targets the local-size world. Use effective_dp_size() in the READ decode path as well.

Useful? React with 👍 / 👎.

Comment thread src/lib.rs
worker_startup_timeout_secs: self.worker_startup_timeout_secs,
worker_startup_check_interval_secs: self.worker_startup_check_interval,
intra_node_data_parallel_size: self.intra_node_data_parallel_size,
moriio_dp_size: 0,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Propagate MoRI-IO DP size through Python entrypoint

For routers started through the PyPI/Python entrypoint, Router.start() builds this RouterConfig, but the new value is hardcoded to 0 and the PyO3 constructor/RouterArgs do not expose a matching field. That means installed vllm-router users cannot configure the new cross-pod MoRI-IO DP size; Wide-EP deployments silently fall back to intra_node_data_parallel_size, so the new round-robin rank assignment and remote_dp_size stamping still use the wrong world size. Thread this option through the Python args/constructor instead of forcing 0.

Useful? React with 👍 / 👎.

…or 2P2D KV-notify (rebased onto upstream tip; upstream already has round-robin)
@raviguptaamd
raviguptaamd force-pushed the ravgupta/discovery-dp-rank-roundrobin branch from 6409ac1 to 82dc981 Compare August 25, 2026 07:36
@raviguptaamd raviguptaamd changed the title fix: round-robin DP rank assignment for service discovery mode fix(pd): route MoRIIO KV-notify to the correct decode DP rank in 2P2D Aug 25, 2026
@raviguptaamd

Copy link
Copy Markdown
Author

Force-pushed this branch to rebase it — worth flagging what changed, since the diff will look different to anyone who reviewed it earlier.

Before: 2 commits, based on June main, mergeable=false (conflicted).
Now: 1 commit on top of 1d10e71, no conflicts.

The dropped commit is the round-robin DP-rank fix (11841c0d). It's already upstreamprefill_dp_round_robin is in vllm_pd_router.rs on main, so carrying it here was both redundant and the main source of the conflicts. Resolving the rebase meant keeping upstream's counter and driving it from effective_dp_size() rather than reintroducing my duplicate.

The previous head 6409ac1 is preserved at tag pr181-pre-rebase-6409ac1 on the fork if anyone wants to diff against it.

Nothing about the remaining fix changed — only its base.

@raviguptaamd

Copy link
Copy Markdown
Author

Superseded by #223 — closing this.

Same fix, but this PR was opened 2026-06-02 against a much older main, and the two review comments on it predate today's rebase, so the diff they refer to no longer exists. Rather than ask anyone to re-read a PR whose contents changed underneath them, #223 is the same commit (82dc9811) as a clean single-commit PR against current main.

The round-robin commit that used to ride along here (11841c0d) is already upstream as prefill_dp_round_robin, so it's dropped — only the 2P2D KV-notify fix remains.

Old head 6409ac1 is preserved at tag pr181-pre-rebase-6409ac1 on the fork if anyone wants to diff against it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant