Skip to content

Use helper function instead of looping through attribute names#29788

Merged
hmellor merged 3 commits intovllm-project:mainfrom
hmellor:use-getattr-iter
Dec 23, 2025
Merged

Use helper function instead of looping through attribute names#29788
hmellor merged 3 commits intovllm-project:mainfrom
hmellor:use-getattr-iter

Conversation

@hmellor
Copy link
Member

@hmellor hmellor commented Dec 1, 2025

Since we have the helper function, it'd be better to use it so that the behaviour is consistent.

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
@chatgpt-codex-connector
Copy link

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

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 refactor attribute access to use a helper function for consistency. While the change in get_inputs_embeds_size is correct, the change in get_total_num_kv_heads introduces a critical bug. The refactoring alters the logic for finding the number of KV heads. The original code correctly skipped attributes that were present but None, while the new implementation with getattr_iter will return None if it's the value of the first attribute found. This can lead to a TypeError downstream. I've left a specific comment with a suggested fix.

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
@hmellor
Copy link
Member Author

hmellor commented Dec 23, 2025

@ProExpertProg should be good now

@hmellor hmellor enabled auto-merge (squash) December 23, 2025 15:44
@hmellor hmellor disabled auto-merge December 23, 2025 15:44
@hmellor hmellor enabled auto-merge (squash) December 23, 2025 15:44
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Dec 23, 2025
@hmellor hmellor merged commit c016c95 into vllm-project:main Dec 23, 2025
49 checks passed
@hmellor hmellor deleted the use-getattr-iter branch December 23, 2025 17:31
Majid-Taheri pushed a commit to Majid-Taheri/vllm that referenced this pull request Dec 23, 2025
…project#29788)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Ubuntu <mjtaheri68@gmail.com>
charlotte12l added a commit to charlotte12l/vllm that referenced this pull request Dec 24, 2025
Signed-off-by: Xingyu Liu <charlotteliu12x@gmail.com>
yiliu30 pushed a commit to yiliu30/vllm-fork that referenced this pull request Dec 30, 2025
…project#29788)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
dsuhinin pushed a commit to dsuhinin/vllm that referenced this pull request Jan 21, 2026
…project#29788)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: dsuhinin <suhinin.dmitriy@gmail.com>
ItzDEXX pushed a commit to ItzDEXX/vllm that referenced this pull request Feb 19, 2026
…project#29788)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants