Skip to content

Conversation

@wangxiyuan
Copy link
Contributor

@wangxiyuan wangxiyuan commented Nov 5, 2025

Purpose

use_v1 for get_attn_backend_cls is useless now. Since this is an interface impact change, let's deprecate it and remove it in the next release.

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.

@mergify mergify bot added rocm Related to AMD ROCm tpu Related to Google TPUs labels Nov 5, 2025
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 deprecates the use_v1 parameter in get_attn_backend_cls across various platform implementations. The changes are consistent and well-implemented. To provide backward compatibility for plugins, a try-except block is introduced in vllm/attention/selector.py. My review includes a suggestion to make this backward compatibility logic more robust by using inspect.signature instead of catching a broad TypeError, which will prevent masking potential bugs in plugins.

@heheda12345
Copy link
Collaborator

@hmellor what's the suggested way of marking an argument as will be deprecated?

@hmellor
Copy link
Member

hmellor commented Nov 6, 2025

Ordinarily it's more user facing APIs that we are deprecating (config fields, CLI arguments, API fields). We don't really have a lot of prescedent for the plugin interface.

I think the approach that's been taken is reasonable as it ensures backwards compatibility. The only notes I would make are:

  • Say in which version the deprecated argument will be removed in the warning
  • Add a !!! warning to the plugin docs for extra visibility (also detailing the version it will be removed in)

@wangxiyuan
Copy link
Contributor Author

@hmellor added the removal version to 0.12.0.

For plugin doc, I just notice that there no clear doc for hardware plugin. Only one I found is this: https://docs.vllm.ai/en/latest/design/plugin_system/#compatibility-guarantee I'd like to write a detail one for hardware plugin, include interface design, how it works, how to implement one and so on in a following PR.

@mergify
Copy link

mergify bot commented Nov 11, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @wangxiyuan.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Nov 11, 2025
if "use_v1" in sig.parameters:
logger.warning_once(
"use_v1 parameter for get_attn_backend_cls is deprecated and will "
"be removed in v0.12.0. Please remove it from your plugin code."
Copy link
Member

@hmellor hmellor Nov 11, 2025

Choose a reason for hiding this comment

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

Deprecation message must be present in at least one whole minor revision. (i.e. it will be present for the entirety of v0.12.0)

Suggested change
"be removed in v0.12.0. Please remove it from your plugin code."
"be removed in v0.13.0 or v1.0.0, whichever is soonest. "
"Please remove it from your plugin code."

@hmellor
Copy link
Member

hmellor commented Nov 11, 2025

I'd like to write a detail one for hardware plugin, include interface design, how it works, how to implement one and so on in a following PR.

For now, could you please add the warning to the section you linked. And then it can be superseded with the new document you write.

@wangxiyuan
Copy link
Contributor Author

@hmellor docs is here. #28532 I'll link it later.

Copy link
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.

LGTM. I'll wait to get some more eyes on this because it's a significant change

@github-project-automation github-project-automation bot moved this to In review in NVIDIA Nov 12, 2025
Copy link
Collaborator

@Yikun Yikun left a comment

Choose a reason for hiding this comment

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

use_sparse,
)
sig = inspect.signature(current_platform.get_attn_backend_cls)
if "use_v1" in sig.parameters:
Copy link
Collaborator

Choose a reason for hiding this comment

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

++! This really a nice practice to help plugin smoothly complete interface changes. Let's remove if "use_v1" in sig.parameters in next release

@Yikun Yikun added the ready ONLY add when PR is ready to merge/full CI is needed label Nov 12, 2025
@hmellor hmellor enabled auto-merge (squash) November 12, 2025 12:40
@hmellor hmellor merged commit 10138c9 into vllm-project:main Nov 12, 2025
51 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in NVIDIA Nov 12, 2025
hmellor added a commit to hmellor/vllm that referenced this pull request Nov 12, 2025
- vllm-project#28112 didn't cause conflicts but main still contained a `use_v1`
- Also fixes a pre-commit warning

Signed-off-by: Harry Mellor <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nvidia ready ONLY add when PR is ready to merge/full CI is needed rocm Related to AMD ROCm tpu Related to Google TPUs

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants