Skip to content

Conversation

@panchao-hub
Copy link
Contributor

@panchao-hub panchao-hub commented Jan 4, 2026

What this PR does / why we need it?

In the training-inference switching scenario, there is no need to resume the model weights during KV cache resumption, as this would lead to format mismatch.

Does this PR introduce any user-facing change?

No

How was this patch tested?

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 aims to fix an issue with weight transposition in Reinforcement Learning scenarios by making the weight resumption conditional. The change introduces a check to ensure that weight transposition only occurs when the 'weights' tag is specified during the wake_up process. However, there is a critical bug in the implementation of this check. The condition ["weights"] in tags is used, which will not work as intended for a list of strings. It should be 'weights' in tags. This error will prevent the weights from being correctly transposed, defeating the purpose of the fix. I've provided a suggestion to correct this.

w13_data = param.transpose(1, 2)
w13_data = torch.nn.Parameter(w13_data, requires_grad=False)
setattr(parent_module, param_name, w13_data)
if tags is None or ["weights"] in tags:
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The condition ["weights"] in tags appears to be incorrect. Since tags is a list[str], this check will likely always evaluate to false. The intention seems to be to check for the presence of the "weights" tag, which should be written as 'weights' in tags. This is a critical issue as it could prevent the model weights from being correctly restored, leading to format mismatches and incorrect behavior in RL scenarios.

Suggested change
if tags is None or ["weights"] in tags:
if tags is None or "weights" in tags:

@github-actions
Copy link

github-actions bot commented Jan 4, 2026

👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:‌‌

  • A PR should do only one thing, smaller PRs enable faster reviews.
  • Every PR should include unit tests and end-to-end tests ‌to ensure it works and is not broken by other future PRs.
  • Write the commit message by fulfilling the PR description to help reviewer and future developers understand.

If CI fails, you can run linting and testing checks locally according Contributing and Testing.

@wangxiyuan wangxiyuan added ready read for review ready-for-test start test by label for PR labels Jan 4, 2026
@wangxiyuan wangxiyuan merged commit 42774df into vllm-project:main Jan 5, 2026
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready read for review ready-for-test start test by label for PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants