{"record":{"id":"e91d6ecba174376d","repo":"sgl-project/sglang","slug":"enable-linear-replayssm-spec-requires-the-triton","errorCode":null,"errorMessage":"--enable-linear-replayssm-spec requires the triton or flashinfer linear-attn decode backend, got --linear-attn-decode-backend={decode!r}.","messagePattern":"--enable-linear-replayssm-spec requires the triton or flashinfer linear-attn decode backend, got --linear-attn-decode-backend=(.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/server_args.py","lineNumber":6987,"sourceCode":"        # the per-slot (rawv, rawk, g, beta) window and the commit replays the\n        # accepted prefix into the fp32 checkpoint. The intra-window interaction\n        # uses a strictly-lower causal mask, so it is valid ONLY for a linear\n        # draft chain (speculative_eagle_topk in {None, 1}, i.e. NEXTN / MTP);\n        # EAGLE tree verify (topk > 1) must fall back to the recurrent verify.\n        # GDN sizes the window to the draft maximum; KDA (kda_backend) keeps a\n        # --linear-replayssm-cache-len window and folds via its own fused\n        # verify ring-write + commit_kda_replayssm_after_verify.\n        if cfg.enable_linear_replayssm_spec:\n            if cfg.speculative_eagle_topk not in (None, 1):\n                raise ValueError(\n                    \"--enable-linear-replayssm-spec requires a linear draft chain \"\n                    \"(--speculative-eagle-topk in {None, 1}); the chunked verify \"\n                    \"kernel uses a strictly-lower causal mask and is invalid for \"\n                    \"EAGLE tree verify. Got \"\n                    f\"--speculative-eagle-topk={cfg.speculative_eagle_topk!r}.\"\n                )\n            if decode not in (\"triton\", \"flashinfer\"):\n                raise ValueError(\n                    \"--enable-linear-replayssm-spec requires the triton or \"\n                    \"flashinfer linear-attn decode backend, got \"\n                    f\"--linear-attn-decode-backend={decode!r}.\"\n                )\n            from sglang.srt.speculative.ragged_verify import (\n                RaggedVerifyMode,\n                read_ragged_verify_mode,\n            )\n\n            ragged_mode = read_ragged_verify_mode()\n            if ragged_mode is not RaggedVerifyMode.STATIC:\n                # Ragged ring-writes need the KDA fold-every-commit family\n                # (DSPARK/DFLASH) + the triton verify kernel (nv_cutedsl falls\n                # back to it for ragged layouts). The GDN ring-write kernels do\n                # not take the ragged layout and the flashinfer verify kernel\n                # never writes the ring -> a stale ring would be folded; keep\n                # refusing those combinations.\n                _algo = (cfg.speculative_algorithm or \"\").upper()","sourceCodeStart":6969,"sourceCodeEnd":7005,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/server_args.py#L6969-L7005","documentation":"ReplaySSM spec-verify requires the triton or flashinfer linear-attention decode backend. Note this differs from base ReplaySSM (errors 6042), which allows only triton/helion — the spec-verify chunked kernel is implemented for triton and flashinfer decode paths.","triggerScenarios":"--enable-linear-replayssm-spec with --linear-attn-decode-backend helion (or any value outside {triton, flashinfer}).","commonSituations":"Running KDA with helion decode (valid for base ReplaySSM) and additionally enabling the spec-verify flag; mixing the two flag sets' backend requirements.","solutions":["Set --linear-attn-decode-backend triton (or flashinfer where supported)","Or drop --enable-linear-replayssm-spec while keeping helion decode for base ReplaySSM"],"exampleFix":"# before\n--enable-linear-replayssm-spec --linear-attn-decode-backend helion\n# after\n--enable-linear-replayssm-spec --linear-attn-decode-backend triton","handlingStrategy":"validation","validationCode":"SPEC_DECODE_OK = {\"triton\", \"flashinfer\"}\ndef validate(decode_backend, enable_spec):\n    return not enable_spec or decode_backend in SPEC_DECODE_OK","typeGuard":"def spec_compatible_decode(b: str) -> bool: return b in {\"triton\", \"flashinfer\"}","tryCatchPattern":null,"preventionTips":["Note base ReplaySSM and spec-verify have different backend allowlists","Centralize backend selection logic instead of per-script flags"],"tags":["sglang","replayssm","speculative-decoding","backend-validation"],"backgroundTag":"incompatible-backend-selection","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}