Skip to content

feat(bench): add --dp-rank-roundrobin for explicit DP-rank routing - #2696

Closed
rebel-joonhyunglee wants to merge 1 commit into
SemiAnalysisAI:mainfrom
rebel-joonhyunglee:feat/dp-rank-roundrobin-header
Closed

feat(bench): add --dp-rank-roundrobin for explicit DP-rank routing#2696
rebel-joonhyunglee wants to merge 1 commit into
SemiAnalysisAI:mainfrom
rebel-joonhyunglee:feat/dp-rank-roundrobin-header

Conversation

@rebel-joonhyunglee

Copy link
Copy Markdown

What

Adds an opt-in --dp-rank-roundrobin N flag to benchmark_serving.py. When set, request i is pinned to data-parallel rank i % N via the X-data-parallel-rank HTTP header, bypassing vLLM's server-side DP load balancer.

Why

Under injection=inf (request-rate unbounded), vLLM's internal DP balancer can dispatch requests unevenly across ranks — some engines sit idle while others queue — which depresses output TPS on high-DP configs (observed on DP8). This flag measures the ideal round-robin routing baseline as a clean A/B against the default balancer, with no server or SDK change (the X-data-parallel-rank header is already honored by vLLM v0.18+).

Judging signal for the A/B: with the flag on, mean_ttft / median(p50) ttft collapses toward ~1 and output TPS rises, indicating the default-balancer TPS gap was a routing artifact rather than a hardware limit.

Changes

  • backend_request_func.py: RequestFuncInput gains an extra_headers field; the OpenAI completions and chat-completions request funcs merge it into request headers.
  • benchmark_serving.py: --dp-rank-roundrobin arg; benchmark() assigns the header per request when set. Default None → no behavior change.

Compatibility

Off by default; no change to existing runs. Header is a no-op on servers that don't read it.

Add an opt-in `--dp-rank-roundrobin N` flag to benchmark_serving.py that
pins request i to data-parallel rank i % N via the `X-data-parallel-rank`
HTTP header, bypassing the server-side DP balancer.

Under injection=inf, vLLM's internal balancer can dispatch requests
unevenly across DP ranks, leaving some engines idle while others queue,
which depresses output TPS on high-DP configs. This flag lets a benchmark
measure the ideal round-robin routing baseline as an A/B against the
default balancer, with no server/SDK change.

- RequestFuncInput gains an `extra_headers` field, merged into the request
  headers by the OpenAI completions and chat-completions request funcs.
- benchmark() assigns the header per request when the flag is set.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@functionstackx

Copy link
Copy Markdown
Collaborator

We are phasing out single turn in favor of agentic bench so probably won't accept this contribution

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

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants