{"record":{"id":"e9f2287d48899612","repo":"vllm-project/vllm","slug":"no-compilation-mode-is-set-this-method-should-onl","errorCode":null,"errorMessage":"No compilation mode is set. This method should only be called via vllm config where the level is set if none is provided.","messagePattern":"No compilation mode is set\\. This method should only be called via vllm config where the level is set if none is provided\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vllm/config/compilation.py","lineNumber":1080,"sourceCode":"\n    def init_backend(\n        self,\n        vllm_config: \"VllmConfig\",\n        prefix: str = \"\",\n        is_encoder: bool = False,\n    ) -> str | Callable:\n        \"\"\"\n        Initialize the backend for the compilation config from a vllm config.\n        Arguments:\n            vllm_config: The vllm config to initialize the backend from.\n            prefix: Cache directory prefix for this compiled module.\n            is_encoder: Whether this module is used in an encoder (as\n                opposed to a text backbone).\n        Returns:\n            The backend for the compilation config.\n        \"\"\"\n        if self.mode is None:\n            raise ValueError(\n                \"No compilation mode is set. This method should only be \"\n                \"called via vllm config where the level is set if none is \"\n                \"provided.\"\n            )\n        if self.mode == CompilationMode.NONE:\n            raise ValueError(\"No compilation mode is set.\")\n\n        from torch._dynamo.backends.registry import list_backends\n\n        torch_backends = list_backends(exclude_tags=tuple())\n        if self.mode in [\n            CompilationMode.STOCK_TORCH_COMPILE,\n            CompilationMode.DYNAMO_TRACE_ONCE,\n        ]:\n            if self.backend in torch_backends:\n                return self.backend\n            return resolve_obj_by_qualname(self.backend)\n","sourceCodeStart":1062,"sourceCodeEnd":1098,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/config/compilation.py#L1062-L1098","documentation":"Error \"No compilation mode is set. This method should only be called via vllm config where the level is set if none is provided.\" thrown in vllm-project/vllm.","triggerScenarios":"Raised at vllm/config/compilation.py:1080 when validation fails: No compilation mode is set. This method should only be called via vllm config where the level is set if none is provided.. Typically triggered by an incompatible or incomplete vLLM configuration, an unsupported platform/backend combination, or a runtime resource/dependency that is missing.","commonSituations":"Commonly encountered at vllm/config/compilation.py:1080 during vLLM startup/config validation or runtime setup when: (1) conflicting CLI flags or config fields are combined, (2) the current platform (CUDA/ROCm/CPU/XPU) or installed optional packages do not support the requested feature, or (3) a required value is absent or out of range. Resolve by correcting the configuration as described in the message, or by selecting a supported alternative.","solutions":["Set a compilation mode via -O / --compilation-config level (e.g. -O3) before calling this method.","This method must only be called through vllm config where a level is set by default."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}