sgl-project/sglang · error · ValueError

DSpark ignores --speculative-moe-a2a-backend; with dp attent

Error message

DSpark ignores --speculative-moe-a2a-backend; with dp attention it must match the target moe_a2a_backend={} (got {}).

What it means

DSpark does not consult --speculative-moe-a2a-backend; when dp attention is active, if the flag is set it must equal the target's moe_a2a_backend. A mismatched value signals a misconfiguration and is rejected rather than silently ignored.

Source

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

            )

            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(
                "DSpark with dp attention does not support context parallel "
                f"(attn_cp_size={cfg.attn_cp_size})."
            )
        if (
            not _is_npu
            and cfg.speculative_moe_a2a_backend is not None
            and cfg.speculative_moe_a2a_backend != cfg.moe_a2a_backend
        ):
            raise ValueError(
                "DSpark ignores --speculative-moe-a2a-backend; with dp attention it "
                f"must match the target moe_a2a_backend={cfg.moe_a2a_backend!r} "
                f"(got {cfg.speculative_moe_a2a_backend!r})."
            )

    if cfg.pp_size != 1:
        raise ValueError(
            "Currently DSpark speculative decoding only supports pp_size == 1."
        )

    if cfg.speculative_draft_model_path is None:
        if _target_checkpoint_bundles_dspark_draft(server_args):
            declare_resolution(
                server_args,
                "_handle_dspark",
                speculative_draft_model_path=cfg.model_path,
            )
            declare_resolution(

View on GitHub (pinned to 0132848349)

Solutions

  1. Remove --speculative-moe-a2a-backend (DSpark ignores it anyway)
  2. Or set it to exactly the same value as --moe-a2a-backend
  3. Audit the command line for duplicated/stale MoE backend flags

Example fix

# before
--moe-a2a-backend megamoe --speculative-moe-a2a-backend deep_ep
# after
--moe-a2a-backend megamoe
Defensive patterns

Strategy: validation

Validate before calling

if args.enable_dp_attention and args.dp_size > 1:
    if args.speculative_moe_a2a_backend is not None and args.speculative_moe_a2a_backend != args.moe_a2a_backend:
        raise SystemExit('speculative_moe_a2a_backend must match moe_a2a_backend or be omitted')

Prevention

When it happens

Trigger: DSpark + dp attention (dp_size>1, CUDA) with --speculative-moe-a2a-backend set to a value different from --moe-a2a-backend.

Common situations: Copy-pasted EAGLE-family launch scripts that set speculative_moe_a2a_backend; leftovers after migrating the a2a backend from deep_ep to megamoe but updating only one flag.

Related errors


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