{"record":{"id":"36a6e8220e541356","repo":"sgl-project/sglang","slug":"enable-dsa-cache-layer-split-requires-enable-p","errorCode":null,"errorMessage":"--enable-dsa-cache-layer-split requires --enable-prefill-cp and --cp-strategy interleave (or legacy --enable-nsa-prefill-context-parallel with --nsa-prefill-cp-mode round-robin-split).","messagePattern":"--enable-dsa-cache-layer-split requires --enable-prefill-cp and --cp-strategy interleave \\(or legacy --enable-nsa-prefill-context-parallel with --nsa-prefill-cp-mode round-robin-split\\)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/server_args.py","lineNumber":5942,"sourceCode":"                    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\n                    and cfg.disaggregation_transfer_backend != \"mooncake\"\n                ):\n                    raise ValueError(\n                        \"--enable-dsa-cache-layer-split currently only supports \"\n                        \"the mooncake transfer backend (mooncake / mooncake_tcp). \"\n                        f\"Got --disaggregation-transfer-backend \"\n                        f\"{cfg.disaggregation_transfer_backend!r}. mori/nixl \"\n                        \"support will be added later by the community.\"","sourceCodeStart":5924,"sourceCodeEnd":5960,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/server_args.py#L5924-L5960","documentation":"The DSA cache-layer-split implementation depends on prefill context parallelism with the interleaved CP strategy; ServerArgs requires --enable-prefill-cp and --cp-strategy interleave (legacy equivalents: --enable-nsa-prefill-context-parallel with --nsa-prefill-cp-mode round-robin-split) when the flag is set.","triggerScenarios":"Passing --enable-dsa-cache-layer-split without --enable-prefill-cp, or with --cp-strategy set to something other than 'interleave'.","commonSituations":"Enabling the layer-split flag without its CP prerequisites; changing cp-strategy for a different optimization and breaking this one.","solutions":["Add --enable-prefill-cp and --cp-strategy interleave","Or use the legacy pair --enable-nsa-prefill-context-parallel with --nsa-prefill-cp-mode round-robin-split","Remove --enable-dsa-cache-layer-split if you cannot use prefill CP"],"exampleFix":"# before\n--enable-dsa-cache-layer-split\n# after\n--enable-dsa-cache-layer-split --enable-prefill-cp --cp-strategy interleave","handlingStrategy":"validation","validationCode":"if args.get(\"enable_dsa_cache_layer_split\"):\n    ok = args.get(\"enable_prefill_cp\") and args.get(\"cp_strategy\") == \"interleave\"\n    ok = ok or (args.get(\"enable_nsa_prefill_context_parallel\") and args.get(\"nsa_prefill_cp_mode\") == \"round-robin-split\")\n    assert ok, \"dsa-cache-layer-split requires prefill CP (interleave)\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Group dependent flags into one named config bundle so prerequisites travel together","Add a preflight flag-consistency check for CP-related options"],"tags":["dsa","context-parallel","config-validation"],"backgroundTag":"missing-prerequisite-flag","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}