vllm-project/vllm · error · ValueError

proton_profiler_dir must be set when profiler is 'proton'

Error message

proton_profiler_dir must be set when profiler is 'proton'

What it means

Mirror of the torch rule: selecting profiler='proton' requires proton_profiler_dir, since each worker writes a rank-qualified profile file there. The dir is then expanded to an absolute local path.

Source

Thrown at vllm/config/profiler.py:211

            name
            for name, value, default in (
                ("proton_profiler_dir", proton_profiler_dir, ""),
                ("proton_context", self.proton_context, "shadow"),
                ("proton_data", self.proton_data, "tree"),
                ("proton_backend", self.proton_backend, None),
                ("proton_mode", self.proton_mode, None),
                ("proton_hook", self.proton_hook, None),
                ("proton_output_format", self.proton_output_format, None),
            )
            if value != default
        ]
        if self.profiler != "proton" and non_default_proton_options:
            options = ", ".join(non_default_proton_options)
            raise ValueError(
                f"{options} only applicable when profiler is set to 'proton'"
            )
        if self.profiler == "proton" and not proton_profiler_dir:
            raise ValueError(
                "proton_profiler_dir must be set when profiler is 'proton'"
            )
        if proton_profiler_dir:
            if _is_uri_path(proton_profiler_dir):
                raise ValueError("proton_profiler_dir must be a local directory")
            self.proton_profiler_dir = os.path.abspath(
                os.path.expanduser(proton_profiler_dir)
            )

        if self.profiler == "proton":
            output_format = self.proton_output_format
            if output_format == "chrome_trace" and self.proton_data != "trace":
                raise ValueError("chrome_trace output requires proton_data='trace'")
            if (
                output_format in ("hatchet", "hatchet_msgpack")
                and self.proton_data != "tree"
            ):
                raise ValueError(f"{output_format} output requires proton_data='tree'")

View on GitHub (pinned to c794754062)

Solutions

  1. Add proton_profiler_dir: --profiler-config profiler=proton,proton_profiler_dir=/tmp/proton.
  2. Ensure the directory is local — remote URIs are rejected by a separate check.

Example fix

# before
ProfilerConfig(profiler='proton')

# after
ProfilerConfig(profiler='proton', proton_profiler_dir='/tmp/proton_out')
Defensive patterns

Strategy: validation

Validate before calling

def validate_profiler_cfg(profiler: str | None, proton_dir: str) -> None:
    if profiler == "proton" and not proton_dir:
        raise SystemExit("profiler='proton' requires proton_profiler_dir (local path)")

Prevention

When it happens

Trigger: Passing --profiler-config profiler=proton without proton_profiler_dir.

Common situations: Assuming proton writes to CWD; switching from torch profiler to proton and forgetting that the dir field name differs (torch_profiler_dir vs proton_profiler_dir).

Related errors


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