-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
[RFC]: Make any vLLM model a pooling model #10674
Comments
I think this makes sense, but we should add a verification to prevent models that are already loaded as embedding models to be wrapped again. Would this wrapper assume a default Pooling configuration or should we raise an error if the user doesn't provide this information on the command line? |
I'm thinking of removing the existing embedding model implementations and replacing them with the wrapper. The embedding wrapper's default pooler config is shown in the above example. I'm thinking of resolving the pooler config in the same way as current code (i.e.: user > sentence-transformers > model), so the user doesn't have to provide this information in most cases. |
What would happen if the user loads a BertModel without |
In |
Ok, I think this makes sense. |
Update: I have expanded the scope of this RFC to cover all pooling-based models. |
Motivation.
Currently, we have to open new PRs to add pooling functionality for existing architectures supported in vLLM. Since the code involved is basically the same for each model, there is potential to automate away this boilerplate.
Proposed Change.
Implement a pooling adapter that can be applied to any existing text generation model in vLLM. To preserve features such as LoRA, PP and multimodality, the adapter simply creates a new subclass of the original model.
The pooling adapter to apply depends on the purpose of the model. To facilitate this, the
embedding
task will be split up, so that the user can specify which adapter to apply to the model via--task
:Meanwhile, current embedding-related classes will be renamed to avoid confusion between
embed
and other pooling tasks:Feedback Period.
1-2 weeks
CC List.
@youkaichao @mgoin @robertgshaw2-neuralmagic @maxdebayser
Any Other Things.
Note that we can still directly map to pooling models in the model registry. This is used when the model architecture has different pooling defaults (e.g.
pooling_type=CLS
for BERT) or additional modules (e.g.score
inQwen2ForRewardModel
). For models that already support pooling, the adapter returns the original model without modifications.Before submitting a new issue...
The text was updated successfully, but these errors were encountered: