Skip to content

Commit 137ec29

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 c992ea3 commit 137ec29

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
@@ -561,11 +561,16 @@ def _update_states(self, scheduler_output: "SchedulerOutput") -> None:
561561
# Refresh batch metadata with any pending updates.
562562
self.input_batch.refresh_metadata()
563563

564-
def _add_multimodal_inputs_to_model_args(
564+
def _maybe_add_multimodal_kwargs(
565565
self,
566566
model_kwargs: dict[str, Any],
567-
scheduler_output: "SchedulerOutput",
568-
num_reqs: int = -1):
567+
scheduler_output: "SchedulerOutput" = None,
568+
num_reqs: int = -1,
569+
):
570+
571+
if not self.model_supports_multimodal_raw_input:
572+
return
573+
569574
# Multi-modal data.
570575
if scheduler_output:
571576
multi_modal_kwargs_list = []
@@ -588,28 +593,7 @@ def _add_multimodal_inputs_to_model_args(
588593

589594
model_kwargs.update(multi_modal_kwargs)
590595

591-
def _maybe_add_multimodal_kwargs(
592-
self,
593-
model_kwargs: dict[str, Any],
594-
scheduler_output: "SchedulerOutput" = None,
595-
num_reqs: int = -1):
596-
597-
if self.model_supports_multimodal_raw_input:
598-
self._add_multimodal_inputs_to_model_args(model_kwargs,
599-
scheduler_output,
600-
num_reqs)
601-
602-
def _maybe_compute_attn_prefix(
603-
self,
604-
scheduler_output: "SchedulerOutput",
605-
) -> list[int]:
606-
return [0] * len(self.kv_cache_config.kv_cache_groups)
607-
608-
def _maybe_prepare_additional_inputs(self,
609-
scheduler_output: "SchedulerOutput",
610-
token_indices: torch.Tensor):
611-
pass
612-
596+
613597
def _get_cumsum_and_arange(
614598
self,
615599
num_tokens: np.ndarray,

0 commit comments

Comments
 (0)