-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Description
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.
- Embedding model adapter: [Model] Replace embedding models with pooling adapter #10769
- Classification model adapter [Model] Automatic conversion of classification and reward models #11469
- Reward model adapter [Model] Automatic conversion of classification and reward models #11469
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
in Qwen2ForRewardModel
). For models that already support pooling, the adapter returns the original model without modifications.
Before submitting a new issue...
- Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.