{"record":{"id":"4e3cbdd70687e668","repo":"sgl-project/sglang","slug":"enable-linear-replayssm-spec-with-sglang-ragged","errorCode":null,"errorMessage":"--enable-linear-replayssm-spec with SGLANG_RAGGED_VERIFY_MODE={ragged_mode.value} requires the KDA fold-every-commit family (DSPARK/DFLASH) and a ring-writing verify kernel (--linear-attn-verify-backend triton or nv_cutedsl); got algorithm={cfg.speculative_algorithm!r}, verify={verify!r}. Use SGLANG_RAGGED_VERIFY_MODE=static.","messagePattern":"--enable-linear-replayssm-spec with SGLANG_RAGGED_VERIFY_MODE=(.+?) requires the KDA fold-every-commit family \\(DSPARK/DFLASH\\) and a ring-writing verify kernel \\(--linear-attn-verify-backend triton or nv_cutedsl\\); got algorithm=(.+?), verify=(.+?)\\. Use SGLANG_RAGGED_VERIFY_MODE=static\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/server_args.py","lineNumber":7011,"sourceCode":"                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()\n                verify = cfg.linear_attn_verify_backend\n                if _algo not in (\"DSPARK\", \"DFLASH\") or verify not in (\n                    \"triton\",\n                    \"nv_cutedsl\",\n                ):\n                    raise ValueError(\n                        \"--enable-linear-replayssm-spec with \"\n                        f\"SGLANG_RAGGED_VERIFY_MODE={ragged_mode.value} requires the \"\n                        \"KDA fold-every-commit family (DSPARK/DFLASH) and a \"\n                        \"ring-writing verify kernel (--linear-attn-verify-backend \"\n                        \"triton or nv_cutedsl); got \"\n                        f\"algorithm={cfg.speculative_algorithm!r}, \"\n                        f\"verify={verify!r}. Use SGLANG_RAGGED_VERIFY_MODE=static.\"\n                    )\n            if cfg.disaggregation_mode == \"prefill\":\n                raise ValueError(\n                    \"--enable-linear-replayssm-spec is not supported on a PD \"\n                    \"prefill server: the ring is spec-verify-only scratch and \"\n                    \"the prefill server never runs spec verify.\"\n                )\n            if cfg.enable_linear_replayssm:\n                raise ValueError(\n                    \"--enable-linear-replayssm-spec and --enable-linear-replayssm are \"\n                    \"mutually exclusive: they share the ring storage but drive it \"","sourceCodeStart":6993,"sourceCodeEnd":7029,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/server_args.py#L6993-L7029","documentation":"When SGLANG_RAGGED_VERIFY_MODE is set to a non-static mode, ReplaySSM spec-verify additionally requires the KDA fold-every-commit family — speculative algorithm DSPARK or DFLASH — plus a ring-writing verify kernel (--linear-attn-verify-backend triton or nv_cutedsl). Other algorithms (e.g. EAGLE) or verify backends (e.g. flashinfer) can't write the ring that the ragged fold relies on.","triggerScenarios":"Env SGLANG_RAGGED_VERIFY_MODE != static combined with --enable-linear-replayssm-spec, while --speculative-algorithm is not DSPARK/DFLASH or --linear-attn-verify-backend is not triton/nv_cutedsl.","commonSituations":"Exporting SGLANG_RAGGED_VERIFY_MODE for other experiments in the shell/CI env and then launching a ReplaySSM spec server; using EAGLE algorithm with the ragged mode env set.","solutions":["Unset/neutralize the env: SGLANG_RAGGED_VERIFY_MODE=static (as the message suggests)","Or align the stack: --speculative-algorithm DSPARK (or DFLASH) plus --linear-attn-verify-backend triton (or nv_cutedsl)","Audit CI/container env for stray SGLANG_* variables before launch"],"exampleFix":"# before\nexport SGLANG_RAGGED_VERIFY_MODE=ragged\n--enable-linear-replayssm-spec --speculative-algorithm EAGLE\n# after\nexport SGLANG_RAGGED_VERIFY_MODE=static\n--enable-linear-replayssm-spec --speculative-algorithm EAGLE","handlingStrategy":"validation","validationCode":"import os\ndef validate(env, algo, verify, enable_spec):\n    if not enable_spec or (env.get(\"SGLANG_RAGGED_VERIFY_MODE\", \"static\") == \"static\"):\n        return True\n    return algo.upper() in (\"DSPARK\", \"DFLASH\") and verify in (\"triton\", \"nv_cutedsl\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Audit SGLANG_* env vars before launch (env | grep SGLANG)","Set SGLANG_RAGGED_VERIFY_MODE explicitly in launch scripts to avoid inherited values"],"tags":["sglang","replayssm","ragged-verify","environment-variable","kda"],"backgroundTag":"env-var-config-conflict","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}