Skip to content

[RFC]: Make any vLLM model a pooling model #10674

@DarkLight1337

Description

@DarkLight1337

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 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions