vllm-project/vllm · error · ValueError

custom_ops can contain only one base mode: 'all' or 'none'

Error message

custom_ops can contain only one base mode: 'all' or 'none'

What it means

Error "custom_ops can contain only one base mode: 'all' or 'none'" thrown in vllm-project/vllm.

Source

Thrown at vllm/config/compilation.py:1008

            "2.9.0.dev"
        ):
            raise ValueError(
                "use_inductor_graph_partition is only "
                "supported with torch>=2.9.0.dev. Set "
                "use_inductor_graph_partition=False instead."
            )

        for op in self.custom_ops:
            if op not in {"all", "none"} and (len(op) < 2 or op[0] not in {"+", "-"}):
                raise ValueError(
                    f"Invalid syntax '{op}' for custom op, "
                    "must be 'all', 'none', '+op' or '-op' "
                    "(where 'op' is the registered op name)"
                )

        base_modes = [op for op in self.custom_ops if op in {"all", "none"}]
        if len(base_modes) > 1:
            raise ValueError(
                "custom_ops can contain only one base mode: 'all' or 'none'"
            )

        enabled_ops = {op[1:] for op in self.custom_ops if op.startswith("+")}
        disabled_ops = {op[1:] for op in self.custom_ops if op.startswith("-")}
        conflicting_ops = sorted(enabled_ops & disabled_ops)
        if conflicting_ops:
            raise ValueError(
                "custom_ops cannot both enable and disable the same operation(s): "
                f"{', '.join(conflicting_ops)}. Remove either the '+' or '-' directive"
            )

        # Currently only eager and inductor backend are supported.
        # for piecewise compilation. Custom backends are not supported for
        # piecewise compilation. Update when more backends are supported.
        if self.mode == CompilationMode.VLLM_COMPILE and self.backend not in [
            "",
            "eager",

View on GitHub (pinned to c794754062)

Solutions

  1. Use exactly one base mode in custom_ops: either 'all' or 'none', then add '+op'/'-op' entries.
  2. Example: --compilation-config '{"custom_ops":["none","+rms_norm"]}'.

When it happens

Trigger: Raised at vllm/config/compilation.py:1008 when validation fails: custom_ops can contain only one base mode: 'all' or 'none'. 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:1008 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/376906a17de7e3de. Report an issue: GitHub.