sgl-project/sglang · error · ValueError

--enable-cp-decode-attn-tp is only supported for models whos

Error message

--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)}.

What it means

--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.

Source

Thrown at python/sglang/srt/server_args.py:5796

                unsupported.append("expert parallelism (--ep-size must be 1)")
            if unsupported:
                raise ValueError(
                    "Intern-S2-Mobius does not support: " + "; ".join(unsupported) + "."
                )

        if cfg.enable_dsa_cache_layer_split and not is_deepseek_dsa(hf_config):
            raise ValueError(
                "--enable-dsa-cache-layer-split is only supported for DSA "
                "(DeepSeek Sparse Attention) models."
            )

        if cfg.enable_cp_decode_attn_tp:
            from sglang.srt.layers.cp.cp_decode_attn_tp import (
                CP_DECODE_ATTN_TP_SUPPORTED_ARCHS,
            )

            if model_arch not in CP_DECODE_ATTN_TP_SUPPORTED_ARCHS:
                raise ValueError(
                    "--enable-cp-decode-attn-tp is only supported for models "
                    "whose attention linears are replicated across CP ranks "
                    f"(attn_tp_size=1). Got {model_arch}; supported: "
                    f"{sorted(CP_DECODE_ATTN_TP_SUPPORTED_ARCHS)}."
                )

        _hybrid_spec = get_linear_attn_spec_by_arch(model_arch)
        if _hybrid_spec is not None and _hybrid_spec.uses_mamba_radix_cache:
            self._handle_mamba_radix_cache(model_arch=model_arch)

        # Collect the declarative model overrides (registry) on the
        # pristine config and stash them for publish-time flags resolution;
        # server_args is never mutated — mid-resolution readers see the
        # declared values through resolved_view, runtime readers through the
        # flags tier.
        from sglang.srt.arg_groups.overrides import (
            collect_model_override_declarations,
            validate_declarations,

View on GitHub (pinned to 0132848349)

Solutions

  1. Check CP_DECODE_ATTN_TP_SUPPORTED_ARCHS and switch to a supported model arch if you need the feature
  2. Remove --enable-cp-decode-attn-tp for unsupported models
  3. If adding support for a new arch, register it in CP_DECODE_ATTN_TP_SUPPORTED_ARCHS and validate attn_tp_size==1 weight layout

Example fix

# before
--enable-cp-decode-attn-tp  # unsupported arch
# after
# (flag removed, or use a supported arch)
Defensive patterns

Strategy: validation

Validate before calling

from sglang.srt.layers.cp.cp_decode_attn_tp import CP_DECODE_ATTN_TP_SUPPORTED_ARCHS
if args.get("enable_cp_decode_attn_tp") and hf_config.architectures[0] not in CP_DECODE_ATTN_TP_SUPPORTED_ARCHS:
    args["enable_cp_decode_attn_tp"] = False

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/f1e0f2349310730d. Report an issue: GitHub.