Skip to content

[Bugfix] Fail instead of ignoring when CompilationConfig gets invalid args#30708

Merged
hmellor merged 1 commit intovllm-project:mainfrom
neuralmagic:forbid-extra-compile-configs
Dec 15, 2025
Merged

[Bugfix] Fail instead of ignoring when CompilationConfig gets invalid args#30708
hmellor merged 1 commit intovllm-project:mainfrom
neuralmagic:forbid-extra-compile-configs

Conversation

@mgoin
Copy link
Copy Markdown
Member

@mgoin mgoin commented Dec 15, 2025

Purpose

I noticed this when trying to run with an old flag of -cc.use_inductor=False where I saw that my arg was completely ignored:

vllm serve Qwen/Qwen3-Next-80B-A3B-Instruct-FP8 --port 9000 --tensor-parallel-size 1 --max-model-len 50k --speculative-config '{"method":"qwen3_next_mtp","num_speculative_tokens":2}' -cc.use_inductor=false
(APIServer pid=3033517) INFO 12-15 12:44:29 [api_server.py:1351] vLLM API server version 0.11.2.dev695+g5c213d289
(APIServer pid=3033517) INFO 12-15 12:44:29 [utils.py:253] non-default args: {'model_tag': 'Qwen/Qwen3-Next-80B-A3B-Instruct-FP8', 'port': 9000, 'model': 'Qwen/Qwen3-Next-80B-A3B-Instruct-FP8', 'max_model_len': 50000, 'speculative_config': {'method': 'qwen3_next_mtp', 'num_speculative_tokens': 2}}

Now when I run the same command, I see a usage failure as expected:

vllm serve Qwen/Qwen3-Next-80B-A3B-Instruct-FP8 --port 9000 --tensor-parallel-size 1 --max-model-len 50k --speculative-config '{"method":"qwen3_next_mtp","num_speculative_tokens":2}' -cc.use_inductor=false
usage: vllm serve [model_tag] [options]
vllm serve: error: argument --compilation-config/-cc: 1 validation error for CompilationConfig
use_inductor
  Unexpected keyword argument [type=unexpected_keyword_argument, input_value=False, input_type=bool]
    For further information visit https://errors.pydantic.dev/2.12/v/unexpected_keyword_argument

Test Plan

Test Result


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.

@mergify mergify bot added the performance Performance-related issues label Dec 15, 2025
@mgoin mgoin added bug Something isn't working ready ONLY add when PR is ready to merge/full CI is needed torch.compile and removed performance Performance-related issues labels Dec 15, 2025
@mergify mergify bot added the performance Performance-related issues label Dec 15, 2025
Copy link
Copy Markdown
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 addresses an issue where invalid arguments for CompilationConfig were silently ignored. By adding config=ConfigDict(extra="forbid") to the Pydantic dataclasses PassConfig, DynamicShapesConfig, and CompilationConfig, the code now correctly raises a validation error for unexpected arguments. This improves the robustness of the configuration parsing and provides clear feedback to users about invalid flags. The related test cases in tests/benchmarks/test_param_sweep.py that used a now-invalid argument have been correctly removed. The changes are well-targeted and effectively resolve the issue. The implementation is clean and follows best practices for Pydantic configuration. I have reviewed the changes and found no issues.

Copy link
Copy Markdown
Member

@hmellor hmellor left a comment

Choose a reason for hiding this comment

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

Good catch, this should probably be implemented in all config classes. At some point I'll have another look into merging

@config
@dataclass

into just

@config

where defaults like this can be set.

@hmellor hmellor enabled auto-merge (squash) December 15, 2025 18:22
@hmellor hmellor merged commit a450c64 into vllm-project:main Dec 15, 2025
52 of 53 checks passed
@github-project-automation github-project-automation bot moved this from To triage to Done in torch.compile integration Dec 15, 2025
Majid-Taheri pushed a commit to Majid-Taheri/vllm that referenced this pull request Dec 23, 2025
… args (vllm-project#30708)

Signed-off-by: mgoin <mgoin64@gmail.com>
Signed-off-by: Ubuntu <mjtaheri68@gmail.com>
dsuhinin pushed a commit to dsuhinin/vllm that referenced this pull request Jan 21, 2026
… args (vllm-project#30708)

Signed-off-by: mgoin <mgoin64@gmail.com>
Signed-off-by: dsuhinin <suhinin.dmitriy@gmail.com>
ItzDEXX pushed a commit to ItzDEXX/vllm that referenced this pull request Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working performance Performance-related issues ready ONLY add when PR is ready to merge/full CI is needed torch.compile

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants