vllm-project/vllm · error · ValueError

encoder_cudagraph_max_frames_per_batch must be non-negative

Error message

encoder_cudagraph_max_frames_per_batch must be non-negative (None = auto-infer)

What it means

Error "encoder_cudagraph_max_frames_per_batch must be non-negative (None = auto-infer)" thrown in vllm-project/vllm.

Source

Thrown at vllm/config/compilation.py:1047

            raise ValueError(
                f"Invalid backend for piecewise compilation: {self.backend}"
            )

        # Validate encoder CUDA graph configuration
        if (
            self.cudagraph_mm_encoder
            and self.encoder_cudagraph_max_vision_items_per_batch < 0
        ):
            raise ValueError(
                "encoder_cudagraph_max_vision_items_per_batch must be "
                "non-negative (0 = auto-infer)"
            )
        if (
            self.cudagraph_mm_encoder
            and self.encoder_cudagraph_max_frames_per_batch is not None
            and self.encoder_cudagraph_max_frames_per_batch < 0
        ):
            raise ValueError(
                "encoder_cudagraph_max_frames_per_batch must be "
                "non-negative (None = auto-infer)"
            )

        if self.encoder_cudagraph_token_budgets and any(
            b <= 0 for b in self.encoder_cudagraph_token_budgets
        ):
            raise ValueError(
                f"All encoder_cudagraph_token_budgets must be positive, "
                f"got {self.encoder_cudagraph_token_budgets}"
            )

        if self.backend == "":
            self.backend = current_platform.get_compile_backend()

    def init_backend(
        self,
        vllm_config: "VllmConfig",

View on GitHub (pinned to c794754062)

Solutions

  1. Set encoder_cudagraph_max_frames_per_batch to a non-negative integer or leave it unset (None) for auto-infer.

When it happens

Trigger: Raised at vllm/config/compilation.py:1047 when validation fails: encoder_cudagraph_max_frames_per_batch must be non-negative (None = auto-infer). 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:1047 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/d23d8bf551b9f152. Report an issue: GitHub.