sgl-project/sglang · error · ValueError

--enable-linear-replayssm-spec with SGLANG_RAGGED_VERIFY_MOD

Error message

--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.

What it means

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.

Source

Thrown at python/sglang/srt/server_args.py:7011

                RaggedVerifyMode,
                read_ragged_verify_mode,
            )

            ragged_mode = read_ragged_verify_mode()
            if ragged_mode is not RaggedVerifyMode.STATIC:
                # Ragged ring-writes need the KDA fold-every-commit family
                # (DSPARK/DFLASH) + the triton verify kernel (nv_cutedsl falls
                # back to it for ragged layouts). The GDN ring-write kernels do
                # not take the ragged layout and the flashinfer verify kernel
                # never writes the ring -> a stale ring would be folded; keep
                # refusing those combinations.
                _algo = (cfg.speculative_algorithm or "").upper()
                verify = cfg.linear_attn_verify_backend
                if _algo not in ("DSPARK", "DFLASH") or verify not in (
                    "triton",
                    "nv_cutedsl",
                ):
                    raise ValueError(
                        "--enable-linear-replayssm-spec with "
                        f"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 "
                        f"algorithm={cfg.speculative_algorithm!r}, "
                        f"verify={verify!r}. Use SGLANG_RAGGED_VERIFY_MODE=static."
                    )
            if cfg.disaggregation_mode == "prefill":
                raise ValueError(
                    "--enable-linear-replayssm-spec is not supported on a PD "
                    "prefill server: the ring is spec-verify-only scratch and "
                    "the prefill server never runs spec verify."
                )
            if cfg.enable_linear_replayssm:
                raise ValueError(
                    "--enable-linear-replayssm-spec and --enable-linear-replayssm are "
                    "mutually exclusive: they share the ring storage but drive it "

View on GitHub (pinned to 0132848349)

Solutions

  1. Unset/neutralize the env: SGLANG_RAGGED_VERIFY_MODE=static (as the message suggests)
  2. Or align the stack: --speculative-algorithm DSPARK (or DFLASH) plus --linear-attn-verify-backend triton (or nv_cutedsl)
  3. Audit CI/container env for stray SGLANG_* variables before launch

Example fix

# before
export SGLANG_RAGGED_VERIFY_MODE=ragged
--enable-linear-replayssm-spec --speculative-algorithm EAGLE
# after
export SGLANG_RAGGED_VERIFY_MODE=static
--enable-linear-replayssm-spec --speculative-algorithm EAGLE
Defensive patterns

Strategy: validation

Validate before calling

import os
def validate(env, algo, verify, enable_spec):
    if not enable_spec or (env.get("SGLANG_RAGGED_VERIFY_MODE", "static") == "static"):
        return True
    return algo.upper() in ("DSPARK", "DFLASH") and verify in ("triton", "nv_cutedsl")

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/4e3cbdd70687e668. Report an issue: GitHub.