fix: round-robin DP rank assignment for service discovery mode#181
Open
raviguptaamd wants to merge 1 commit into
Open
fix: round-robin DP rank assignment for service discovery mode#181raviguptaamd wants to merge 1 commit into
raviguptaamd wants to merge 1 commit into
Conversation
When using ZMQ service discovery with intra_node_data_parallel_size > 1, worker addresses arrive without @rank suffixes. The router left prefill_dp_rank as None, so the prefill request lacked X-data-parallel-rank and the decode kv_transfer_params omitted remote_dp_rank. This caused the MoRI-IO handshake to always target DP rank 0, deadlocking all other ranks. Add an atomic round-robin counter (discovery_dp_rank_counter) that assigns DP ranks when extract_base_http_and_dp_rank returns None and DP size > 1. The assigned rank flows into the prefill header and the decode's remote_dp_rank, matching the behaviour of the toy proxy. Tested with 1P/1D DeepSeek-V3-5layer on MI300X (8 DP ranks per node). Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When using ZMQ service discovery with
--intra-node-data-parallel-size > 1, worker addresses arrive without@ranksuffixes. The router leftprefill_dp_rankasNone, so:X-data-parallel-rankheaderkv_transfer_paramsomittedremote_dp_rankThis caused the MoRI-IO WRITE mode handshake to always target DP rank 0, deadlocking all other DP ranks.
Fix
Add an atomic round-robin counter (
discovery_dp_rank_counter) toVllmPDRouterthat assigns DP ranks whenextract_base_http_and_dp_rankreturnsNoneand DP size > 1. The assigned rank flows into:X-data-parallel-rankheaderremote_dp_rankinkv_transfer_paramsThis matches the behaviour of the toy proxy which already does round-robin DP rank assignment.
Changes
src/routers/http/vllm_pd_router.rs:discovery_dp_rank_counter: AtomicUsizefield toVllmPDRouterprocess_vllm_two_stage_request_discovered(), generate round-robin DP rank whenprefill_dp_rank.is_none()andintra_node_data_parallel_size > 1Test plan
@ranksuffixes are presentBuilds on top of #157 (MoRI WRITE mode concurrent dispatch).