{"record":{"id":"00e5a73221028a48","repo":"vllm-project/vllm","slug":"tensor-parallel-size-is-not-a-valid-argument-in","errorCode":null,"errorMessage":"'tensor_parallel_size' is not a valid argument in the speculative_config. Please pass 'draft_tensor_parallel_size' instead.","messagePattern":"'tensor_parallel_size' is not a valid argument in the speculative_config\\. Please pass 'draft_tensor_parallel_size' instead\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vllm/config/speculative.py","lineNumber":1347,"sourceCode":"            ray_workers_use_nsight=target_parallel_config.ray_workers_use_nsight,\n            placement_group=target_parallel_config.placement_group,\n        )\n\n        return draft_parallel_config\n\n    @field_validator(\"attention_backend\", mode=\"before\")\n    @classmethod\n    def _parse_attention_backend(cls, value: Any) -> Any:\n        if isinstance(value, str):\n            if value.lower() == \"auto\":\n                return None\n            return AttentionBackendEnum[value.upper()]\n        return value\n\n    @model_validator(mode=\"after\")\n    def _verify_args(self) -> Self:\n        if self.tensor_parallel_size is not None:\n            raise ValueError(\n                \"'tensor_parallel_size' is not a valid argument in the \"\n                \"speculative_config. Please pass 'draft_tensor_parallel_size' instead.\"\n            )\n\n        if self.num_speculative_tokens is None:\n            raise ValueError(\n                \"num_speculative_tokens must be provided with \"\n                \"speculative model unless the draft model config contains an \"\n                \"n_predict parameter.\"\n            )\n\n        if self.num_speculative_tokens <= 0:\n            raise ValueError(\n                \"Expected num_speculative_tokens to be greater \"\n                f\"than zero ({self.num_speculative_tokens}).\"\n            )\n\n        if self.rejection_sample_method == \"synthetic\":","sourceCodeStart":1329,"sourceCodeEnd":1365,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/config/speculative.py#L1329-L1365","documentation":"Raised by the SpeculativeConfig._verify_args model_validator when a 'tensor_parallel_size' key is present in the speculative_config. The field exists on the class only for internal/legacy reasons; users must express draft sharding via draft_tensor_parallel_size (the speculative_draft_* alias chain resolves to it). Passing the wrong key is rejected so silent no-ops cannot occur.","triggerScenarios":"speculative_config={'method': 'eagle', 'model': '...', 'tensor_parallel_size': 4} — typically written by analogy with the top-level engine config or copied from an old vLLM example.","commonSituations":"Migrating pre-refactor speculative configs that used tensor_parallel_size; users assuming every sub-config mirrors the top-level V0/EngineArgs naming.","solutions":["Rename the key to draft_tensor_parallel_size in the speculative_config","Move TP control to the top-level --tensor-parallel-size flag for the target and omit it from speculative_config"],"exampleFix":"# before\nspeculative_config={\"method\": \"eagle\", \"model\": \"...\", \"tensor_parallel_size\": 4}\n# after\nspeculative_config={\"method\": \"eagle\", \"model\": \"...\", \"draft_tensor_parallel_size\": 4}","handlingStrategy":"validation","validationCode":"if \"tensor_parallel_size\" in spec_cfg:\n    spec_cfg[\"draft_tensor_parallel_size\"] = spec_cfg.pop(\"tensor_parallel_size\")","typeGuard":"def uses_draft_tp_key(spec_cfg: dict) -> bool:\n    return \"tensor_parallel_size\" not in spec_cfg and \"draft_tensor_parallel_size\" in spec_cfg or \"tensor_parallel_size\" not in spec_cfg","tryCatchPattern":null,"preventionTips":["Write speculative sharding only via draft_tensor_parallel_size; reserve tensor_parallel_size for top-level EngineArgs","Add a config linter that rejects known-renamed keys in speculative_config"],"tags":["speculative-decoding","config","tensor-parallelism","renamed-field"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}