{"record":{"id":"2311bd20282a9819","repo":"sgl-project/sglang","slug":"decode-attention-backend-for-kimi-k3-dcp-must-be","errorCode":null,"errorMessage":"Decode attention backend for Kimi-K3 DCP must be 'cutedsl_mla' or 'tokenspeed_mla', got {decode_backend!r}.","messagePattern":"Decode attention backend for Kimi-K3 DCP must be 'cutedsl_mla' or 'tokenspeed_mla', got (.+?)\\.","errorType":"validation","errorClass":"AssertionError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/arg_groups/overrides.py","lineNumber":673,"sourceCode":"                decode_attention_backend=\"cutedsl_mla\",\n            )\n        elif decode_backend == \"tokenspeed_mla\":\n            logger.info(\n                \"Kimi-K3 DCP overrides attention backends: \"\n                f\"prefill={prefill_backend!r}, decode={decode_backend!r} -> \"\n                \"'tokenspeed_mla'.\"\n            )\n            logger.info(\n                \"Kimi-K3 DCP with tokenspeed mla backend overrides KV cache dtype: \"\n                f\"{cfg.kv_cache_dtype!r} -> 'fp8_e4m3'.\"\n            )\n            overrides.update(\n                prefill_attention_backend=\"tokenspeed_mla\",\n                decode_attention_backend=\"tokenspeed_mla\",\n                kv_cache_dtype=\"fp8_e4m3\",\n            )\n        else:\n            raise AssertionError(\n                f\"Decode attention backend for Kimi-K3 DCP must be 'cutedsl_mla' or 'tokenspeed_mla', got {decode_backend!r}.\"\n            )\n\n        if cfg.dcp_replicate_q_proj is None:\n            logger.info(\"Kimi-K3 DCP enables replicated Q projection by default.\")\n            overrides[\"dcp_replicate_q_proj\"] = True\n\n        device_name = get_device_name()\n        dcp_comm_backend = \"fi_a2a\" if is_mnnvl_fabric_device() else \"a2a\"\n        logger.info(\n            \"Kimi-K3 DCP selects communication backend on \"\n            f\"{device_name!r}: {cfg.dcp_comm_backend!r} -> \"\n            f\"{dcp_comm_backend!r}.\"\n        )\n        overrides[\"dcp_comm_backend\"] = dcp_comm_backend\n        return overrides\n\n    if not (is_sm100_supported() and get_device_sm() in (100, 103)):","sourceCodeStart":655,"sourceCodeEnd":691,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/arg_groups/overrides.py#L655-L691","documentation":"Kimi-K3 DCP requires the decode attention backend to be either cutedsl_mla or tokenspeed_mla. The code handles each explicitly and any other value falls into an else branch raising AssertionError — effectively a programming/config invariant violation rather than a normal user path.","triggerScenarios":"cfg.decode_attention_backend set to a third value while Kimi-K3 DCP handling routes into _kimi_k3_overrides without matching either branch (e.g. a stale custom backend string injected by an override hook).","commonSituations":"Custom launch wrappers forcing --decode-attention-backend flashinfer/trtllm_mla; version skew where a hook writes an unexpected backend value before this check.","solutions":["Set --decode-attention-backend cutedsl_mla or tokenspeed_mla","Or remove the explicit flag to let Kimi-K3 defaults apply","Check other override hooks/scripts aren't rewriting decode_attention_backend"],"exampleFix":"# before\n--decode-attention-backend flashinfer\n# after\n--decode-attention-backend cutedsl_mla","handlingStrategy":"validation","validationCode":"assert decode_backend in ('cutedsl_mla', 'tokenspeed_mla'), f'bad decode backend for Kimi-K3 DCP: {decode_backend}'","typeGuard":null,"tryCatchPattern":"except AssertionError as e:\n    if 'cutedsl_mla' in str(e): server_args.decode_attention_backend = 'cutedsl_mla'; retry()\n    raise","preventionTips":["Don't hardcode attention backends across models in shared scripts","Let Kimi-K3 defaults choose the decode backend"],"tags":["kimi-k3","attention-backend","dcp","sglang"],"backgroundTag":"unsupported-backend-combination","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}