{"record":{"id":"1c1312322871144e","repo":"sgl-project/sglang","slug":"currently-dspark-speculative-decoding-only-support","errorCode":null,"errorMessage":"Currently DSpark speculative decoding only supports pp_size == 1.","messagePattern":"Currently DSpark speculative decoding only supports pp_size == 1\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/arg_groups/speculative_hook.py","lineNumber":394,"sourceCode":"                )\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}).\"\n            )\n\n    if cfg.pp_size != 1:\n        raise ValueError(\n            \"Currently DSpark speculative decoding only supports pp_size == 1.\"\n        )\n\n    if cfg.speculative_draft_model_path is None:\n        if _target_checkpoint_bundles_dspark_draft(server_args):\n            declare_resolution(\n                server_args,\n                \"_handle_dspark\",\n                speculative_draft_model_path=cfg.model_path,\n            )\n            declare_resolution(\n                server_args,\n                \"_handle_dspark\",\n                speculative_draft_model_revision=cfg.revision,\n            )\n            logger.info(\n                \"DSpark draft weights are bundled in the target checkpoint; \"\n                \"defaulting --speculative-draft-model-path to --model-path (%s).\",","sourceCodeStart":376,"sourceCodeEnd":412,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/arg_groups/speculative_hook.py#L376-L412","documentation":"DSpark speculative decoding only supports a single pipeline stage. The hook rejects cfg.pp_size != 1 because DSpark's draft/verify coordination is not implemented across pipeline ranks.","triggerScenarios":"Launching with speculative_algorithm=DSPARK and --pipeline-parallel-size > 1.","commonSituations":"Multi-node PP deployments of large MoE models; adding DSpark to an existing pp=2/4 launch script.","solutions":["Set --pipeline-parallel-size 1","Use TP/EP to reach the desired GPU count instead of PP","Pick a PP-compatible speculative algorithm if PP is mandatory"],"exampleFix":"# before\n--speculative-algorithm DSPARK --pp-size 2\n# after\n--speculative-algorithm DSPARK --pp-size 1 --tp-size 8","handlingStrategy":"validation","validationCode":"if args.speculative_algorithm == 'DSPARK' and args.pp_size != 1:\n    raise SystemExit('DSPARK requires pp_size == 1')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use TP/EP instead of PP for DSpark multi-GPU scaling"],"tags":["speculative-decoding","dspark","pipeline-parallel"],"backgroundTag":"unsupported-feature-combination","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}