{"record":{"id":"43745f775a9b5039","repo":"vllm-project/vllm","slug":"mm-shm-cache-max-object-size-mb-should-only-be-s","errorCode":null,"errorMessage":"'mm_shm_cache_max_object_size_mb' should only be set when 'mm_processor_cache_type' is 'shm'.","messagePattern":"'mm_shm_cache_max_object_size_mb' should only be set when 'mm_processor_cache_type' is 'shm'\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vllm/config/multimodal.py","lineNumber":314,"sourceCode":"                \"Attention backend 'XFORMERS' has been removed (See PR #29262 for \"\n                \"details). Please select a supported attention backend.\"\n            )\n\n        if value is None or isinstance(value, AttentionBackendEnum):\n            return value\n\n        assert isinstance(value, str), (\n            \"mm_encoder_attn_backend must be a string or an AttentionBackendEnum.\"\n        )\n        return AttentionBackendEnum[value.upper()]\n\n    @model_validator(mode=\"after\")\n    def _validate_multimodal_config(self):\n        if self.mm_processor_cache_type != \"shm\" and (\n            self.mm_shm_cache_max_object_size_mb\n            != MultiModalConfig.mm_shm_cache_max_object_size_mb\n        ):\n            raise ValueError(\n                \"'mm_shm_cache_max_object_size_mb' should only be set when \"\n                \"'mm_processor_cache_type' is 'shm'.\"\n            )\n        # Validate FP8 scale path combinations.\n        if self.mm_encoder_attn_dtype != \"fp8\" and (\n            self.mm_encoder_fp8_scale_path is not None\n            or self.mm_encoder_fp8_scale_save_path is not None\n        ):\n            raise ValueError(\n                \"'mm_encoder_fp8_scale_path' and \"\n                \"'mm_encoder_fp8_scale_save_path' require \"\n                \"'mm_encoder_attn_dtype' to be 'fp8'.\"\n            )\n        if (\n            self.mm_encoder_fp8_scale_path is not None\n            and self.mm_encoder_fp8_scale_save_path is not None\n        ):\n            raise ValueError(","sourceCodeStart":296,"sourceCodeEnd":332,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/config/multimodal.py#L296-L332","documentation":"A model-level validator on MultiModalConfig rejects any non-default value of mm_shm_cache_max_object_size_mb when mm_processor_cache_type is not 'shm'. The shared-memory object-size cap is only meaningful for the shm cache, so setting it alongside the default 'lru' cache is treated as a configuration mistake.","triggerScenarios":"Passing --mm-shm-cache-max-object-size-warehouse values (e.g. 512) without also passing --mm-processor-cache-type shm; or programmatically MultiModalConfig(mm_shm_cache_max_object_size_mb=512) while cache_type stays at its default 'lru'.","commonSituations":"Tuning multimodal processor cache size after reading shm-cache docs but forgetting the enabling flag; merging YAML/JSON configs where cache_type was dropped; CI defaults changed so a previously-tolerated combo now validates.","solutions":["Add --mm-processor-cache-type shm if you genuinely want the shared-memory cache and its object-size cap.","Otherwise remove --mm-shm-cache-max-object-size-mb entirely and let it keep its default (128)."],"exampleFix":"# before\nvllm serve Qwen/Qwen2.5-VL-7B --mm-shm-cache-max-object-size-mb 512\n\n# after\nvllm serve Qwen/Qwen2.5-VL-7B --mm-processor-cache-type shm --mm-shm-cache-max-object-size-mb 512","handlingStrategy":"validation","validationCode":"DEFAULT_OBJ_MB = MultiModalConfig.mm_shm_cache_max_object_size_mb\n\ndef check_shm_opts(cache_type: str, max_obj_mb: int) -> None:\n    if cache_type != \"shm\" and max_obj_mb != DEFAULT_OBJ_MB:\n        raise SystemExit(\"mm_shm_cache_max_object_size_mb requires mm_processor_cache_type=shm\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat --mm-shm-cache-max-object-size-mb as a sub-option of --mm-processor-cache-type shm; always set them together.","Wrap vLLM flag assembly in a config linter that enforces dependency rules before launch."],"tags":["vllm","config","multimodal","cache","validation"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}