{"record":{"id":"0600eba4c9cfb89d","repo":"sgl-project/sglang","slug":"unsupported-sol-attn-dense-backend-dense-backend","errorCode":null,"errorMessage":"Unsupported sol_attn dense_backend={dense_backend!r}; expected one of {sorted(_DENSE_BACKENDS)}","messagePattern":"Unsupported sol_attn dense_backend=(.+?); expected one of (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/layers/attention/backends/sol_attn.py","lineNumber":68,"sourceCode":"            import cuda.bindings.driver  # noqa: F401\n            import cutlass.cute  # noqa: F401\n\n            return 4\n        except ImportError:\n            pass\n    return 1\n\n\ndef _get_sol_attn_runtime_config() -> dict:\n    server_args = get_global_server_args()\n    cfg = getattr(server_args, \"attention_backend_config\", None) or {}\n    dense_backend = (\n        str(cfg.get(\"dense_backend\", \"fa\")).strip().lower().replace(\"-\", \"_\")\n    )\n    if dense_backend in {\"sage\", \"sageattention\"}:\n        dense_backend = \"sage_attn\"\n    if dense_backend not in _DENSE_BACKENDS:\n        raise ValueError(\n            f\"Unsupported sol_attn dense_backend={dense_backend!r}; \"\n            f\"expected one of {sorted(_DENSE_BACKENDS)}\"\n        )\n    sink_start = cfg.get(\"sink_start\", 0)\n    return {\n        \"tau\": float(cfg.get(\"tau\", 1.0)),\n        \"thresh_type\": str(cfg.get(\"thresh_type\", \"diag\")),\n        \"kv_splits\": cfg.get(\"kv_splits\", \"auto\"),\n        \"sink_tokens\": int(cfg.get(\"sink_tokens\", 0)),\n        \"sink_start\": None if sink_start is None else int(sink_start),\n        \"dense_steps\": int(cfg.get(\"dense_steps\", 10)),\n        \"dense_layers\": _parse_layer_ranges(cfg.get(\"dense_layers\", \"0,1\")),\n        \"dense_backend\": dense_backend,\n    }\n\n\nclass SolAttnBackend(AttentionBackend):\n    accept_output_buffer: bool = True","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/layers/attention/backends/sol_attn.py#L50-L86","documentation":"sol_attn reads its runtime config (including dense_backend, the fallback dense attention kernel) from a config dict, normalizing aliases like 'sage'/'sageattention' to 'sage_attn'. Any value not in _DENSE_BACKENDS raises ValueError listing allowed values.","triggerScenarios":"Setting sol_attn's dense_backend (via the diffusion attention config) to a typo'd or unsupported name such as 'flash', 'fa2', or 'torch'.","commonSituations":"Config typos; using backend names from a different SGLang version; copy-pasted configs from docs of another attention implementation.","solutions":["Set dense_backend to one of the names printed in the error (sorted(_DENSE_BACKENDS)), e.g. 'fa' or 'sage_attn'","Remember only 'sage' and 'sageattention' are aliases; other spellings are not","Restart after editing so the config is re-parsed"],"exampleFix":"# before\n{\"dense_backend\": \"flash\"}\n# after\n{\"dense_backend\": \"fa\"}","handlingStrategy":"validation","validationCode":"dense_backend = str(cfg.get(\"dense_backend\", \"fa\")).strip().lower().replace(\"-\", \"_\")\nif dense_backend in {\"sage\", \"sageattention\"}:\n    dense_backend = \"sage_attn\"\nassert dense_backend in _DENSE_BACKENDS, f\"bad dense_backend {dense_backend!r}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use exact backend names from the error message (aliases: 'sage'/'sageattention')","Validate config dicts against the allowed enum at load time"],"tags":["sol-attn","config","invalid-value","enum"],"backgroundTag":"invalid-config-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}