{"record":{"id":"f1e0f2349310730d","repo":"sgl-project/sglang","slug":"enable-cp-decode-attn-tp-is-only-supported-for-m","errorCode":null,"errorMessage":"--enable-cp-decode-attn-tp is only supported for models whose attention linears are replicated across CP ranks (attn_tp_size=1). Got {model_arch}; supported: {sorted(CP_DECODE_ATTN_TP_SUPPORTED_ARCHS)}.","messagePattern":"--enable-cp-decode-attn-tp is only supported for models whose attention linears are replicated across CP ranks \\(attn_tp_size=1\\)\\. Got (.+?); supported: (.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/server_args.py","lineNumber":5796,"sourceCode":"                unsupported.append(\"expert parallelism (--ep-size must be 1)\")\n            if unsupported:\n                raise ValueError(\n                    \"Intern-S2-Mobius does not support: \" + \"; \".join(unsupported) + \".\"\n                )\n\n        if cfg.enable_dsa_cache_layer_split and not is_deepseek_dsa(hf_config):\n            raise ValueError(\n                \"--enable-dsa-cache-layer-split is only supported for DSA \"\n                \"(DeepSeek Sparse Attention) models.\"\n            )\n\n        if cfg.enable_cp_decode_attn_tp:\n            from sglang.srt.layers.cp.cp_decode_attn_tp import (\n                CP_DECODE_ATTN_TP_SUPPORTED_ARCHS,\n            )\n\n            if model_arch not in CP_DECODE_ATTN_TP_SUPPORTED_ARCHS:\n                raise ValueError(\n                    \"--enable-cp-decode-attn-tp is only supported for models \"\n                    \"whose attention linears are replicated across CP ranks \"\n                    f\"(attn_tp_size=1). Got {model_arch}; supported: \"\n                    f\"{sorted(CP_DECODE_ATTN_TP_SUPPORTED_ARCHS)}.\"\n                )\n\n        _hybrid_spec = get_linear_attn_spec_by_arch(model_arch)\n        if _hybrid_spec is not None and _hybrid_spec.uses_mamba_radix_cache:\n            self._handle_mamba_radix_cache(model_arch=model_arch)\n\n        # Collect the declarative model overrides (registry) on the\n        # pristine config and stash them for publish-time flags resolution;\n        # server_args is never mutated — mid-resolution readers see the\n        # declared values through resolved_view, runtime readers through the\n        # flags tier.\n        from sglang.srt.arg_groups.overrides import (\n            collect_model_override_declarations,\n            validate_declarations,","sourceCodeStart":5778,"sourceCodeEnd":5814,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/server_args.py#L5778-L5814","documentation":"--enable-cp-decode-attn-tp requires attention linear weights to be replicated across context-parallel ranks (attn_tp_size=1); only model architectures listed in CP_DECODE_ATTN_TP_SUPPORTED_ARCHS are supported. The error names your model arch and the supported set.","triggerScenarios":"Passing --enable-cp-decode-attn-tp with a model_arch not in CP_DECODE_ATTN_TP_SUPPORTED_ARCHS (see sglang/srt/layers/cp/cp_decode_attn_tp.py).","commonSituations":"Enabling CP decode attention TP on a newly added or custom model arch whose name isn't registered; expecting the feature to be model-agnostic.","solutions":["Check CP_DECODE_ATTN_TP_SUPPORTED_ARCHS and switch to a supported model arch if you need the feature","Remove --enable-cp-decode-attn-tp for unsupported models","If adding support for a new arch, register it in CP_DECODE_ATTN_TP_SUPPORTED_ARCHS and validate attn_tp_size==1 weight layout"],"exampleFix":"# before\n--enable-cp-decode-attn-tp  # unsupported arch\n# after\n# (flag removed, or use a supported arch)","handlingStrategy":"validation","validationCode":"from sglang.srt.layers.cp.cp_decode_attn_tp import CP_DECODE_ATTN_TP_SUPPORTED_ARCHS\nif args.get(\"enable_cp_decode_attn_tp\") and hf_config.architectures[0] not in CP_DECODE_ATTN_TP_SUPPORTED_ARCHS:\n    args[\"enable_cp_decode_attn_tp\"] = False","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check the supported-arch constant before enabling arch-gated CP features","For custom models, register new arches in the supported set only after verifying attn_tp_size==1 weight replication"],"tags":["context-parallel","model-support","config-validation"],"backgroundTag":"model-specific-flag-misuse","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}