[V1] Consolidate MM cache size to vllm.envs (#13239)

This commit is contained in:
Roger Wang
2025-02-13 20:19:03 -08:00
committed by GitHub
parent 8c32b08a86
commit dd5ede4440
3 changed files with 18 additions and 11 deletions
+2 -4
View File
@@ -8,6 +8,7 @@ from typing import (TYPE_CHECKING, Any, Dict, Generic, Mapping, Optional,
import torch.nn as nn
from vllm.envs import VLLM_MM_INPUT_CACHE_SIZE
from vllm.inputs import InputProcessingContext
from vllm.logger import init_logger
from vllm.transformers_utils.tokenizer import AnyTokenizer
@@ -28,9 +29,6 @@ if TYPE_CHECKING:
logger = init_logger(__name__)
# TODO: Tune the MM cache size
MM_CACHE_SIZE = 256
N = TypeVar("N", bound=Type[nn.Module])
_I = TypeVar("_I", bound=BaseProcessingInfo)
_I_co = TypeVar("_I_co", bound=BaseProcessingInfo, covariant=True)
@@ -121,7 +119,7 @@ class MultiModalRegistry:
self._limits_by_model = _MultiModalLimits()
self._processing_cache = ProcessingCache(MM_CACHE_SIZE)
self._processing_cache = ProcessingCache(VLLM_MM_INPUT_CACHE_SIZE)
def register_plugin(self, plugin: MultiModalPlugin) -> None:
"""