From af9f583344e18deb69275d4f9c266a64ab4c74d5 Mon Sep 17 00:00:00 2001 From: Harry Mellor <19981378+hmellor@users.noreply.github.com> Date: Wed, 10 Jun 2026 09:37:03 +0100 Subject: [PATCH] Revert "[Bugfix][CI] Gemma3 Transformers multimodal encoder profiling and build prompt-embedding fixtures" (#45029) Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> --- .../models/transformers/multimodal.py | 30 +------------------ 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/vllm/model_executor/models/transformers/multimodal.py b/vllm/model_executor/models/transformers/multimodal.py index 3bcc1be7c8..d111af076d 100644 --- a/vllm/model_executor/models/transformers/multimodal.py +++ b/vllm/model_executor/models/transformers/multimodal.py @@ -72,35 +72,7 @@ class MultiModalProcessingInfo(BaseProcessingInfo): image_sizes=([height, width],), **mm_processor_kwargs ) image_tokens = mm_tokens["num_image_tokens"][0] - return self._get_max_encoder_tokens(processor, mm_tokens) or image_tokens - - @staticmethod - def _get_mm_values(mm_tokens: object, key: str) -> object: - if isinstance(mm_tokens, Mapping): - return mm_tokens.get(key) - return getattr(mm_tokens, key, None) - - def _get_max_encoder_tokens( - self, processor: object, mm_tokens: object - ) -> int | None: - if "gemma3" not in processor.__class__.__name__.lower(): - return None - - vision_config = getattr(self.get_hf_config(), "vision_config", None) - image_size = getattr(vision_config, "image_size", None) - patch_size = getattr(vision_config, "patch_size", None) - if not image_size or not patch_size: - return None - - # Gemma3 pools each 64x64 SigLIP patch grid down to 256 image tokens. - # Profile the vision encoder against the pre-pooling patch-token count. - patches_per_image = (image_size // patch_size) ** 2 - num_image_patches = self._get_mm_values(mm_tokens, "num_image_patches") or [1] - if isinstance(num_image_patches, int): - max_image_patches = num_image_patches - else: - max_image_patches = max(num_image_patches) - return patches_per_image * int(max_image_patches) + return image_tokens def get_max_image_size(self): return 10_000, 10_000 # hardcode for arbitrary very large size