Skip to content

[V1] Raise error if chunked prefill is explicitly disabled#21645

Closed
22quinn wants to merge 2 commits intovllm-project:mainfrom
22quinn:v1-no-chunked-prefill
Closed

[V1] Raise error if chunked prefill is explicitly disabled#21645
22quinn wants to merge 2 commits intovllm-project:mainfrom
22quinn:v1-no-chunked-prefill

Conversation

@22quinn
Copy link
Copy Markdown
Collaborator

@22quinn 22quinn commented Jul 26, 2025

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.

Purpose

Currently when a user specify --no-enable-chunked-prefill or enable_chunked_prefill=False, it will silently overwrite the setting to True. This PR raises an explicit error telling user it's not supported.
Users have asked for this behaviour e.g. in #18547

Test Plan

vllm serve:

$ vllm serve Qwen/Qwen3-0.6B --no-enable-chunked-prefill
INFO 07-25 21:36:36 [__init__.py:235] Automatically detected platform cuda.
INFO 07-25 21:36:38 [api_server.py:1775] vLLM API server version 0.1.dev7998+g2f6e6b3
INFO 07-25 21:36:38 [cli_args.py:264] non-default args: {'model_tag': 'Qwen/Qwen3-0.6B', 'enable_chunked_prefill': False}
INFO 07-25 21:36:42 [config.py:1605] Using max model len 40960
Traceback (most recent call last):
--- stack omitted ---
  File "/home/user/dev/vllm/vllm/engine/arg_utils.py", line 1533, in _set_default_args_v1
    raise ValueError(
ValueError: Cannot disable chunked prefill for V1 engine.

LLM class:

>>> llm = LLM(model="Qwen/Qwen3-0.6B", enable_chunked_prefill=False)
INFO 07-25 21:37:26 [config.py:1605] Using max model len 40960
Traceback (most recent call last):
...
  File "/home/user/dev/vllm/vllm/engine/arg_utils.py", line 1533, in _set_default_args_v1
    raise ValueError("Cannot disable chunked prefill for V1 engine.")
ValueError: Cannot disable chunked prefill for V1 engine.

Test Result

See above

(Optional) Documentation Update

Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

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 introduces a validation check to explicitly raise an error if a user attempts to disable chunked prefill for the V1 engine, which is an unsupported configuration. Previously, this setting was silently ignored and overridden. The change is straightforward, correctly implemented, and improves the user experience by providing clear feedback on unsupported configurations. The test cases provided in the pull request description adequately demonstrate the new behavior.

Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
devices, otherwise default to `16`.
- `enable_chunked_prefill`: Set to `False` instead of `None` for
test reproducibility.
- `enable_chunked_prefill`: Set to `None` to support V1 tests.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@DarkLight1337 do you know the context for this? Feels we can set False individually for tests that need them?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I forgot, it has been so long ago

# for non-pooling tasks.
# For pooling tasks the default is False
if model_config.runner_type != "pooling":
if self.enable_chunked_prefill is False:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@WoosukKwon does it make sense to disable this completely?

@lhtin
Copy link
Copy Markdown
Contributor

lhtin commented Sep 26, 2025

This error message is very helpful for the user experience. Any update?

@22quinn
Copy link
Copy Markdown
Collaborator Author

22quinn commented Nov 17, 2025

closing for #28833

@22quinn 22quinn closed this Nov 17, 2025
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.

3 participants