Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions vllm/lora/model_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ def _maybe_init_mm(
self.punica_wrapper_mapping[lm_prefix] = llm_punica_wrapper

# First, determine if the model supports tower connector LoRA.
self.supports_tower_connector_lora = self.supports_mm and hasattr(
self.model, "get_num_mm_encoder_tokens"
self.supports_tower_connector_lora = (
self.supports_mm and self.model.supports_tower_connector_lora
)

# Then, handle the case where the feature is disabled in the config.
Expand Down
2 changes: 2 additions & 0 deletions vllm/model_executor/models/blip2.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,8 @@ def _get_prompt_updates(
class Blip2ForConditionalGeneration(
nn.Module, SupportsLoRA, SupportsMultiModal, SupportsPP, SupportsQuant
):
supports_tower_connector_lora = True

@classmethod
def get_placeholder_str(cls, modality: str, i: int) -> str | None:
if modality.startswith("image"):
Expand Down
1 change: 1 addition & 0 deletions vllm/model_executor/models/dots_ocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ class DotsOCRForCausalLM(nn.Module, SupportsMultiModal, SupportsPP, SupportsLoRA
"fc13": ["fc1", "fc3"],
}
supports_encoder_tp_data = True
supports_tower_connector_lora = True

@classmethod
def get_placeholder_str(cls, modality: str, i: int) -> str | None:
Expand Down
2 changes: 2 additions & 0 deletions vllm/model_executor/models/gemma3_mm.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,8 @@ class Gemma3ForConditionalGeneration(
}
)

supports_tower_connector_lora = True

@classmethod
def get_placeholder_str(cls, modality: str, i: int) -> str | None:
if modality.startswith("image"):
Expand Down
1 change: 1 addition & 0 deletions vllm/model_executor/models/gemma4_mm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,7 @@ class Gemma4ForConditionalGeneration(
# window instead of dropping them (which would make image attention
# causal-only for images larger than the sliding window).
mm_prefix_clamp_sliding_window: bool = True
supports_tower_connector_lora = True

packed_modules_mapping = {
"qkv_proj": [
Expand Down
1 change: 1 addition & 0 deletions vllm/model_executor/models/glm4_1v.py
Original file line number Diff line number Diff line change
Expand Up @@ -1759,6 +1759,7 @@ class Glm4vForConditionalGeneration(
)

supports_encoder_tp_data = True
supports_tower_connector_lora = True

@classmethod
def get_placeholder_str(cls, modality: str, i: int) -> str | None:
Expand Down
2 changes: 2 additions & 0 deletions vllm/model_executor/models/idefics3.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,8 @@ class Idefics3ForConditionalGeneration(nn.Module, SupportsMultiModal, SupportsLo
],
}

supports_tower_connector_lora = True

@classmethod
def get_placeholder_str(cls, modality: str, i: int) -> str | None:
if modality.startswith("image"):
Expand Down
6 changes: 6 additions & 0 deletions vllm/model_executor/models/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ class SupportsMultiModal(SupportsMultiModalEmbeddings, Protocol):
`multimodal_config.mm_device_do_normalize`.
"""

supports_tower_connector_lora: ClassVar[bool] = False
"""
A flag that indicates whether this model supports
`lora_config.enable_tower_connector_lora`.
"""

requires_raw_input_tokens: ClassVar[bool] = False
"""
A flag that indicates this model processes input id tokens
Expand Down
1 change: 1 addition & 0 deletions vllm/model_executor/models/internvl.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@ class InternVLChatModel(
SupportsEncoderCudaGraph,
):
supports_encoder_tp_data = True
supports_tower_connector_lora = True

@classmethod
def get_placeholder_str(cls, modality: str, i: int) -> str | None:
Expand Down
2 changes: 2 additions & 0 deletions vllm/model_executor/models/keye.py
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,8 @@ class BaseKeyeModule(nn.Module, SupportsMultiModal):
}
)

supports_tower_connector_lora = True

@classmethod
def get_placeholder_str(cls, modality: str, i: int) -> str | None:
if modality.startswith("image"):
Expand Down
2 changes: 2 additions & 0 deletions vllm/model_executor/models/llava.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,8 @@ class LlavaForConditionalGeneration(
}
)

supports_tower_connector_lora = True

@classmethod
def get_placeholder_str(cls, modality: str, i: int) -> str | None:
if modality.startswith("image"):
Expand Down
1 change: 1 addition & 0 deletions vllm/model_executor/models/llava_next.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ def _get_mm_fields_config(
class LlavaNextForConditionalGeneration(
nn.Module, SupportsLoRA, SupportsMultiModal, SupportsPP
):
supports_tower_connector_lora = True
packed_modules_mapping = {
"qkv_proj": ["q_proj", "k_proj", "v_proj"],
"gate_up_proj": ["gate_proj", "up_proj"],
Expand Down
2 changes: 2 additions & 0 deletions vllm/model_executor/models/llava_next_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ class LlavaNextVideoForConditionalGeneration(
}
)

supports_tower_connector_lora = True

@classmethod
def get_placeholder_str(cls, modality: str, i: int) -> str | None:
if modality.startswith("video"):
Expand Down
1 change: 1 addition & 0 deletions vllm/model_executor/models/mllama4.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,7 @@ class Llama4ForConditionalGeneration(
}

supports_encoder_tp_data = True
supports_tower_connector_lora = True

@classmethod
def get_placeholder_str(cls, modality: str, i: int) -> str | None:
Expand Down
2 changes: 2 additions & 0 deletions vllm/model_executor/models/paligemma.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ class PaliGemmaForConditionalGeneration(
}
)

supports_tower_connector_lora = True

@classmethod
def get_placeholder_str(cls, modality: str, i: int) -> str | None:
if modality.startswith("image"):
Expand Down
2 changes: 2 additions & 0 deletions vllm/model_executor/models/pixtral.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@ class PixtralForConditionalGeneration(
"gate_up_proj": ["gate_proj", "up_proj"],
}

supports_tower_connector_lora = True

@classmethod
def get_placeholder_str(cls, modality: str, i: int) -> str | None:
if modality.startswith("image"):
Expand Down
1 change: 1 addition & 0 deletions vllm/model_executor/models/qwen2_5_vl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1257,6 +1257,7 @@ class Qwen2_5_VLForConditionalGeneration(

supports_encoder_tp_data = True
supports_mm_device_do_normalize = True
supports_tower_connector_lora = True

def iter_mm_grid_thw(
self, mm_features: list[MultiModalFeatureSpec]
Expand Down
1 change: 1 addition & 0 deletions vllm/model_executor/models/qwen2_vl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,7 @@ class Qwen2VLForConditionalGeneration(

supports_encoder_tp_data = True
supports_mm_device_do_normalize = True
supports_tower_connector_lora = True

def iter_mm_grid_thw(
self, mm_features: list[MultiModalFeatureSpec]
Expand Down
1 change: 1 addition & 0 deletions vllm/model_executor/models/qwen3_asr.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ class Qwen3ASRForConditionalGeneration(
}

supported_languages = ISO639_1_SUPPORTED_LANGS
supports_tower_connector_lora = True

hf_to_vllm_mapper = WeightsMapper(
orig_to_new_prefix={
Expand Down
1 change: 1 addition & 0 deletions vllm/model_executor/models/qwen3_vl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1756,6 +1756,7 @@ class Qwen3VLForConditionalGeneration(
}

supports_encoder_tp_data = True
supports_tower_connector_lora = True

supported_video_pruning_methods = ("evs", "vidcom2")

Expand Down
2 changes: 2 additions & 0 deletions vllm/model_executor/models/ultravox.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,8 @@ class UltravoxModel(nn.Module, SupportsMultiModal, SupportsPP, SupportsLoRA):
}
)

supports_tower_connector_lora = True

@classmethod
def get_placeholder_str(cls, modality: str, i: int) -> str | None:
if modality.startswith("audio"):
Expand Down
Loading