{"record":{"id":"bae038ee05b0e1c6","repo":"sgl-project/sglang","slug":"component-attention-backends-must-use-component-ba","errorCode":null,"errorMessage":"component_attention_backends must use component=backend entries","messagePattern":"component_attention_backends must use component=backend entries","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/server_args/server_args.py","lineNumber":1120,"sourceCode":"            raise ValueError(\n                \"component_attention_backends must be a dict or a comma-separated component=backend string\"\n            )\n\n        try:\n            parsed = json.loads(value)\n            if not isinstance(parsed, dict):\n                raise ValueError\n            return parsed\n        except (json.JSONDecodeError, ValueError):\n            pass\n\n        result: dict[str, str] = {}\n        for pair in value.split(\",\"):\n            pair = pair.strip()\n            if not pair:\n                continue\n            if \"=\" not in pair:\n                raise ValueError(\n                    \"component_attention_backends must use component=backend entries\"\n                )\n            component, backend = pair.split(\"=\", 1)\n            result[component.strip()] = backend.strip()\n        return result\n\n    @classmethod\n    def _normalize_component_attention_backends(\n        cls, value: dict[str, str] | str | None\n    ) -> dict[str, str]:\n        raw = cls._parse_component_attention_backend_map(value)\n        normalized: dict[str, str] = {}\n        for component, backend in raw.items():\n            if not isinstance(component, str):\n                raise ValueError(\"Component attention backend key must be a string\")\n            component_name = component.strip().replace(\"-\", \"_\")\n            if not component_name:\n                raise ValueError(\"Component attention backend key must not be empty\")","sourceCodeStart":1102,"sourceCodeEnd":1138,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/server_args/server_args.py#L1102-L1138","documentation":"When --component-attention-backends is given as a plain (non-JSON) string, it is split on commas and each entry must contain '=' mapping a component to a backend name. An entry without '=' cannot be parsed into component=backend.","triggerScenarios":"Passing 'flash' (single backend, no component), or 'dit=flash,faist' (typo'd second pair without '=').","commonSituations":"Assuming the flag sets a global backend rather than per-component; broken copy-paste of comma lists; stray trailing tokens after a comma.","solutions":["Use component=backend per entry: 'dit=flash,vae=vanilla'","Verify every comma-separated segment contains '='","Alternatively pass JSON: '{\"dit\": \"flash\"}'"],"exampleFix":"# before\n--component-attention-backends flash\n# after\n--component-attention-backends dit=flash","handlingStrategy":"validation","validationCode":"def valid_pair_string(s: str) -> bool:\n    return all('=' in p for p in (x.strip() for x in s.split(',')) if p)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer JSON form for multi-entry values","Lint CLI strings in launch scripts"],"tags":["config","cli","validation","attention-backend"],"backgroundTag":"invalid-cli-argument-format","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}