sgl-project/sglang · error · ValueError

--enable-dsa-cache-layer-split is only supported for DSA (De

Error message

--enable-dsa-cache-layer-split is only supported for DSA (DeepSeek Sparse Attention) models.

What it means

--enable-dsa-cache-layer-split is a DeepSeek Sparse Attention (DSA)-specific optimization (splitting KV/indexer cache across CP ranks). ServerArgs rejects it when the loaded model's config is not DSA (checked via is_deepseek_dsa on hf_config).

Source

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

            return

        model_config = self.get_model_config()
        hf_config = model_config.hf_config
        model_arch = hf_config.architectures[0]

        if model_arch == "InternS2MobiusForConditionalGeneration":
            unsupported = []
            if cfg.pp_size != 1:
                unsupported.append("pipeline parallelism (--pp-size must be 1)")
            if cfg.ep_size != 1:
                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)

View on GitHub (pinned to 0132848349)

Solutions

  1. Remove --enable-dsa-cache-layer-split for non-DSA models
  2. Verify with is_deepseek_dsa(hf_config) that the model actually uses DSA before enabling the flag

Example fix

# before
--enable-dsa-cache-layer-split  # on a Llama model
# after
# (flag removed)
Defensive patterns

Strategy: validation

Validate before calling

from sglang.srt.utils import is_deepseek_dsa
if args.get("enable_dsa_cache_layer_split") and not is_deepseek_dsa(hf_config):
    args["enable_dsa_cache_layer_split"] = False

Prevention

When it happens

Trigger: Passing --enable-dsa-cache-layer-split while serving a non-DSA model (e.g. Llama, Qwen, or a non-DSA DeepSeek variant).

Common situations: Copying DSA-tuned flags from a DeepSeek-V3.2 deployment onto other models; enabling the flag speculatively for performance tuning.

Related errors


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