vllm-project/vllm · error · ValueError

No compilation mode is set. This method should only be calle

Error message

No compilation mode is set. This method should only be called via vllm config where the level is set if none is provided.

What it means

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.

Source

Thrown at vllm/config/compilation.py:1080

    def init_backend(
        self,
        vllm_config: "VllmConfig",
        prefix: str = "",
        is_encoder: bool = False,
    ) -> str | Callable:
        """
        Initialize the backend for the compilation config from a vllm config.
        Arguments:
            vllm_config: The vllm config to initialize the backend from.
            prefix: Cache directory prefix for this compiled module.
            is_encoder: Whether this module is used in an encoder (as
                opposed to a text backbone).
        Returns:
            The backend for the compilation config.
        """
        if self.mode is None:
            raise ValueError(
                "No compilation mode is set. This method should only be "
                "called via vllm config where the level is set if none is "
                "provided."
            )
        if self.mode == CompilationMode.NONE:
            raise ValueError("No compilation mode is set.")

        from torch._dynamo.backends.registry import list_backends

        torch_backends = list_backends(exclude_tags=tuple())
        if self.mode in [
            CompilationMode.STOCK_TORCH_COMPILE,
            CompilationMode.DYNAMO_TRACE_ONCE,
        ]:
            if self.backend in torch_backends:
                return self.backend
            return resolve_obj_by_qualname(self.backend)

View on GitHub (pinned to c794754062)

Solutions

  1. Set a compilation mode via -O / --compilation-config level (e.g. -O3) before calling this method.
  2. This method must only be called through vllm config where a level is set by default.

When it happens

Trigger: 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.

Common situations: 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.


AI-assisted analysis of vllm-project/vllm@c794754062 (2026-08-14). Data as JSON: /api/errors/e9f2287d48899612. Report an issue: GitHub.