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 5, 21:00 UTC
[Bugfix] Disallow renderer_num_workers > 1 with mm processor cache (#38418)
Signed-off-by: Bvicii <yizhanhuang2002@gmail.com>
Bvicii committed
Mar 28, 2026 at 06:32 UTC
bda3eda82d6c9883a86ea40ece43731714ed5695
2 files changed
+35
tests/test_config.py
+22
@@ -1131,6 +1131,28 @@ def test_needs_dp_coordination(
1131
assert vllm_config.needs_dp_coordinator == expected_needs_coordinator
1132
1133
1134
+def test_renderer_num_workers_with_mm_cache():
1135
+ """Disallow renderer_num_workers > 1 when mm processor cache is enabled,
1136
+ since neither cache type is thread-safe."""
1137
+ mm_model = "Qwen/Qwen2-VL-2B-Instruct"
1138
+
1139
+ # Should raise: multi-worker + cache enabled (default cache_gb=4)
1140
+ with pytest.raises(ValueError, match="renderer-num-workers"):
1141
+ ModelConfig(mm_model, renderer_num_workers=4)
1142
+
1143
+ # Should raise: multi-worker + explicit cache size
1144
+ with pytest.raises(ValueError, match="renderer-num-workers"):
1145
+ ModelConfig(mm_model, renderer_num_workers=2, mm_processor_cache_gb=1.0)
1146
+
1147
+ # Should pass: multi-worker + cache disabled
1148
+ config = ModelConfig(mm_model, renderer_num_workers=4, mm_processor_cache_gb=0)
1149
+ assert config.renderer_num_workers == 4
1150
+
1151
+ # Should pass: single worker + cache enabled (default)
1152
+ config = ModelConfig(mm_model, renderer_num_workers=1)
1153
+ assert config.renderer_num_workers == 1
1154
+
1155
+
1156
def test_eagle_draft_model_config():
1157
"""Test that EagleDraft model config is correctly set."""
1158
target_model_config = ModelConfig(
vllm/config/model.py
+13
@@ -647,6 +647,19 @@ class ModelConfig:
647
648
self.multimodal_config = MultiModalConfig(**mm_config_kwargs) # type: ignore[arg-type]
649
650
+ if (
651
+ self.renderer_num_workers > 1
652
+ and self.multimodal_config.mm_processor_cache_gb > 0
653
+ ):
654
+ raise ValueError(
655
+ "Cannot use --renderer-num-workers > 1 with the "
656
+ "multimodal processor cache enabled. The cache is "
657
+ "not thread-safe and does not support concurrent "
658
+ "renderer workers. Please set "
659
+ "--renderer-num-workers 1 (the default), or "
660
+ "disable the cache with --mm-processor-cache-gb 0."
661
+ )
662
+
663
# Multimodal GGUF models must use original repo for mm processing
664
if is_gguf(self.tokenizer) and self.is_multimodal_model:
665
raise ValueError(