{"record":{"id":"4c11d3c5ea741097","repo":"vllm-project/vllm","slug":"when-pcp-is-enabled-dcp-must-be-disabled-span-th","errorCode":null,"errorMessage":"When PCP is enabled, DCP must be disabled, span the PCP axis, or span the full TP x PCP axis. Got TP={tp}, PCP={pcp}, DCP={dcp}; valid DCP sizes are {sorted({1, pcp, tp * pcp})}.","messagePattern":"When PCP is enabled, DCP must be disabled, span the PCP axis, or span the full TP x PCP axis\\. Got TP=(.+?), PCP=(.+?), DCP=(.+?); valid DCP sizes are (.+?)\\)\\}\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vllm/config/parallel.py","lineNumber":534,"sourceCode":"            if self.eplb_config.num_redundant_experts != 0:\n                raise ValueError(\n                    \"num_redundant_experts is set to \"\n                    f\"{self.eplb_config.num_redundant_experts} but EPLB is not \"\n                    \"enabled. Either enable EPLB or unset \"\n                    \"num_redundant_experts.\"\n                )\n\n        tp = self.tensor_parallel_size\n        pcp = self.prefill_context_parallel_size\n        dcp = self.decode_context_parallel_size\n        if pcp > 1 and self.data_parallel_size > 1:\n            raise ValueError(\"PCP does not support data parallelism yet.\")\n        if pcp == 1:\n            # DCP reuses the TP ranks when PCP is disabled.\n            if tp % dcp != 0:\n                raise ValueError(f\"tp_size={tp} must be divisible by dcp_size={dcp}.\")\n        elif dcp not in (1, pcp, tp * pcp):\n            raise ValueError(\n                \"When PCP is enabled, DCP must be disabled, span the PCP \"\n                \"axis, or span the full TP x PCP axis. \"\n                f\"Got TP={tp}, PCP={pcp}, DCP={dcp}; valid DCP sizes are \"\n                f\"{sorted({1, pcp, tp * pcp})}.\"\n            )\n\n        if self.dcp_comm_backend == \"a2a\" and self.decode_context_parallel_size <= 1:\n            raise ValueError(\n                \"dcp_comm_backend='a2a' requires decode_context_parallel_size > 1.\"\n            )\n\n        return self\n\n    @property\n    def world_size_across_dp(self) -> int:\n        \"\"\"Process world size across TP, PCP, PP, and DP.\"\"\"\n        return self.world_size * self.data_parallel_size\n","sourceCodeStart":516,"sourceCodeEnd":552,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/config/parallel.py#L516-L552","documentation":"When PCP is enabled, DCP must be disabled (1), span exactly the PCP axis (dcp == pcp), or span the full TP x PCP axis (dcp == tp * pcp); these are the only factorizations the rank layout supports. Any other DCP value is rejected with the valid set listed in the message.","triggerScenarios":"PCP > 1 with a decode_context_parallel_size not in {1, pcp, tp*pcp}, e.g. TP=2, PCP=2, DCP=2 is fine (== pcp) but DCP=3 or DCP=4 (== tp*pcp only when tp*pcp=4, so 4 is valid) — a value like DCP=8 with TP=2/PCP=2 fails.","commonSituations":"Mixing context-parallel knobs copied from different recipes; assuming DCP can be an arbitrary divisor of world size like TP.","solutions":["Choose DCP from the valid set printed in the error: 1, PCP, or TP*PCP.","If a finer-grained DCP is required, reshape PCP/TP so that tp*pcp hits the desired value.","Disable DCP (set it to 1) if decode context parallelism is optional for the deployment."],"exampleFix":"# before\n--tensor-parallel-size 2 --prefill-context-parallel-size 2 --decode-context-parallel-size 3\n# after\n--tensor-parallel-size 2 --prefill-context-parallel-size 2 --decode-context-parallel-size 4  # == tp*pcp","handlingStrategy":"validation","validationCode":"def pcp_dcp_valid(tp: int, pcp: int, dcp: int) -> bool:\n    return pcp == 1 or dcp in (1, pcp, tp * pcp)\n\nassert pcp_dcp_valid(2, 2, 4)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When PCP > 1, restrict DCP choices to the literal set {1, pcp, tp*pcp}.","Centralize parallel-size math in one script that asserts all divisibility/span rules before invoking vllm."],"tags":["context-parallelism","parallelism","configuration"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}