{"record":{"id":"93d0f93b1c57bc98","repo":"sgl-project/sglang","slug":"dcp-replicate-q-proj-only-applies-to-the-a2a-fi","errorCode":null,"errorMessage":"--dcp-replicate-q-proj only applies to the a2a/fi_a2a DCP communication backend (it removes the head-dim Q all-gather); got --dcp-comm-backend={cfg.dcp_comm_backend}.","messagePattern":"--dcp-replicate-q-proj only applies to the a2a/fi_a2a DCP communication backend \\(it removes the head-dim Q all-gather\\); got --dcp-comm-backend=(.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/server_args.py","lineNumber":4280,"sourceCode":"            raise ValueError(\n                f\"--dcp-comm-backend {cfg.dcp_comm_backend} only affects the \"\n                \"decode context-parallel attention reduction and therefore \"\n                \"requires --dcp-size / --decode-context-parallel-size > 1, but \"\n                f\"got dcp_size={cfg.dcp_size}.\"\n            )\n        if cfg.dcp_comm_backend == \"fi_a2a\" and not is_cuda():\n            raise ValueError(\n                \"--dcp-comm-backend fi_a2a delegates the exchange to FlashInfer's \"\n                \"MNNVL All-to-All kernel, which requires an NVIDIA CUDA platform \"\n                \"with SM90+ and MNNVL fabric memory (e.g. GB200 NVL72). The \"\n                \"authoritative fabric probe runs at model-runner init; use 'a2a' \"\n                \"or 'ag_rs' on clusters without MNNVL.\"\n            )\n        if cfg.dcp_replicate_q_proj:\n            if cfg.dcp_size <= 1:\n                raise ValueError(\"--dcp-replicate-q-proj requires --dcp-size > 1.\")\n            if cfg.dcp_comm_backend not in (\"a2a\", \"fi_a2a\"):\n                raise ValueError(\n                    \"--dcp-replicate-q-proj only applies to the a2a/fi_a2a DCP \"\n                    \"communication backend (it removes the head-dim Q all-gather); \"\n                    f\"got --dcp-comm-backend={cfg.dcp_comm_backend}.\"\n                )\n\n    def _handle_load_balance_method(self):\n        cfg = resolving_view(self)\n        if cfg.disaggregation_mode not in (\"null\", \"prefill\", \"decode\"):\n            raise ValueError(f\"Invalid disaggregation_mode={cfg.disaggregation_mode!r}\")\n\n        if cfg.load_balance_method == \"auto\":\n            # Default behavior:\n            # - non-PD: round_robin\n            # - PD prefill: follow_bootstrap_room\n            # - PD decode: round_robin\n            self._declare(\n                \"_handle_load_balance_method\",\n                load_balance_method=(","sourceCodeStart":4262,"sourceCodeEnd":4298,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/server_args.py#L4262-L4298","documentation":"ServerArgs validation error raised when --dcp-replicate-q-proj is combined with a DCP communication backend other than a2a or fi_a2a. The optimization works by removing the head-dim Q all-gather, which is a structural detail of the all-to-all backends only; with ag_rs (AllGather + reduce-scatter) it does not apply.","triggerScenarios":"Launching with --dcp-replicate-q-proj and --dcp-comm-backend set to ag_rs (or any value outside (a2a, fi_a2a)).","commonSituations":"Toggling the comm backend while keeping other DCP tuning flags; mixing recommendations from different tuning guides; using fi_a2a on non-MNNVL hardware, falling back to ag_rs but forgetting the q-proj flag.","solutions":["Set --dcp-comm-backend a2a (portable) or fi_a2a (SM90+/MNNVL only)","Or drop --dcp-replicate-q-proj if you must keep ag_rs"],"exampleFix":"# before\npython -m sglang.launch_server --dcp-size 4 --dcp-comm-backend ag_rs --dcp-replicate-q-proj\n# after\npython -m sglang.launch_server --dcp-size 4 --dcp-comm-backend a2a --dcp-replicate-q-proj","handlingStrategy":"validation","validationCode":"A2A_BACKENDS = {\"a2a\", \"fi_a2a\"}\n\ndef q_proj_allowed(backend: str, dcp_size: int) -> bool:\n    return dcp_size > 1 and backend in A2A_BACKENDS","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only pair --dcp-replicate-q-proj with a2a or fi_a2a","When switching backends (e.g. fi_a2a -> ag_rs on non-MNNVL hardware), review all dependent DCP tuning flags"],"tags":["sglang","distributed","dcp","argument-validation","incompatible-flags"],"backgroundTag":"incompatible-cli-flag-combination","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}