[BugFix] skip language model in Encoder (#30242)
Signed-off-by: dengyunyang <584797741@qq.com>
This commit is contained in:
@@ -66,6 +66,7 @@ from vllm.model_executor.models.interfaces import (
|
||||
SupportsXDRoPE,
|
||||
is_mixture_of_experts,
|
||||
supports_eagle3,
|
||||
supports_mm_encoder_only,
|
||||
supports_mrope,
|
||||
supports_multimodal_pruning,
|
||||
supports_transcription,
|
||||
@@ -4067,6 +4068,11 @@ class GPUModelRunner(
|
||||
remove_lora: If False, dummy LoRAs are not destroyed after the run
|
||||
activate_lora: If False, dummy_run is performed without LoRAs.
|
||||
"""
|
||||
if supports_mm_encoder_only(self.model):
|
||||
# The current dummy run only covers LM execution, so we can skip it.
|
||||
# mm encoder dummy run may need to add in the future.
|
||||
return torch.tensor([]), torch.tensor([])
|
||||
|
||||
assert (
|
||||
cudagraph_runtime_mode is None
|
||||
or cudagraph_runtime_mode.valid_runtime_modes()
|
||||
@@ -4344,6 +4350,11 @@ class GPUModelRunner(
|
||||
# The dummy hidden states may contain special values,
|
||||
# like `inf` or `nan`.
|
||||
# To avoid breaking the sampler, we use a random tensor here instead.
|
||||
|
||||
if supports_mm_encoder_only(self.model):
|
||||
# MM Encoder only model no need to run sampler.
|
||||
return torch.tensor([])
|
||||
|
||||
hidden_states = torch.rand_like(hidden_states)
|
||||
|
||||
logits = self.model.compute_logits(hidden_states)
|
||||
@@ -4472,6 +4483,10 @@ class GPUModelRunner(
|
||||
self,
|
||||
hidden_states: torch.Tensor,
|
||||
) -> PoolerOutput:
|
||||
if supports_mm_encoder_only(self.model):
|
||||
# MM Encoder only model not need to run pooler.
|
||||
return torch.tensor([])
|
||||
|
||||
# Find the task that has the largest output for subsequent steps
|
||||
supported_pooling_tasks = self.get_supported_pooling_tasks()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user