-
-
Couldn't load subscription status.
- Fork 10.9k
[Misc] Factor out common _apply_feature_select_strategy
#26003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Misc] Factor out common _apply_feature_select_strategy
#26003
Conversation
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
There was a problem hiding this 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 refactors the _apply_feature_select_strategy method, which was duplicated across several model files, into a common utility function get_num_selected_vision_tokens in vllm/model_executor/models/vision.py. This is a good improvement for code maintainability and reduces redundancy.
My review includes one suggestion to further improve the new utility function by consolidating duplicated logic, which will enhance maintainability and prevent potential future bugs.
| _C = TypeVar("_C", bound=PretrainedConfig) | ||
|
|
||
|
|
||
| class _RootConfig(Protocol[_C]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous type annotation was incorrect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test failure is in smolvlm model which is based on idefics3. That should have nothing to do with this PR
…ct#26003) Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk> Signed-off-by: yewentao256 <zhyanwentao@126.com>
…ct#26003) Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk> Signed-off-by: Tomer Asida <57313761+tomeras91@users.noreply.github.com>
…ct#26003) Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk> Signed-off-by: xuebwang-amd <xuebwang@amd.com>
…ct#26003) Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
…ct#26003) Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
…ct#26003) Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk> Signed-off-by: xuebwang-amd <xuebwang@amd.com>
Purpose
Follow-up to #25938
Test Plan
Unblock all MM model tests
Test Result
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.