{"record":{"id":"315603c12a4a672c","repo":"sgl-project/sglang","slug":"dspark-with-dp-attention-moe-a2a-backend-requ","errorCode":null,"errorMessage":"DSpark with dp attention + moe_a2a_backend={} requires SGLANG_RAGGED_VERIFY_MODE=static.","messagePattern":"DSpark with dp attention \\+ moe_a2a_backend=(.+?) requires SGLANG_RAGGED_VERIFY_MODE=static\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/arg_groups/speculative_hook.py","lineNumber":372,"sourceCode":"\n    # dp_size==1 with dp_attention is a degenerate flag under DSV4 CP; skip DP-only checks.\n    if cfg.enable_dp_attention and cfg.dp_size > 1:\n        if not cfg.enable_dp_lm_head:\n            raise ValueError(\"DSpark with dp attention requires --enable-dp-lm-head.\")\n        if not _is_npu and cfg.moe_a2a_backend not in (\"none\", \"megamoe\"):\n            raise ValueError(\n                \"DSpark with dp attention supports moe_a2a_backend 'none' \"\n                \"(built-in TP MoE) or 'megamoe', got \"\n                f\"{cfg.moe_a2a_backend!r}.\"\n            )\n        if not _is_npu and cfg.moe_a2a_backend != \"none\":\n            from sglang.srt.speculative.ragged_verify import (\n                RaggedVerifyMode,\n                read_ragged_verify_mode,\n            )\n\n            if read_ragged_verify_mode() is not RaggedVerifyMode.STATIC:\n                raise ValueError(\n                    \"DSpark with dp attention + \"\n                    f\"moe_a2a_backend={cfg.moe_a2a_backend!r} requires \"\n                    \"SGLANG_RAGGED_VERIFY_MODE=static.\"\n                )\n        if cfg.attn_cp_size > 1:\n            raise ValueError(\n                \"DSpark with dp attention does not support context parallel \"\n                f\"(attn_cp_size={cfg.attn_cp_size}).\"\n            )\n        if (\n            not _is_npu\n            and cfg.speculative_moe_a2a_backend is not None\n            and cfg.speculative_moe_a2a_backend != cfg.moe_a2a_backend\n        ):\n            raise ValueError(\n                \"DSpark ignores --speculative-moe-a2a-backend; with dp attention it \"\n                f\"must match the target moe_a2a_backend={cfg.moe_a2a_backend!r} \"\n                f\"(got {cfg.speculative_moe_a2a_backend!r}).\"","sourceCodeStart":354,"sourceCodeEnd":390,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/arg_groups/speculative_hook.py#L354-L390","documentation":"When DSpark runs with dp attention and a non-'none' MoE a2a backend (i.e. megamoe) on CUDA, the ragged verification path must be in static mode. The hook reads SGLANG_RAGGED_VERIFY_MODE via read_ragged_verify_mode() and rejects anything other than STATIC.","triggerScenarios":"DSpark + dp attention (dp_size>1) + moe_a2a_backend=megamoe while the env var SGLANG_RAGGED_VERIFY_MODE is unset or set to a non-static value.","commonSituations":"Fresh shell/container where SGLANG_RAGGED_VERIFY_MODE was never exported; the var set to 'dynamic' by an experimental preset.","solutions":["Export SGLANG_RAGGED_VERIFY_MODE=static before launching","Keep --moe-a2a-backend none to avoid the requirement entirely","Add the env var to your container/systemd/k8s service definition so it persists"],"exampleFix":"# before\nSGLANG_RAGGED_VERIFY_MODE=dynamic python -m sglang.launch_server ...\n# after\nSGLANG_RAGGED_VERIFY_MODE=static python -m sglang.launch_server ...","handlingStrategy":"validation","validationCode":"import os\nif args.enable_dp_attention and args.dp_size > 1 and args.moe_a2a_backend not in ('none',):\n    if os.environ.get('SGLANG_RAGGED_VERIFY_MODE', '').lower() != 'static':\n        raise SystemExit('export SGLANG_RAGGED_VERIFY_MODE=static first')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Bake SGLANG_RAGGED_VERIFY_MODE=static into container images used for DSpark + megamoe"],"tags":["speculative-decoding","dspark","env-var","ragged-verify","moe"],"backgroundTag":"missing-env-var","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}