{"record":{"id":"0832812041adac06","repo":"sgl-project/sglang","slug":"enable-dsa-cache-layer-split-is-only-supported-o","errorCode":null,"errorMessage":"--enable-dsa-cache-layer-split is only supported on PD prefill workers. Non-PD workers also run decode and require ordinary local decode cache semantics.","messagePattern":"--enable-dsa-cache-layer-split is only supported on PD prefill workers\\. Non-PD workers also run decode and require ordinary local decode cache semantics\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/server_args.py","lineNumber":5934,"sourceCode":"                    )\n                    self._set_default_dsa_backends(major)\n\n                if cfg.enable_prefill_cp:\n                    assert (\n                        cfg.disaggregation_mode != \"decode\"\n                    ), \"CP is only supported for prefill when PD disaggregation, please remove --enable-prefill-cp.\"\n                if (\n                    cfg.enable_dsa_cache_layer_split\n                    and cfg.disaggregation_mode != \"prefill\"\n                ):\n                    if cfg.disaggregation_mode == \"decode\":\n                        raise ValueError(\n                            \"--enable-dsa-cache-layer-split is not supported on \"\n                            \"decode workers. This flag is a prefill-CP \"\n                            \"optimization; decode receives full cache shards \"\n                            \"through PD transfer.\"\n                        )\n                    raise ValueError(\n                        \"--enable-dsa-cache-layer-split is only supported on PD \"\n                        \"prefill workers. Non-PD workers also run decode and \"\n                        \"require ordinary local decode cache semantics.\"\n                    )\n                if cfg.enable_dsa_cache_layer_split and (\n                    not cfg.enable_prefill_cp or cfg.cp_strategy != \"interleave\"\n                ):\n                    raise ValueError(\n                        \"--enable-dsa-cache-layer-split requires \"\n                        \"--enable-prefill-cp and --cp-strategy interleave \"\n                        \"(or legacy --enable-nsa-prefill-context-parallel with \"\n                        \"--nsa-prefill-cp-mode round-robin-split).\"\n                    )\n                # Layer split relies on the mooncake all-CP-rank KV/indexer\n                # transfer path. mori/nixl support is a temporary limitation\n                # and will be added later by the community.\n                if (\n                    cfg.enable_dsa_cache_layer_split","sourceCodeStart":5916,"sourceCodeEnd":5952,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/server_args.py#L5916-L5952","documentation":"--enable-dsa-cache-layer-split changes local cache semantics in a way that only PD prefill workers can tolerate: a non-PD worker also runs decode locally and needs ordinary local decode cache, so the flag is rejected when disaggregation_mode is neither 'prefill' nor 'decode' (i.e. not PD at all).","triggerScenarios":"Passing --enable-dsa-cache-layer-split on a standalone (non-disaggregated) server, where disaggregation_mode is None/other.","commonSituations":"Trying the optimization on a single combined server before deploying PD; leftover flags from a PD prefill config on a dev box.","solutions":["Remove --enable-dsa-cache-layer-split unless running a PD prefill worker","Set up prefill/decode disaggregation (--disaggregation-mode prefill) if you want this optimization"],"exampleFix":"# before\n--enable-dsa-cache-layer-split  # standalone server\n# after\n# (flag removed; or run a PD prefill worker)","handlingStrategy":"validation","validationCode":"mode = args.get(\"disaggregation_mode\")\nif args.get(\"enable_dsa_cache_layer_split\") and mode not in (\"prefill\", \"decode\"):\n    args[\"enable_dsa_cache_layer_split\"] = False","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only carry DSA cache-layer-split flags into real PD prefill deployments","Strip experimental flags from dev/standalone configs via an allowlist"],"tags":["dsa","pd-disaggregation","config-validation"],"backgroundTag":"role-specific-flag-misuse","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}