{"record":{"id":"59d8ffa3521ab0d1","repo":"sgl-project/sglang","slug":"dspark-dense-speculative-decoding-requires-setting","errorCode":null,"errorMessage":"DSpark dense speculative decoding requires setting --speculative-draft-model-path.","messagePattern":"DSpark dense speculative decoding requires setting --speculative-draft-model-path\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/arg_groups/speculative_hook.py","lineNumber":416,"sourceCode":"    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).\",\n                cfg.model_path,\n            )\n        else:\n            raise ValueError(\n                \"DSpark dense speculative decoding requires setting \"\n                \"--speculative-draft-model-path.\"\n            )\n\n    if cfg.speculative_num_steps is None:\n        declare_resolution(\n            server_args,\n            \"_handle_dspark\",\n            speculative_num_steps=1,\n        )\n    elif int(cfg.speculative_num_steps) != 1:\n        logger.warning(\n            \"DSpark only supports speculative_num_steps == 1; overriding speculative_num_steps=%s to 1.\",\n            cfg.speculative_num_steps,\n        )\n        declare_resolution(\n            server_args,\n            \"_handle_dspark\",","sourceCodeStart":398,"sourceCodeEnd":434,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/arg_groups/speculative_hook.py#L398-L434","documentation":"For dense targets, DSpark requires an explicit draft model path. Only if the target checkpoint bundles DSpark draft weights (detected by _target_checkpoint_bundles_dspark_draft) can the path default to --model-path; otherwise the run is rejected.","triggerScenarios":"Launching DSpark with a dense target model, no --speculative-draft-model-path, and a checkpoint that does not bundle DSpark draft weights.","commonSituations":"Assuming the target model self-drafts (MTP-style); using an older or vanilla HF checkpoint that lacks the bundled draft component.","solutions":["Set --speculative-draft-model-path to a valid DSpark draft checkpoint","Or use a target checkpoint that bundles DSpark draft weights so the path defaults to model_path","Verify the checkpoint's config actually contains the DSpark draft section"],"exampleFix":"# before\n--speculative-algorithm DSPARK --model-path /models/dense-target\n# after\n--speculative-algorithm DSPARK --model-path /models/dense-target --speculative-draft-model-path /models/dspark-draft","handlingStrategy":"validation","validationCode":"import os\nif args.speculative_algorithm == 'DSPARK' and not args.speculative_draft_model_path:\n    # only bundled checkpoints may default to model_path\n    if not checkpoint_bundles_dspark_draft(args.model_path):\n        raise SystemExit('DSPARK dense target needs --speculative-draft-model-path')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check the target checkpoint config for a DSpark draft section before assuming self-drafting"],"tags":["speculative-decoding","dspark","draft-model","missing-argument"],"backgroundTag":"missing-required-argument","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}