Use helper function instead of looping through attribute names#29788
Use helper function instead of looping through attribute names#29788hmellor merged 3 commits intovllm-project:mainfrom
Conversation
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
There was a problem hiding this comment.
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>
|
@ProExpertProg should be good now |
…project#29788) Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Signed-off-by: Ubuntu <mjtaheri68@gmail.com>
Signed-off-by: Xingyu Liu <charlotteliu12x@gmail.com>
…project#29788) Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
…project#29788) Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Signed-off-by: dsuhinin <suhinin.dmitriy@gmail.com>
…project#29788) Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Since we have the helper function, it'd be better to use it so that the behaviour is consistent.