{"record":{"id":"3afa22ac6f46acee","repo":"sgl-project/sglang","slug":"linear-attn-decode-backend-flashkda-is-not-suppo","errorCode":null,"errorMessage":"--linear-attn-decode-backend flashkda is not supported: FlashKDA is prefill-only. Use --linear-attn-prefill-backend flashkda (decode stays on triton).","messagePattern":"--linear-attn-decode-backend flashkda is not supported: FlashKDA is prefill-only\\. Use --linear-attn-prefill-backend flashkda \\(decode stays on triton\\)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/server_args.py","lineNumber":6861,"sourceCode":"                \"_handle_linear_attn_backend\",\n                linear_attn_decode_backend=\"flashinfer\",\n            )\n            logger.info(\n                \"SM100+ detected with mamba-ssm-dtype=bfloat16, \"\n                \"defaulting --linear-attn-decode-backend to flashinfer.\"\n            )\n\n        # SM100+ FlashInfer GDN decode requires bf16 state; SM90 uses float32.\n        decode = cfg.linear_attn_decode_backend or cfg.linear_attn_backend\n\n        # FlashKDA is a prefill-only KDA kernel (no decode kernel) but shares the\n        # backend choice list, so guard it from being selected for decode: error\n        # on an explicit --linear-attn-decode-backend flashkda, and fall back to\n        # triton decode when it was only inherited from base=flashkda (prefill\n        # keeps FlashKDA).\n        if decode == \"flashkda\":\n            if cfg.linear_attn_decode_backend == \"flashkda\":\n                raise ValueError(\n                    \"--linear-attn-decode-backend flashkda is not supported: \"\n                    \"FlashKDA is prefill-only. Use \"\n                    \"--linear-attn-prefill-backend flashkda (decode stays on triton).\"\n                )\n            self._declare(\n                \"_handle_linear_attn_backend\",\n                linear_attn_decode_backend=\"triton\",\n            )\n            decode = \"triton\"\n            logger.info(\n                \"FlashKDA is prefill-only; using triton for KDA decode \"\n                \"(FlashKDA stays on prefill).\"\n            )\n\n        if (\n            decode == \"flashinfer\"\n            and cfg.mamba_ssm_dtype != \"bfloat16\"\n            and is_cuda()","sourceCodeStart":6843,"sourceCodeEnd":6879,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/server_args.py#L6843-L6879","documentation":"FlashKDA is a prefill-only linear-attention kernel; it has no decode implementation, so explicitly selecting it as the decode backend is rejected. The message tells you to use it only for prefill — decode then stays on triton.","triggerScenarios":"Passing --linear-attn-decode-backend flashkda explicitly. Note the guard distinguishes explicit selection (raises) from a value merely inherited from base=flashkda, which silently falls back to triton decode.","commonSituations":"Users setting all three linear-attn backend flags (base/prefill/decode) to the same value; copy-pasting a prefill backend name into the decode flag; scripts that enumerate backends across both slots.","solutions":["Set --linear-attn-prefill-backend flashkda and remove the decode flag (decode defaults to triton)","Use a decode-capable backend such as triton for --linear-attn-decode-backend"],"exampleFix":"# before\n--linear-attn-prefill-backend flashkda --linear-attn-decode-backend flashkda\n# after\n--linear-attn-prefill-backend flashkda","handlingStrategy":"validation","validationCode":"if args.linear_attn_decode_backend == \"flashkda\":\n    raise SystemExit(\"flashkda is prefill-only; set --linear-attn-prefill-backend instead\")","typeGuard":"null","tryCatchPattern":null,"preventionTips":["Never mirror prefill backend names into decode flags without checking support","Consult the backend choice list per phase (prefill vs decode) before configuring"],"tags":["sglang","linear-attention","flashkda","prefill-only","server-args"],"backgroundTag":"invalid-backend-selection","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}