Skip to content

Commit d32de8a

Browse files
Simple code refactoring
- Remove unused functions - merged functions not called anywhere else Signed-off-by: Christian Pinto <christian.pinto@ibm.com>
1 parent 29053cf commit d32de8a

File tree

1 file changed

+9
-25
lines changed

1 file changed

+9
-25
lines changed

vllm/v1/worker/gpu_model_runner.py

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -554,11 +554,16 @@ def _update_states(self, scheduler_output: "SchedulerOutput") -> None:
554554
if batch_changed or batch_reordered:
555555
self.input_batch.refresh_sampling_metadata()
556556

557-
def _add_multimodal_inputs_to_model_args(
557+
def _maybe_add_multimodal_kwargs(
558558
self,
559559
model_kwargs: dict[str, Any],
560-
scheduler_output: "SchedulerOutput",
561-
num_reqs: int = -1):
560+
scheduler_output: "SchedulerOutput" = None,
561+
num_reqs: int = -1,
562+
):
563+
564+
if not self.model_supports_multimodal_raw_input:
565+
return
566+
562567
# Multi-modal data.
563568
if scheduler_output:
564569
multi_modal_kwargs_list = []
@@ -581,28 +586,7 @@ def _add_multimodal_inputs_to_model_args(
581586

582587
model_kwargs.update(multi_modal_kwargs)
583588

584-
def _maybe_add_multimodal_kwargs(
585-
self,
586-
model_kwargs: dict[str, Any],
587-
scheduler_output: "SchedulerOutput" = None,
588-
num_reqs: int = -1):
589-
590-
if self.model_supports_multimodal_raw_input:
591-
self._add_multimodal_inputs_to_model_args(model_kwargs,
592-
scheduler_output,
593-
num_reqs)
594-
595-
def _maybe_compute_attn_prefix(
596-
self,
597-
scheduler_output: "SchedulerOutput",
598-
) -> list[int]:
599-
return [0] * len(self.kv_cache_config.kv_cache_groups)
600-
601-
def _maybe_prepare_additional_inputs(self,
602-
scheduler_output: "SchedulerOutput",
603-
token_indices: torch.Tensor):
604-
pass
605-
589+
606590
def _get_cumsum_and_arange(
607591
self,
608592
num_tokens: np.ndarray,

0 commit comments

Comments
 (0)