Skip to content

[Misc] Fix Current vLLM config is not set. warnings, assert to avoid issues in the future#31747

Merged
simon-mo merged 26 commits intovllm-project:mainfrom
neuralmagic:lwilkinson/fix-warnings
Jan 8, 2026
Merged

[Misc] Fix Current vLLM config is not set. warnings, assert to avoid issues in the future#31747
simon-mo merged 26 commits intovllm-project:mainfrom
neuralmagic:lwilkinson/fix-warnings

Conversation

@LucasWilkinson
Copy link
Collaborator

@LucasWilkinson LucasWilkinson commented Jan 5, 2026

#30531 and #29575 introduced accesses to get_current_vllm_config on boot that are outside of set_current_vllm_config contexts leading to repeated logs

(EngineCore_DP0 pid=1647618) WARNING 01-05 16:41:49 [vllm.py:1447] Current vLLM config is not set.
(EngineCore_DP0 pid=1647618) INFO 01-05 16:41:49 [scheduler.py:231] Chunked prefill is enabled with max_num_batched_tokens=2048.
(EngineCore_DP0 pid=1647618) INFO 01-05 16:41:49 [vllm.py:635] Disabling NCCL for DP synchronization when using async scheduling.
(EngineCore_DP0 pid=1647618) INFO 01-05 16:41:49 [vllm.py:640] Asynchronous scheduling is enabled.
(EngineCore_DP0 pid=1647618) INFO 01-05 16:41:49 [dp_utils.py:30] Using CPU all reduce to synchronize DP padding between ranks.

when get_current_vllm_config falls back to creating a default config. This also lead to slight config propagation bugs as some custom ops would see the default config instead of the real one.

This PR fixes those accesses and makes it an assert to try to avoid this in the future.

Longer term we should consider something like: #30859

TODO: get CI green with targeted additions of VLLM_ALLOW_DEFAULT_CONFIG

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

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 improves the robustness of the vLLM configuration handling by replacing a warning with an assertion when the configuration is not set. This helps to catch potential bugs early. An environment variable VLLM_ALLOW_DEFAULT_CONFIG is introduced to maintain the old behavior for testing purposes, which is a thoughtful addition.

The other changes in the pull request are logical consequences of this stricter configuration check. The use of a lazy dictionary in vllm/model_executor/layers/fused_moe/cpu_fused_moe.py correctly defers the instantiation of CustomOp subclasses until they are needed, avoiding errors during module import. Similarly, caching the GroupedTopk instance in vllm/model_executor/layers/fused_moe/layer.py is a good optimization that also resolves the configuration access issue.

Overall, the changes are well-implemented, improve code quality, and I have no concerns.

@mergify
Copy link

mergify bot commented Jan 5, 2026

Hi @LucasWilkinson, the pre-commit checks have failed. Please run:

uv pip install pre-commit
pre-commit install
pre-commit run --all-files

Then, commit the changes and push to your branch.

For future commits, pre-commit will run automatically on changed files before each commit.

Tip

Is mypy or markdownlint failing?
mypy and markdownlint are run differently in CI. If the failure is related to either of these checks, please use the following commands to run them locally:
# For mypy (substitute "3.10" with the failing version if needed)
pre-commit run --hook-stage manual mypy-3.10
# For markdownlint
pre-commit run --hook-stage manual markdownlint

Copy link
Collaborator

@ProExpertProg ProExpertProg left a comment

Choose a reason for hiding this comment

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

Thanks for addressing this!

@LucasWilkinson LucasWilkinson added the ready-run-all-tests Trigger CI with all tests for wide-ranging PRs label Jan 5, 2026
@mergify mergify bot added multi-modality Related to multi-modality (#4194) nvidia v1 labels Jan 6, 2026
@mergify
Copy link

mergify bot commented Jan 6, 2026

Hi @LucasWilkinson, the pre-commit checks have failed. Please run:

uv pip install pre-commit
pre-commit install
pre-commit run --all-files

Then, commit the changes and push to your branch.

For future commits, pre-commit will run automatically on changed files before each commit.

Tip

Is mypy or markdownlint failing?
mypy and markdownlint are run differently in CI. If the failure is related to either of these checks, please use the following commands to run them locally:
# For mypy (substitute "3.10" with the failing version if needed)
pre-commit run --hook-stage manual mypy-3.10
# For markdownlint
pre-commit run --hook-stage manual markdownlint

1 similar comment
@mergify
Copy link

mergify bot commented Jan 6, 2026

Hi @LucasWilkinson, the pre-commit checks have failed. Please run:

uv pip install pre-commit
pre-commit install
pre-commit run --all-files

Then, commit the changes and push to your branch.

For future commits, pre-commit will run automatically on changed files before each commit.

Tip

Is mypy or markdownlint failing?
mypy and markdownlint are run differently in CI. If the failure is related to either of these checks, please use the following commands to run them locally:
# For mypy (substitute "3.10" with the failing version if needed)
pre-commit run --hook-stage manual mypy-3.10
# For markdownlint
pre-commit run --hook-stage manual markdownlint

Copy link
Collaborator

@ProExpertProg ProExpertProg left a comment

Choose a reason for hiding this comment

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

Just a nit for the error message, thanks for this cleanup!

@github-project-automation github-project-automation bot moved this to Ready in NVIDIA Jan 6, 2026
@mergify
Copy link

mergify bot commented Jan 6, 2026

Hi @LucasWilkinson, the pre-commit checks have failed. Please run:

uv pip install pre-commit
pre-commit install
pre-commit run --all-files

Then, commit the changes and push to your branch.

For future commits, pre-commit will run automatically on changed files before each commit.

Tip

Is mypy or markdownlint failing?
mypy and markdownlint are run differently in CI. If the failure is related to either of these checks, please use the following commands to run them locally:
# For mypy (substitute "3.10" with the failing version if needed)
pre-commit run --hook-stage manual mypy-3.10
# For markdownlint
pre-commit run --hook-stage manual markdownlint

Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
@simon-mo simon-mo disabled auto-merge January 8, 2026 23:20
@simon-mo simon-mo merged commit 6cdf015 into vllm-project:main Jan 8, 2026
138 of 140 checks passed
@github-project-automation github-project-automation bot moved this from Ready to Done in NVIDIA Jan 8, 2026
yugong333 pushed a commit to yugong333/vllm that referenced this pull request Jan 9, 2026
…d issues in the future (vllm-project#31747)

Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Signed-off-by: Lucas Wilkinson <LucasWilkinson@users.noreply.github.com>
Co-authored-by: Luka Govedič <ProExpertProg@users.noreply.github.com>
@nvpohanh
Copy link
Contributor

nvpohanh commented Jan 9, 2026

Thanks for fixing this! Really appreciate it

akh64bit pushed a commit to akh64bit/vllm that referenced this pull request Jan 16, 2026
…d issues in the future (vllm-project#31747)

Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Signed-off-by: Lucas Wilkinson <LucasWilkinson@users.noreply.github.com>
Co-authored-by: Luka Govedič <ProExpertProg@users.noreply.github.com>
dsuhinin pushed a commit to dsuhinin/vllm that referenced this pull request Jan 21, 2026
…d issues in the future (vllm-project#31747)

Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Signed-off-by: Lucas Wilkinson <LucasWilkinson@users.noreply.github.com>
Co-authored-by: Luka Govedič <ProExpertProg@users.noreply.github.com>
Signed-off-by: dsuhinin <suhinin.dmitriy@gmail.com>
ItzDEXX pushed a commit to ItzDEXX/vllm that referenced this pull request Feb 19, 2026
…d issues in the future (vllm-project#31747)

Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Signed-off-by: Lucas Wilkinson <LucasWilkinson@users.noreply.github.com>
Co-authored-by: Luka Govedič <ProExpertProg@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cpu Related to CPU backends kv-connector multi-modality Related to multi-modality (#4194) nvidia ready ONLY add when PR is ready to merge/full CI is needed ready-run-all-tests Trigger CI with all tests for wide-ranging PRs v1

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Bug]: set_current_vllm_config() is only done during the initialization stage but not the runtime stage

5 participants