@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 96ada386b7
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 15, 06:00 UTC

[Misc] Remove unused `MultiModalHasher.hash_prompt_mm_data` (#19422)

Signed-off-by: Lukas Geiger <lukas.geiger94@gmail.com>

Lukas Geiger committed Jun 11, 2025 at 07:18 UTC 96ada386b765793cf65e1434ad4a6afc50681620
1 file changed -29
vllm/multimodal/hasher.py
-29
@@ -3,7 +3,6 @@
3
4 import pickle
5 from collections.abc import Iterable, Mapping
6 -from typing import TYPE_CHECKING, Optional
6
7 import numpy as np
8 import torch
@@ -13,9 +12,6 @@ from PIL import Image
12 from vllm.logger import init_logger
13 from vllm.multimodal.image import convert_image_mode
14
16 -if TYPE_CHECKING:
17 - from vllm.inputs import TokensPrompt
18 -
15 logger = init_logger(__name__)
16
17 MultiModalHashDict = Mapping[str, list[str]]
@@ -91,28 +87,3 @@ class MultiModalHasher:
87 hasher.update(v_bytes)
88
89 return hasher.hexdigest()
94 -
95 - @classmethod
96 - def hash_prompt_mm_data(
97 - cls, prompt: "TokensPrompt") -> Optional["MultiModalHashDict"]:
98 - """Hash multimodal data in the user input prompt if they exist."""
99 -
100 - if "multi_modal_data" not in prompt:
101 - return None
102 -
103 - mm_data = prompt["multi_modal_data"]
104 - if not mm_data:
105 - # mm_data can be None or an empty dict.
106 - return None
107 -
108 - mm_items = {
109 - modality: items if isinstance(items, list) else [items]
110 - for modality, items in mm_data.items()
111 - }
112 -
113 - mm_hashes = {
114 - modality: [cls.hash_kwargs(**{modality: item}) for item in items]
115 - for modality, items in mm_items.items()
116 - }
117 -
118 - return mm_hashes