{"record":{"id":"01f154037def3235","repo":"vllm-project/vllm","slug":"options-only-applicable-when-profiler-is-set-to","errorCode":null,"errorMessage":"{options} only applicable when profiler is set to 'proton'","messagePattern":"(.+?) only applicable when profiler is set to 'proton'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vllm/config/profiler.py","lineNumber":207,"sourceCode":"            )\n\n        proton_profiler_dir = self.proton_profiler_dir\n        non_default_proton_options = [\n            name\n            for name, value, default in (\n                (\"proton_profiler_dir\", proton_profiler_dir, \"\"),\n                (\"proton_context\", self.proton_context, \"shadow\"),\n                (\"proton_data\", self.proton_data, \"tree\"),\n                (\"proton_backend\", self.proton_backend, None),\n                (\"proton_mode\", self.proton_mode, None),\n                (\"proton_hook\", self.proton_hook, None),\n                (\"proton_output_format\", self.proton_output_format, None),\n            )\n            if value != default\n        ]\n        if self.profiler != \"proton\" and non_default_proton_options:\n            options = \", \".join(non_default_proton_options)\n            raise ValueError(\n                f\"{options} only applicable when profiler is set to 'proton'\"\n            )\n        if self.profiler == \"proton\" and not proton_profiler_dir:\n            raise ValueError(\n                \"proton_profiler_dir must be set when profiler is 'proton'\"\n            )\n        if proton_profiler_dir:\n            if _is_uri_path(proton_profiler_dir):\n                raise ValueError(\"proton_profiler_dir must be a local directory\")\n            self.proton_profiler_dir = os.path.abspath(\n                os.path.expanduser(proton_profiler_dir)\n            )\n\n        if self.profiler == \"proton\":\n            output_format = self.proton_output_format\n            if output_format == \"chrome_trace\" and self.proton_data != \"trace\":\n                raise ValueError(\"chrome_trace output requires proton_data='trace'\")\n            if (","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/config/profiler.py#L189-L225","documentation":"ProfilerConfig raises when any proton_* option (proton_profiler_dir, proton_context, proton_data != 'tree', proton_backend, proton_mode, proton_hook, proton_output_format) is set to a non-default value while profiler is not 'proton'. The validator diffs each option against its default and lists the offending names in the message.","triggerScenarios":"Passing e.g. --profiler-config proton_profiler_dir=/tmp/p,proton_backend=cupti while profiler is None or 'torch'. Any one non-default proton option with a different profiler kind triggers it.","commonSituations":"Shared profiler-config strings reused across profiler kinds; enabling proton knobs from a profiling guide without selecting the proton profiler itself.","solutions":["Set profiler='proton' alongside the proton options.","Or strip the listed proton_* keys from the config when using torch/cuda profiling.","Note proton_data='tree' and proton_context='shadow' are defaults and alone do not trigger this."],"exampleFix":"# before\nProfilerConfig(proton_backend='cupti', proton_profiler_dir='/tmp/p')\n\n# after\nProfilerConfig(profiler='proton', proton_backend='cupti', proton_profiler_dir='/tmp/p')","handlingStrategy":"validation","validationCode":"PROTON_DEFAULTS = {\"proton_context\": \"shadow\", \"proton_data\": \"tree\",\n                  \"proton_backend\": None, \"proton_mode\": None,\n                  \"proton_hook\": None, \"proton_output_format\": None}\n\ndef non_default_proton_opts(cfg_kwargs: dict) -> list[str]:\n    return [k for k, d in PROTON_DEFAULTS.items() if cfg_kwargs.get(k, d) != d]\n\ndef validate(cfg_kwargs: dict) -> None:\n    opts = non_default_proton_opts(cfg_kwargs)\n    if opts and cfg_kwargs.get(\"profiler\") != \"proton\":\n        raise SystemExit(f\"{opts} require profiler='proton'\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Namespace profiler options per kind in your config templates so proton_* keys are never mixed into torch configs."],"tags":["profiling","proton","configuration"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}