Skip to content

Conversation

@yewentao256
Copy link
Member

@yewentao256 yewentao256 commented Sep 23, 2025

Purpose

Fix

vllm/v1/worker/gpu_model_runner.py:2386: error: Item "None" of "Any | None" has no attribute "num_draft_tokens"  [union-attr]
vllm/v1/worker/gpu_model_runner.py:2436: error: Item "None" of "Any | None" has no attribute "__iter__" (not iterable)  [union-attr]
vllm/v1/worker/gpu_model_runner.py:2461: error: Item "None" of "Any | None" has no attribute "__iter__" (not iterable)  [union-attr]
Found 3 errors in 1 file (checked 2 source files)

Signed-off-by: yewentao256 <[email protected]>
@yewentao256 yewentao256 added the ready ONLY add when PR is ready to merge/full CI is needed label Sep 23, 2025
@mergify mergify bot added the v1 label Sep 23, 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 addresses several mypy type errors in gpu_model_runner.py. The changes involve adding assert statements to help the type checker understand that certain optional variables are not None in specific code paths, which resolves union-attr errors. Additionally, the type hint for aux_hidden_states has been corrected to Optional[list[torch.Tensor]] to accurately reflect its usage as an iterable. The pull request also includes an improvement to an assertion message in _dummy_run to provide more context during debugging. These changes are correct and improve code quality and maintainability.

@DarkLight1337 DarkLight1337 merged commit 8b8a8af into vllm-project:main Sep 23, 2025
52 of 54 checks passed
@yewentao256 yewentao256 deleted the fix-pre-commit-issue branch September 23, 2025 20:10
FeiDaLI pushed a commit to FeiDaLI/vllm that referenced this pull request Sep 25, 2025
yewentao256 added a commit that referenced this pull request Oct 3, 2025
gjc0824 pushed a commit to gjc0824/vllm that referenced this pull request Oct 10, 2025
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 10, 2025
Signed-off-by: yewentao256 <[email protected]>
Signed-off-by: xuebwang-amd <[email protected]>
choprahetarth pushed a commit to Tandemn-Labs/vllm that referenced this pull request Oct 11, 2025
lywa1998 pushed a commit to lywa1998/vllm that referenced this pull request Oct 20, 2025
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 24, 2025
Signed-off-by: yewentao256 <[email protected]>
Signed-off-by: xuebwang-amd <[email protected]>
rtourgeman pushed a commit to rtourgeman/vllm that referenced this pull request Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed v1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants