-
-
Couldn't load subscription status.
- Fork 10.8k
[Model][1/N] Support multiple poolers at model level #21227
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
Conversation
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
|
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can either: Add 🚀 |
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 introduces a major refactoring to support multiple pooling tasks at the model level. It introduces a DispatchPooler to route requests to different sub-poolers based on the task. The Pooler interface is updated with get_supported_tasks and helper methods like for_encode, for_embed, and for_classify. Many model implementations are updated to use this new structure. The changes are well-structured and improve modularity. I've found one high-severity issue related to weight loading in the new BertPoolingModel.
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
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.
Overall LGTM! Just a nit.
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
|
### What this PR does / why we need it? Fix [#21227](vllm-project/vllm#21227) to make ci happy - vLLM version: v0.9.2 - vLLM main: vllm-project/vllm@6b46c4b --------- Signed-off-by: wangli <wangli858794774@gmail.com>
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.
LGTM
### What this PR does / why we need it? Fix [#21227](vllm-project/vllm#21227) to make ci happy - vLLM version: v0.9.2 - vLLM main: vllm-project/vllm@6b46c4b --------- Signed-off-by: wangli <wangli858794774@gmail.com>
### What this PR does / why we need it? Fix [#21227](vllm-project/vllm#21227) to make ci happy - vLLM version: v0.9.2 - vLLM main: vllm-project/vllm@6b46c4b --------- Signed-off-by: wangli <wangli858794774@gmail.com>
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.FIX #21277
Purpose
This PR enables models to support multiple poolers, by:
Pooler.get_pooling_updatesintoPooler.get_supported_tasks.DispatchPoolerwhich dispatches pooler calls to sub-poolers based on the pooling task.Apart from enabling models to customize each pooling task, this would eventually also let us output intermediate results within the same request, e.g.:
encodepooler withALLpooling.LogitsProcessorinto a pooler.Future work:
DispatchPooleris not enabled at the API level yet. We still checkmodel_config.supported_taskswhich is based on the value of--task. This will be addressed in the next PR.--taskto--convertand ask users to pass--runner poolingto use pooling models in the next PR, emitting a deprecation warning to users still using--task.list(Pooler.get_supported_tasks())[0]instead of running profiling on every sub-pooler and getting the maximum memory usage. So, it is possible for OOM to occur during inference time. We can refine this in a later PR.pooling_typein the pooler config instead of the actual poolers being used, because the poolers are only created after model construction. Can we disable chunked prefill inside the model runner after the model is initialized?Notes:
LLM.encode(Pooling API) for embedding and classification models (except for models with Sentence Transforming pooler config) is changed by this PR because the defaultencodepooler is different from the defaultembedand defaultclassificationpooler. While technically a breaking change, users aren't supposed to use this API for embedding and classification tasks in the first place anyway.Other changes:
--task poolingto--task encode. This was introduced very recently in [Core] Support multiple tasks per model #20771 and is not documented, so this change should barely affect any users.BertModelinto a pooling variant and a non pooling variant to keep the type checker happy.cc @maxdebayser @noooop @22quinn
Test Plan
The existing tests should pass.
Test Result
(Optional) Documentation Update
Updated the Pooling Models page to explain the new mechanism.