{"record":{"id":"10aeac18e04722fd","repo":"vllm-project/vllm","slug":"mla-dspark-does-not-currently-support-decode-conte","errorCode":null,"errorMessage":"MLA DSpark does not currently support decode context parallelism; set decode_context_parallel_size=1.","messagePattern":"MLA DSpark does not currently support decode context parallelism; set decode_context_parallel_size=1\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vllm/config/speculative.py","lineNumber":1054,"sourceCode":"                        getattr(hf, \"dspark_target_layer_ids\", None) is None\n                        and getattr(hf, \"target_layer_ids\", None) is not None\n                    ):\n                        hf.dspark_target_layer_ids = hf.target_layer_ids\n                    if (\n                        getattr(hf, \"n_predict\", None) is None\n                        and getattr(hf, \"block_size\", None) is not None\n                    ):\n                        hf.n_predict = hf.block_size\n\n                if self.method in (\"dflash\", \"dspark\"):\n                    self.parallel_drafting = True\n\n                if (\n                    self.method == \"dspark\"\n                    and \"K3DSparkModel\" in self.draft_model_config.architectures\n                    and self.target_parallel_config.decode_context_parallel_size > 1\n                ):\n                    raise ValueError(\n                        \"MLA DSpark does not currently support decode context \"\n                        \"parallelism; set decode_context_parallel_size=1.\"\n                    )\n\n                if self.num_speculative_tokens is not None and hasattr(\n                    self.draft_model_config.hf_config, \"num_lookahead_tokens\"\n                ):\n                    self.draft_model_config.hf_config.num_lookahead_tokens = (\n                        self.num_speculative_tokens\n                    )\n\n                n_predict = getattr(\n                    self.draft_model_config.hf_config, \"n_predict\", None\n                )\n                if n_predict is not None:\n                    if self.num_speculative_tokens is None:\n                        # Default to max value defined in draft model config.\n                        self.num_speculative_tokens = n_predict","sourceCodeStart":1036,"sourceCodeEnd":1072,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/config/speculative.py#L1036-L1072","documentation":"Raised when the speculative method is 'dspark', the draft model architecture is K3DSparkModel (an MLA-style DSpark draft), and the target parallel config has decode_context_parallel_size > 1. The MLA DSpark drafting path does not implement decode context parallelism, so vLLM refuses the combination at config validation rather than producing incorrect results.","triggerScenarios":"Launching with --speculative-config method=dspark plus a K3DSpark draft and -decode-context-parallel-size (or decode_context_parallel_size in ParallelConfig) greater than 1.","commonSituations":"Reusing a decode-context-parallel launch template (tuned for long-context throughput) when switching the draft model to a K3DSpark/MLA variant; enabling DCP cluster-wide via env or defaults while adding speculative decoding.","solutions":["Set decode_context_parallel_size=1 for this deployment","Use a non-MLA DSpark draft architecture if you must keep decode context parallelism","Drop speculative decoding (method=dspark) if decode context parallelism is the hard requirement"],"exampleFix":"# before\nvllm serve model --speculative-config '{\"method\": \"dspark\", \"model\": \"k3-draft\"}' -decode-context-parallel-size 4\n# after\nvllm serve model --speculative-config '{\"method\": \"dspark\", \"model\": \"k3-draft\"}' -decode-context-parallel-size 1","handlingStrategy":"validation","validationCode":"if spec_cfg.get(\"method\") == \"dspark\" and dcp_size > 1:\n    # K3DSpark (MLA) drafts reject decode context parallelism\n    raise ValueError(\"set decode_context_parallel_size=1 when using an MLA DSpark draft\")","typeGuard":"def dspark_allows_dcp(draft_architectures: list[str], dcp_size: int) -> bool:\n    return dcp_size == 1 or \"K3DSparkModel\" not in draft_architectures","tryCatchPattern":null,"preventionTips":["When changing draft models, re-validate parallel-config combinations, not just the speculative block","Encode the deployment's constraints (method x DCP) as a pre-launch assertion in your serving wrapper"],"tags":["speculative-decoding","dspark","context-parallelism","config"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}