sgl-project/sglang · error · ValueError

DSpark with dp attention supports moe_a2a_backend 'none' (bu

Error message

DSpark with dp attention supports moe_a2a_backend 'none' (built-in TP MoE) or 'megamoe', got {}.

What it means

With DSpark + dp attention on CUDA, the MoE all-to-all backend must be 'none' (built-in TP MoE) or 'megamoe'. Other a2a backends (e.g. deep_ep, mooncake) are incompatible with DSpark's DP verification path.

Source

Thrown at python/sglang/srt/arg_groups/speculative_hook.py:360

    )

    return checkpoint_bundles_dspark_draft(server_args.get_model_config().hf_config)


def _handle_dspark(server_args: ServerArgs) -> None:
    cfg = resolving_view(server_args)
    _is_npu = cfg.device.startswith("npu")
    if not cfg.device.startswith(("cuda", "npu")):
        raise ValueError(
            "DSpark speculative decoding only supports CUDA or NPU device."
        )

    # dp_size==1 with dp_attention is a degenerate flag under DSV4 CP; skip DP-only checks.
    if cfg.enable_dp_attention and cfg.dp_size > 1:
        if not cfg.enable_dp_lm_head:
            raise ValueError("DSpark with dp attention requires --enable-dp-lm-head.")
        if not _is_npu and cfg.moe_a2a_backend not in ("none", "megamoe"):
            raise ValueError(
                "DSpark with dp attention supports moe_a2a_backend 'none' "
                "(built-in TP MoE) or 'megamoe', got "
                f"{cfg.moe_a2a_backend!r}."
            )
        if not _is_npu and cfg.moe_a2a_backend != "none":
            from sglang.srt.speculative.ragged_verify import (
                RaggedVerifyMode,
                read_ragged_verify_mode,
            )

            if read_ragged_verify_mode() is not RaggedVerifyMode.STATIC:
                raise ValueError(
                    "DSpark with dp attention + "
                    f"moe_a2a_backend={cfg.moe_a2a_backend!r} requires "
                    "SGLANG_RAGGED_VERIFY_MODE=static."
                )
        if cfg.attn_cp_size > 1:
            raise ValueError(

View on GitHub (pinned to 0132848349)

Solutions

  1. Set --moe-a2a-backend none or --moe-a2a-backend megamoe
  2. Remove the --moe-a2a-backend flag if 'none' is the default for your setup
  3. Note the check is skipped on NPU; on CUDA it is strict

Example fix

# before
--speculative-algorithm DSPARK --enable-dp-attention --dp-size 4 --moe-a2a-backend deep_ep
# after
--speculative-algorithm DSPARK --enable-dp-attention --dp-size 4 --moe-a2a-backend megamoe
Defensive patterns

Strategy: validation

Validate before calling

if args.enable_dp_attention and args.dp_size > 1:
    if not args.device.startswith('npu') and args.moe_a2a_backend not in ('none', 'megamoe'):
        raise SystemExit('DSPARK dp attention needs moe_a2a_backend none or megamoe')

Prevention

When it happens

Trigger: Launching DSpark with dp_size>1, enable_dp_attention, on CUDA, with --moe-a2a-backend set to something other than none/megamoe (commonly deep_ep).

Common situations: EP-style DeepSeek deployments default to --moe-a2a-backend deep_ep; adding DSpark spec decoding to such a command line triggers this.

Related errors


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