Skip to content

[Bugfix][Router] Keep P/D model labels when dynamic config reloads the router - #1129

Merged
ruizhang0101 merged 1 commit into
vllm-project:mainfrom
theminjunchoi:fix/dynamic-config-pd-labels
Oct 22, 2026
Merged

ruizhang0101 merged 1 commit into
vllm-project:mainfrom
theminjunchoi:fix/dynamic-config-pd-labels

Conversation

@theminjunchoi

Copy link
Copy Markdown
Contributor

DynamicConfigWatcher.reconfigure_routing_logic rebuilds the router on every reload but never passes prefill_model_labels / decode_model_labels. DynamicRouterConfig has both fields and the service discovery reconfigure already uses them, so only the router loses them. After a reload, disaggregated_prefill_orchestrated returns 503 for every request and disaggregated_prefill raises TypeError. The watcher's first pass usually treats the file as changed, so this shows up right at startup too.

This passes the two labels, parsed the same way as the service discovery reconfigure.

  • New src/tests/test_dynamic_config.py covers both P/D routing logics. It fails on main (None / [] labels) and passes with this change.
  • Checked with the real router, two fake backends and a dynamic config JSON (repro in bug: dynamic config reload drops prefill/decode labels, P/D routers stop routing #1128). Main returns 503 both at startup and after editing the file. This branch returns 200 in both cases.
  • src/tests: 266 passed. pre-commit passes on the changed files.

This is separate from #1094, which fixes from_args. With #1094 alone the 503 still happens.

FIX #1128


  • Make sure the code changes pass the pre-commit checks.
  • Sign-off your commit by using -s when doing git commit
  • Try to classify PRs for easy understanding of the type of changes, such as [Bugfix], [Feat], and [CI].

…e router

DynamicConfigWatcher.reconfigure_routing_logic rebuilt the router without
prefill_model_labels / decode_model_labels, although DynamicRouterConfig
carries them and the service discovery reconfigure already passes them.
After any reload, disaggregated_prefill_orchestrated returned 503 for every
request and disaggregated_prefill raised TypeError. The watcher's first pass
usually sees the file as changed, so this also hit right at startup.

Fixes vllm-project#1128

Assisted-by: Claude Code claude-opus-5-5
Signed-off-by: MinJun Choi <[email protected]>

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request updates the dynamic configuration watcher to pass parsed prefill and decode model labels when reconfiguring the routing logic. It also introduces a new test suite to verify that these labels are correctly retained during reconfiguration. There are no review comments to address, and no further feedback is provided.

@chrikrah chrikrah 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.

@theminjunchoi approving at e033fc4. Both new cases fail with dynamic_config.py reverted to 4e076e8 and pass with the change, and initialize_routing_logic reads the two labels with kwargs.get, so the other routing logics do not see them.

My own #1094 edits from_args in the same file. With both applied on e033fc4, its test file and yours give 4 passed.

non-blocking, out of scope here: the same reload still drops kv_aware_threshold, loadaware_beta, prefix_min_match_length, the lmcache_* settings and max_instance_failover_reroute_attempts, because DynamicRouterConfig has no fields for them. The last one drops from 3 to 0 in the probe below.

$ PYTHONPATH=src python -m pytest src/tests/test_dynamic_config.py -q -p no:cacheprovider   # tree at e033fc4, CPython 3.12
2 passed in 1.01s
$ # same command, src/vllm_router/dynamic_config.py from 4e076e8, test kept
E       AssertionError: assert None == ['prefill-a', 'prefill-b']
E       AssertionError: assert [] == ['prefill-a', 'prefill-b']
FAILED src/tests/test_dynamic_config.py::test_reconfigure_routing_logic_keeps_prefill_decode_labels[disaggregated_prefill]
FAILED src/tests/test_dynamic_config.py::test_reconfigure_routing_logic_keeps_prefill_decode_labels[disaggregated_prefill_orchestrated]
$ # tree at e033fc4 plus the #1094 diff (git diff ebbb862 0944774 | patch -p1, applies clean)
$ PYTHONPATH=src python -m pytest src/tests/test_dynamic_config.py src/tests/test_dynamic_config_from_args.py -q -p no:cacheprovider
4 passed, 1 warning in 1.04s
$ # probe, tree at e033fc4: initialize_routing_logic("roundrobin", max_instance_failover_reroute_attempts=3),
$ # then DynamicConfigWatcher.reconfigure_routing_logic with a roundrobin DynamicRouterConfig
$ PYTHONPATH=src python probe_reload.py
startup: 3
after reload: 0
# not run: the end-to-end repro from #1128 with two fake backends

@ruizhang0101, could you take a look? It closes #1128 and adds two keyword arguments to one call.

@theminjunchoi

Copy link
Copy Markdown
Contributor Author

Hi @ruizhang0101, this one has an approval from @chrikrah and CI is green. Could you take a look when you have a chance? Happy to make any changes if needed. Thanks!

@ruizhang0101 ruizhang0101 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@theminjunchoi

Copy link
Copy Markdown
Contributor Author

Hi @ruizhang0101, thanks for enabling auto-merge! It looks like it's stuck on the Gatekeeper check. That job failed while Multiple-Models was failing, and it didn't run again after you re-ran Multiple-Models, which passed. Would you mind re-running the "All Checks Passed" job when you have a moment? Thank you!

@ruizhang0101
ruizhang0101 merged commit 527f4dc into vllm-project:main Oct 22, 2026
16 of 17 checks passed
bcdonadio added a commit to powerhome/vllm-production-stack that referenced this pull request Nov 12, 2026
* [Bugfix][Router] Read vllm:kv_cache_usage_perc for KV cache usage (vllm-project#1118)

Signed-off-by: Muhammad Ibrahim <[email protected]>

* [Doc] Add Simplified Chinese translation (README.zh.md) (vllm-project#1136)

Signed-off-by: YE <[email protected]>

* [CI/Build] Run helm unittest in CI and fix two broken tests (vllm-project#1131)

Signed-off-by: zjjkee <[email protected]>

* [Bugfix][Router] Key request stats by dispatch, not by X-Request-Id (vllm-project#1115)

Signed-off-by: David-Wu1119 <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Rui Zhang <[email protected]>

* [Bugfix][Router] Use least-inflight for PrefixAware below-threshold fallback (vllm-project#1089)

Signed-off-by: Dundy Pasupuleti <[email protected]>

* [Bugfix][Router] Keep P/D model labels when dynamic config reloads the router (vllm-project#1129)

Signed-off-by: MinJun Choi <[email protected]>

* [Bugfix] Match KEDA scalers to enabled model deployments (vllm-project#1142)

Signed-off-by: bojiang-li <[email protected]>

* [Router] added pooling route (vllm-project#1112)

Signed-off-by: [email protected] <[email protected]>
Co-authored-by: [email protected] <[email protected]>
Co-authored-by: Rui Zhang <[email protected]>

* [CI] Drop host docker prune from runner-cleanup workflow (vllm-project#1174)

Signed-off-by: Rui Zhang <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* [Feat][Router] Add /v1/systemone and /v1/decisions routes (vllm-project#1173)

Signed-off-by: Shern Shiou Tan <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* [CI/Build] Stop k8s routing tests when the engine pods never become ready (vllm-project#1134)

Signed-off-by: MinJun Choi <[email protected]>

* [Bugfix][Router] Upgrade aiohttp and vllm (0.33.0) to resolve router image CVEs (vllm-project#1185)

Signed-off-by: Shern Shiou Tan <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* Bump chart version to 0.1.14 (vllm-project#1190)

Signed-off-by: Rui Zhang <[email protected]>

---------

Signed-off-by: Muhammad Ibrahim <[email protected]>
Signed-off-by: YE <[email protected]>
Signed-off-by: zjjkee <[email protected]>
Signed-off-by: David-Wu1119 <[email protected]>
Signed-off-by: Dundy Pasupuleti <[email protected]>
Signed-off-by: MinJun Choi <[email protected]>
Signed-off-by: bojiang-li <[email protected]>
Signed-off-by: [email protected] <[email protected]>
Signed-off-by: Rui Zhang <[email protected]>
Signed-off-by: Shern Shiou Tan <[email protected]>
Signed-off-by: MinJun Choi <[email protected]>
Signed-off-by: Rui Zhang <[email protected]>
Signed-off-by: Bernardo Donadio <[email protected]>
Co-authored-by: Muhammad Ibrahim <[email protected]>
Co-authored-by: YE <[email protected]>
Co-authored-by: Jingke zou <[email protected]>
Co-authored-by: Yanze (David) Wu <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Rui Zhang <[email protected]>
Co-authored-by: Dundy Pasupuleti <[email protected]>
Co-authored-by: MinJun Choi <[email protected]>
Co-authored-by: Bojiang Li <[email protected]>
Co-authored-by: MaelvanDijk <[email protected]>
Co-authored-by: [email protected] <[email protected]>
Co-authored-by: Shern Shiou Tan <[email protected]>
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.

bug: dynamic config reload drops prefill/decode labels, P/D routers stop routing

3 participants