Skip to content

feature: support X-Data-Parallel-Rank header to specific dp-rank.#19832

Merged
hnyls2002 merged 3 commits intosgl-project:mainfrom
doujiang24:http-dp-rank
Mar 11, 2026
Merged

feature: support X-Data-Parallel-Rank header to specific dp-rank.#19832
hnyls2002 merged 3 commits intosgl-project:mainfrom
doujiang24:http-dp-rank

Conversation

@doujiang24
Copy link
Copy Markdown
Contributor

Motivation

From #19268
Added support for X-Data-Parallel-Rank HTTP Header, It could be more friendly for external router.

  • Align with vLLM's implementation for external DP routing
  • Allow external load balancers/routers to specify DP rank via HTTP header with higher priority than request body

Modifications

  • python/sglang/srt/entrypoints/openai/serving_base.py: Added extract_routed_dp_rank_from_header() method
    • Priority: Header > Body routed_dp_rank
    • Validation: Returns 400 Bad Request for non-integer values
  • python/sglang/srt/entrypoints/openai/serving_chat.py: Integrated header extraction in _convert_to_internal_request() to use the effective DP rank
  • python/sglang/srt/entrypoints/openai/serving_completions.py: Same integration for completion requests

Accuracy Tests

Benchmarking and Profiling

Checklist

Review Process

  1. Ping Merge Oncalls to start the PR flow. See the PR Merge Process.
  2. Get approvals from CODEOWNERS and other reviewers.
  3. Trigger CI tests with comments or contact authorized users to do so.
    • /tag-run-ci-label, /rerun-failed-ci, /tag-and-rerun-ci
  4. After green CI and required approvals, ask Merge Oncalls to merge.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

It has higher priority than the routed_dp_rank in request body.

Signed-off-by: doujiang24 <doujiang24@gmail.com>
@doujiang24
Copy link
Copy Markdown
Contributor Author

@hnyls2002 Could you please take a look? Thanks.

@hnyls2002
Copy link
Copy Markdown
Collaborator

/tag-and-rerun-ci

@hnyls2002 hnyls2002 removed the run-ci label Mar 11, 2026
@hnyls2002
Copy link
Copy Markdown
Collaborator

/rerun-stage stage-c-test-8-gpu-h20

@github-actions
Copy link
Copy Markdown
Contributor

✅ Triggered stage-c-test-8-gpu-h20 to run independently (skipping dependencies).

@github-actions
Copy link
Copy Markdown
Contributor

🔗 View workflow run

@hnyls2002
Copy link
Copy Markdown
Collaborator

hnyls2002 commented Mar 11, 2026

/rerun-stage stage-c-test-8-gpu-h20

@github-actions
Copy link
Copy Markdown
Contributor

✅ Triggered stage-c-test-8-gpu-h20 to run independently (skipping dependencies).

@github-actions
Copy link
Copy Markdown
Contributor

🔗 View workflow run

@hnyls2002 hnyls2002 merged commit 88d2fc1 into sgl-project:main Mar 11, 2026
97 of 107 checks passed
@doujiang24 doujiang24 deleted the http-dp-rank branch March 12, 2026 02:13
liubiyongge pushed a commit to liubiyongge/sglang that referenced this pull request Mar 13, 2026
Wangzheee pushed a commit to Wangzheee/sglang that referenced this pull request Mar 21, 2026
JustinTong0323 pushed a commit to JustinTong0323/sglang that referenced this pull request Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants