{"record":{"id":"79421b40ca28c147","repo":"sgl-project/sglang","slug":"enable-dsa-cache-layer-split-is-only-supported-f","errorCode":null,"errorMessage":"--enable-dsa-cache-layer-split is only supported for DSA (DeepSeek Sparse Attention) models.","messagePattern":"--enable-dsa-cache-layer-split is only supported for DSA \\(DeepSeek Sparse Attention\\) models\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/server_args.py","lineNumber":5785,"sourceCode":"            return\n\n        model_config = self.get_model_config()\n        hf_config = model_config.hf_config\n        model_arch = hf_config.architectures[0]\n\n        if model_arch == \"InternS2MobiusForConditionalGeneration\":\n            unsupported = []\n            if cfg.pp_size != 1:\n                unsupported.append(\"pipeline parallelism (--pp-size must be 1)\")\n            if cfg.ep_size != 1:\n                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)","sourceCodeStart":5767,"sourceCodeEnd":5803,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/server_args.py#L5767-L5803","documentation":"--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).","triggerScenarios":"Passing --enable-dsa-cache-layer-split while serving a non-DSA model (e.g. Llama, Qwen, or a non-DSA DeepSeek variant).","commonSituations":"Copying DSA-tuned flags from a DeepSeek-V3.2 deployment onto other models; enabling the flag speculatively for performance tuning.","solutions":["Remove --enable-dsa-cache-layer-split for non-DSA models","Verify with is_deepseek_dsa(hf_config) that the model actually uses DSA before enabling the flag"],"exampleFix":"# before\n--enable-dsa-cache-layer-split  # on a Llama model\n# after\n# (flag removed)","handlingStrategy":"validation","validationCode":"from sglang.srt.utils import is_deepseek_dsa\nif args.get(\"enable_dsa_cache_layer_split\") and not is_deepseek_dsa(hf_config):\n    args[\"enable_dsa_cache_layer_split\"] = False","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Scope DSA-only flags to DeepSeek Sparse Attention model profiles","Gate experimental optimization flags behind a model-capability check in your config layer"],"tags":["dsa","deepseek","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"}