{"record":{"id":"d7326ee57f8a95e6","repo":"sgl-project/sglang","slug":"kimi-k3-dcp-dspark-currently-requires-sglang-rag","errorCode":null,"errorMessage":"Kimi-K3 DCP + DSPARK currently requires SGLANG_RAGGED_VERIFY_MODE=static; compact/cap-accept are not validated under DCP (got {ragged_mode.value!r}).","messagePattern":"Kimi-K3 DCP \\+ DSPARK currently requires SGLANG_RAGGED_VERIFY_MODE=static; compact/cap-accept are not validated under DCP \\(got (.+?)\\)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/arg_groups/overrides.py","lineNumber":633,"sourceCode":"    cfg = resolving_view(server_args)\n    if cfg.dcp_size > 1:\n        overrides = {}\n        if cfg.enable_symm_mem:\n            logger.warning(\n                \"Kimi-K3 DCP disables --enable-symm-mem due to decode CUDA \"\n                \"graph correctness issues.\"\n            )\n            overrides[\"enable_symm_mem\"] = False\n\n        if cfg.speculative_algorithm == \"DSPARK\":\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                raise ValueError(\n                    \"Kimi-K3 DCP + DSPARK currently requires \"\n                    \"SGLANG_RAGGED_VERIFY_MODE=static; compact/cap-accept are \"\n                    f\"not validated under DCP (got {ragged_mode.value!r}).\"\n                )\n\n            # DSPARK target-verify + draft-extend must run on the decode\n            # (cutedsl_mla) backend, whose _run_decode_kernel implements the DCP\n            # signature (causal_seqs / cp_world / cp_rank). The default\n            # \"prefill\" routes verify to trtllm_mla, whose base _run_decode_kernel\n            # lacks that DCP path (TypeError: unexpected kwarg 'causal_seqs').\n            overrides[\"speculative_attention_mode\"] = \"decode\"\n\n        prefill_backend, decode_backend = attention_backends_of(cfg)\n        if decode_backend == \"cutedsl_mla\" or decode_backend is None:\n            _require_kimi_k3_cutedsl_dcp_support()\n            logger.info(\n                \"Kimi-K3 DCP keeps decode attention backend 'cutedsl_mla' \"\n                f\"(prefill={prefill_backend!r} -> 'trtllm_mla').\"","sourceCodeStart":615,"sourceCodeEnd":651,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/arg_groups/overrides.py#L615-L651","documentation":"Kimi-K3 DCP combined with DSPARK speculative decoding has only been validated with SGLANG_RAGGED_VERIFY_MODE=static. The compact and cap-accept ragged verify modes are untested/incorrect under DCP, so any other value read from the env is rejected.","triggerScenarios":"Env SGLANG_RAGGED_VERIFY_MODE set to compact or cap_accept while running Kimi-K3 with DCP and DSPARK spec decoding; read_ragged_verify_mode() returns a non-STATIC mode in _kimi_k3_overrides.","commonSituations":"Tuning ragged verify mode for throughput on non-DCP setups and leaving the env exported in shell profiles or Docker ENV; shared cluster images with the var pre-set.","solutions":["Set SGLANG_RAGGED_VERIFY_MODE=static (or unset it if static is the default)","Remove compact/cap_accept from launch scripts/Dockerfiles for Kimi-K3 DCP runs","If you need those modes, disable DCP for this model"],"exampleFix":"# before\nexport SGLANG_RAGGED_VERIFY_MODE=compact\n# after\nexport SGLANG_RAGGED_VERIFY_MODE=static","handlingStrategy":"validation","validationCode":"import os\nmode = os.environ.get('SGLANG_RAGGED_VERIFY_MODE', 'static')\nassert mode == 'static', f'unset/override SGLANG_RAGGED_VERIFY_MODE for Kimi-K3 DCP (got {mode})'","typeGuard":null,"tryCatchPattern":"except ValueError as e:\n    if 'RAGGED_VERIFY_MODE' in str(e):\n        os.environ['SGLANG_RAGGED_VERIFY_MODE'] = 'static'; retry()\n    raise","preventionTips":["Don't export SGLANG_RAGGED_VERIFY_MODE in base images","Per-run env scrubbing before DCP launches"],"tags":["kimi-k3","dspark","speculative-decoding","env-var","sglang"],"backgroundTag":"env-var-conflict","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}