Skip to content

Conversation

noooop
Copy link
Contributor

@noooop noooop commented Jul 14, 2025

TL;DR

  • The pooling model using LAST Pooling and causal attention defaults to using chunked prefill & prefix caching. e.g.
    • SequenceClassification: tomaarsen/Qwen3-Reranker-0.6B-seq-cls
    • Embedding: Qwen/Qwen3-Embedding-0.6B (Embedding models? using chunked prefill & prefix caching? Weird? But why not!
  • The following types of models do not support chunked prefill & prefix caching
    • Bert like Bidirectional models (non-causal attention models) e.g. Embedding:intfloat/e5-small;SequenceClassification: papluca/xlm-roberta-base-language-detection
    • Use the [LLM2Vec] method to convert causal attention into bidirectional attention. e.g. Embedding:Alibaba-NLP/gte-Qwen2-1.5B-instruct
    • Causal attention models do not use LAST Pooling, such as using MEAN Pooling. There are no examples of this in the models supported by vllm currently.

Essential Elements of an Effective PR Description Checklist

  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.

Purpose

ModelForPooling = _create_pooling_model_cls(
cls,
default_pooling_type=PoolingType.LAST,
default_normalize=False,
default_softmax=True,
)

This piece of code may not affect the main process…

refer to #20012

  • set default_pooling_type in vllm.config

  • Keep Decode-only SequenceClassification models support auto prefix cache

  • The pooler_config in the startup log shows the correct pooling_type instead of None, which will help with debugging

  • LLM.encode() and pooling server uses ALL pooling, which does not support chunked prefill. e.g. jason9693/Qwen2.5-1.5B-apeach

cc @DarkLight1337 @maxdebayser

Test Plan

pytest -s -vvv tests/test_config.py::test_default_pooling_type
pytest -s -vvv tests/models/language/pooling/test_auto_prefix_cache_support.py
pytest -s -vvv tests/entrypoints/llm/test_classify.py::test_encode_api
pytest -s -vvv tests/entrypoints/openai/test_classification.py::test_pooling

Add test for default_pooling_type in tests/models/language/pooling/mteb_utils.py, double check all implementations use the correct default_pooling_type

Test Result

passed

(Optional) Documentation Update

Fix #20894
Fix #19950

implicit conversion part split to #21103

Copy link

👋 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 fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

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 ready label to the PR or enable auto-merge.

🚀

@mergify mergify bot added the llama Related to Llama models label Jul 14, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @noooop, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves how vLLM handles Hugging Face ForSequenceClassification models. It introduces an automatic conversion mechanism that allows any ForCausalLM model to be used for sequence classification without requiring explicit registration or custom wrapper classes. This change streamlines model integration, centralizes classification task detection, and enhances the flexibility of vLLM's model loading and execution pipeline, while also addressing a reported issue with the TRANSFORMERS implementation for these models.

Highlights

  • Automatic ForSequenceClassification Support: I've implemented a new mechanism to automatically convert ForCausalLM models into ForSequenceClassification models by dynamically applying an adapter. This removes the need for explicit registration and custom wrapper classes for each specific model type, streamlining model integration.
  • Centralized Classification Task Logic: I've introduced a new _is_classify_task method and updated the task resolution in vllm/config.py. This provides a more robust way to identify and handle classification tasks, ensuring they are correctly routed to the 'pooling' runner.
  • Refactored Model Registry: The model registry has been cleaned up by removing explicit entries for automatically convertible ForSequenceClassification models. The registry's ability to inspect and normalize these architectures on the fly has been enhanced, making it more flexible.
  • Improved ScoreModel Bias Handling: The _ScoreModel adapter now correctly respects the score_bias configuration from the Hugging Face model config. This allows classification heads to have a bias if specified by the original model.
  • Enhanced Testing Coverage: The test suite for model initialization (test_initialization.py) now includes automatically converted ForSequenceClassification models, ensuring the new automatic support mechanism functions as expected.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mergify mergify bot added new-model Requests to new models qwen Related to Qwen models labels Jul 14, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 model loading and registration logic to automatically support ForSequenceClassification models, which is a great improvement. The changes involve removing hardcoded model registrations and introducing dynamic conversion logic.

My review has identified a critical issue in the new conversion logic in vllm/model_executor/model_loader/utils.py that could lead to incorrect model loading. I've also pointed out a few medium-severity issues related to code clarity, maintainability, and a typo. Addressing these points will improve the robustness and readability of the new implementation.

@vrdn-23
Copy link
Contributor

vrdn-23 commented Jul 14, 2025

This looks awesome @noooop!
Question: Would this extend to only currently supported models or would it negate the need to have separate PRs for non-LLM models (like this for example #20215)?

@noooop
Copy link
Contributor Author

noooop commented Jul 15, 2025

This looks awesome @noooop! Question: Would this extend to only currently supported models or would it negate the need to have separate PRs for non-LLM models (like this for example #20215)?

DebertaV2ForSequenceClassification uses classifier, while this pr uses score, so it is not supported. Is the title not well chosen? In fact, this pr only implements a small amount of functionality.

@noooop noooop changed the title [Model] Automatically support all ForSequenceClassification models [Model] Re-add the implicit conversion feature for as_seq_cls_model Jul 15, 2025
Copy link
Contributor

@maxdebayser maxdebayser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, this is going in the right direction

Copy link

mergify bot commented Jul 15, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @noooop.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Jul 15, 2025
@noooop noooop changed the title [Model] Re-add the implicit conversion feature for as_seq_cls_model [Model] Auto retrieve default_pooling_type Jul 17, 2025
@noooop noooop closed this Jul 21, 2025
@noooop noooop force-pushed the auto_conversion branch from e0303da to 8188196 Compare July 21, 2025 03:22
@noooop noooop reopened this Jul 21, 2025
@mergify mergify bot removed the needs-rebase label Jul 21, 2025
@noooop noooop changed the title [Model] Auto retrieve default_pooling_type [Model] Auto resolve default_pooling_type Jul 21, 2025
@noooop noooop marked this pull request as ready for review July 21, 2025 06:57
@DarkLight1337
Copy link
Member

Looks like Prithvi failure in https://buildkite.com/vllm/ci/builds/26638/steps/canvas?jid=01989bd9-f941-48bf-b60a-6b25eb361cb9 is caused by this PR, please fix

@DarkLight1337
Copy link
Member

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683] EngineCore failed to start.

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683] Traceback (most recent call last):

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683]   File "/usr/local/lib/python3.12/dist-packages/vllm/v1/engine/core.py", line 674, in run_engine_core

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683]     engine_core = EngineCoreProc(*args, **kwargs)

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683]                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683]   File "/usr/local/lib/python3.12/dist-packages/vllm/v1/engine/core.py", line 475, in __init__

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683]     super().__init__(vllm_config, executor_class, log_stats,

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683]   File "/usr/local/lib/python3.12/dist-packages/vllm/v1/engine/core.py", line 87, in __init__

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683]     self._initialize_kv_caches(vllm_config)

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683]   File "/usr/local/lib/python3.12/dist-packages/vllm/v1/engine/core.py", line 196, in _initialize_kv_caches

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683]     self.model_executor.initialize_from_config(kv_cache_configs)

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683]   File "/usr/local/lib/python3.12/dist-packages/vllm/v1/executor/abstract.py", line 66, in initialize_from_config

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683]     self.collective_rpc("compile_or_warm_up_model")

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683]   File "/usr/local/lib/python3.12/dist-packages/vllm/executor/uniproc_executor.py", line 58, in collective_rpc

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683]     answer = run_method(self.driver_worker, method, args, kwargs)

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683]   File "/usr/local/lib/python3.12/dist-packages/vllm/utils/__init__.py", line 2977, in run_method

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683]     return func(*args, **kwargs)

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683]            ^^^^^^^^^^^^^^^^^^^^^

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683]   File "/usr/local/lib/python3.12/dist-packages/vllm/v1/worker/gpu_worker.py", line 337, in compile_or_warm_up_model

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683]     self.model_runner._dummy_pooler_run(hidden_states)

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683]   File "/usr/local/lib/python3.12/dist-packages/torch/utils/_contextlib.py", line 116, in decorate_context

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683]     return func(*args, **kwargs)

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683]            ^^^^^^^^^^^^^^^^^^^^^

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683]   File "/usr/local/lib/python3.12/dist-packages/vllm/v1/worker/gpu_model_runner.py", line 2468, in _dummy_pooler_run

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683]     max_task = max(output_size.items(), key=lambda x: x[1])[0]

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683]                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

[2025-08-12T02:40:27Z] �[1;36m(EngineCore_0 pid=16845)�[0;0m ERROR 08-11 19:40:27 [core.py:683] ValueError: max() iterable argument is empty

@DarkLight1337
Copy link
Member

Looks like for this model encode is accidentally disabled

aarnphm pushed a commit to aarnphm/vllm that referenced this pull request Aug 13, 2025
…ing if supported. (vllm-project#20930)

Signed-off-by: wang.yuqi <noooop@126.com>
paulpak58 pushed a commit to paulpak58/vllm that referenced this pull request Aug 13, 2025
…ing if supported. (vllm-project#20930)

Signed-off-by: wang.yuqi <noooop@126.com>
Signed-off-by: Paul Pak <paulpak58@gmail.com>
taneem-ibrahim pushed a commit to taneem-ibrahim/vllm that referenced this pull request Aug 14, 2025
…ing if supported. (vllm-project#20930)

Signed-off-by: wang.yuqi <noooop@126.com>
BoyuanFeng pushed a commit to BoyuanFeng/vllm that referenced this pull request Aug 14, 2025
…ing if supported. (vllm-project#20930)

Signed-off-by: wang.yuqi <noooop@126.com>
Signed-off-by: Boyuan Feng <boyuan@meta.com>
diegocastanibm pushed a commit to diegocastanibm/vllm that referenced this pull request Aug 15, 2025
…ing if supported. (vllm-project#20930)

Signed-off-by: wang.yuqi <noooop@126.com>
Signed-off-by: Diego-Castan <diego.castan@ibm.com>
juuice-lee pushed a commit to juuice-lee/vllm-moe.code that referenced this pull request Aug 18, 2025
…ing if supported. (vllm-project#20930)

Signed-off-by: wang.yuqi <noooop@126.com>
yiliu30 pushed a commit to yiliu30/vllm-fork that referenced this pull request Aug 19, 2025
…ing if supported. (vllm-project#20930)

Signed-off-by: wang.yuqi <noooop@126.com>
epwalsh pushed a commit to epwalsh/vllm that referenced this pull request Aug 28, 2025
…ing if supported. (vllm-project#20930)

Signed-off-by: wang.yuqi <noooop@126.com>
xiao-llm pushed a commit to xiao-llm/vllm that referenced this pull request Aug 28, 2025
…ing if supported. (vllm-project#20930)

Signed-off-by: wang.yuqi <noooop@126.com>
Signed-off-by: Xiao Yu <xiao.yu@amd.com>
xiao-llm pushed a commit to xiao-llm/vllm that referenced this pull request Aug 28, 2025
…ing if supported. (vllm-project#20930)

Signed-off-by: wang.yuqi <noooop@126.com>
Signed-off-by: Xiao Yu <xiao.yu@amd.com>
zhewenl pushed a commit to zhewenl/vllm that referenced this pull request Aug 28, 2025
…ing if supported. (vllm-project#20930)

Signed-off-by: wang.yuqi <noooop@126.com>
dumb0002 pushed a commit to dumb0002/vllm that referenced this pull request Aug 28, 2025
…ing if supported. (vllm-project#20930)

Signed-off-by: wang.yuqi <noooop@126.com>
googlercolin pushed a commit to googlercolin/vllm that referenced this pull request Aug 29, 2025
…ing if supported. (vllm-project#20930)

Signed-off-by: wang.yuqi <noooop@126.com>
@hmellor
Copy link
Member

hmellor commented Sep 20, 2025

@noooop where is is_causal set on PretrainedConfigs?

As far as I know is_causal is only set for Attention classes in Transformers

@noooop
Copy link
Contributor Author

noooop commented Sep 20, 2025

@noooop where is is_causal set on PretrainedConfigs?

As far as I know is_causal is only set for Attention classes in Transformers

Here is some detailed background

Alibaba-NLP/gte-Qwen2-1.5B-instruct uses the methods mentioned in llm2vec (As far as I know, this is the first model that uses is_causal)

we introduce LLM2Vec, a simple unsupervised approach that can transform any decoder-only LLM into a strong text encoder.

# By default, Qwen2 uses causal attention as it is a decoder-only model.
# You can override the HF config with `is_causal=False` to enable
# bidirectional attention, which is used in some embedding models
# (e.g. Alibaba-NLP/gte-Qwen2-7B-instruct)
if getattr(config, "is_causal", True):
attn_type = AttentionType.DECODER
else:
attn_type = AttentionType.ENCODER_ONLY

#23154 (comment)

#24636 ( Sorry, I should have added a comment

I hope to use is_causal as a vllm conventional flag to indicate whether to use llm2vec method in the future, e.g. google/embeddinggemma-300m

https://github.com/vllm-project/vllm/pull/24318/files#diff-3bc5cc9c6f85c41c016f7a08808cc0b3021c8e13fd7ad92aa20077efb1f4a354

@hmellor
Copy link
Member

hmellor commented Sep 20, 2025

Thanks for the context.

The problem is that all legacy encoder models (where is_causal would be false if it existed) will resolve to true (the default you add in this PR). This means that prefix caching and chunked prefill will be enabled for models with no KV cache and vLLM will crash.

@noooop
Copy link
Contributor Author

noooop commented Sep 20, 2025

Thanks for the context.

The problem is that all legacy encoder models (where is_causal would be false if it existed) will resolve to true (the default you add in this PR). This means that prefix caching and chunked prefill will be enabled for models with no KV cache and vLLM will crash.

in #24636

if self.model_config:
if self.model_config.pooler_config:
pooling_type = self.model_config.pooler_config.pooling_type
if pooling_type is None or pooling_type.lower() != "last":
disable_chunked_prefill_reasons.append(
"Only \"last\" pooling supports chunked "
"prefill and prefix caching; disabling both.")
if not getattr(self.model_config.hf_config, "is_causal", True):
disable_chunked_prefill_reasons.append(
"Only models using causal attention supports chunked "
"prefill and prefix caching; disabling both.")
elif self.model_config.is_encoder_decoder:
self.scheduler_config.max_num_encoder_input_tokens = \

I thought self.model_config.pooler_config is not None means It is a pooling model, means not self.model_config.is_encoder_decoder. Perhaps this taxonomy is wrong.

I'm sorry about it

I think the following code should not be run in the encoder_decoder model, but I am not familiar with this code and don't know where to put it.

        if not getattr(self.model_config.hf_config, "is_causal", True):
            disable_chunked_prefill_reasons.append(
                "Only models using causal attention supports chunked "
                "prefill and prefix caching; disabling both.")

The current vllm model config is spaghetti code, We need to find a way to refactor it

@hmellor
Copy link
Member

hmellor commented Sep 20, 2025

Sorry I should clarify, I mean encoder-only models. vLLM doesn't support encoder-decoder models anymore so they aren't relevant here.

I noticed this issue when using the Transformers backend to load Albert.

 if self.model_config:  # True
     if self.model_config.pooler_config:  # True
         pooling_type = self.model_config.pooler_config.pooling_type 
         if pooling_type is None or pooling_type.lower() != "last":  # False
             disable_chunked_prefill_reasons.append( 
                 "Only \"last\" pooling supports chunked " 
                 "prefill and prefix caching; disabling both.") 
         if not getattr(self.model_config.hf_config, "is_causal", True):  # False! But should be True 
             disable_chunked_prefill_reasons.append( 
                 "Only models using causal attention supports chunked " 
                 "prefill and prefix caching; disabling both.") 

This is the problem because AlbertConfig (along with most model configs) has no is_causal, so the default True is used and prefix caching/chunked prefill are enabled erroneously.

Comment on lines 643 to +657

def default_pooling_type(pooling_type: str) -> object:
"""Set default_pooling_type decorator. """

def func(model: object):
model.default_pooling_type = pooling_type
return model

return func


def get_default_pooling_type(model: Union[type[object], object]) -> str:
return getattr(model, "default_pooling_type", "LAST")


Copy link
Contributor Author

@noooop noooop Sep 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hmellor

This PR introduces default_pooling_type to avoid enable chunked_prefill for bidirectional attention models such as BERT.

However, the Transformers backend does not have default_pooling_type. (This results in the default being last pooling)

How about, disable chunked_prefill for all pooling models using Transformers backend. Until we have a way to distinguish whether the Transformers backend uses bidirectional attention or causal attention

Copy link
Member

@hmellor hmellor Sep 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pointer.

However, the Transformers backend does not have default_pooling_type. (This results in the default being last pooling)

For the Transformers backend I'm not sure it makes sense to have a static default pooling type because it could load models that should have different defaults. When is this checked? Could we set default_pooling_type dynamically on init of TransformersModel?

How about, disable chunked_prefill for all pooling models using Transformers backend. Until we have a way to distinguish whether the Transformers backend uses bidirectional attention or causal attention

TransformersModel also works with causal embeddings models so I'd rather not disable these features globally for the feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TransformersModel also works with causal embeddings models so I'd rather not disable these features globally for the feature.

I also want TransformersModel to support chunked_prefill, but there is no good way to distinguish whether TransformersModel is causal attention or bidirectional attention

In particular, Transformers allow loading arbitrary modules via trust_remote_code. (
I'm not 100% sure vllm currently supports loading arbitrary modules, but it will eventually.)

┓( ´∀` )┏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend llama Related to Llama models new-model Requests to new models qwen Related to Qwen models ready ONLY add when PR is ready to merge/full CI is needed v1
Projects
None yet
6 participants