{"record":{"id":"de087d93f9d53cda","repo":"sgl-project/sglang","slug":"deepseekv4-only-supports-interleave-cp-strategy-g","errorCode":null,"errorMessage":"DeepSeekV4 only supports interleave CP strategy, got {cfg.cp_strategy}","messagePattern":"DeepSeekV4 only supports interleave CP strategy, got (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/arg_groups/deepseek_v4_hook.py","lineNumber":167,"sourceCode":"    if cfg.speculative_algorithm is not None:\n        assert cfg.speculative_algorithm in (\n            \"EAGLE\",\n            \"DSPARK\",\n        ), f\"Only EAGLE and DSPARK speculative algorithms are supported for {model_arch}\"\n        if cfg.speculative_algorithm == \"EAGLE\":\n            assert (\n                cfg.speculative_eagle_topk == 1\n            ), f\"Only EAGLE speculative algorithm with topk == 1 is supported for {model_arch}\"\n\n\ndef validate_deepseek_v4_cp(server_args: ServerArgs) -> None:\n    \"\"\"Validate DeepSeek V4 context-parallel configuration.\"\"\"\n    cfg = resolving_view(server_args)\n    if not cfg.enable_prefill_cp:\n        return\n\n    if cfg.cp_strategy != \"interleave\":\n        raise ValueError(\n            \"DeepSeekV4 only supports interleave CP strategy, \" f\"got {cfg.cp_strategy}\"\n        )\n\n    declare_resolution(\n        server_args,\n        \"validate_deepseek_v4_cp\",\n        enable_dsa_prefill_context_parallel=True,\n    )\n    declare_resolution(\n        server_args,\n        \"validate_deepseek_v4_cp\",\n        enable_prefill_context_parallel=False,\n    )\n    declare_resolution(\n        server_args,\n        \"validate_deepseek_v4_cp\",\n        dsa_prefill_cp_mode=\"round-robin-split\",\n    )","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/arg_groups/deepseek_v4_hook.py#L149-L185","documentation":"DeepSeek V4 context parallelism in SGLang is only implemented for the interleave CP strategy. When --enable-prefill-cp is set, validate_deepseek_v4_cp checks cp_strategy and rejects any value other than \"interleave\" because other strategies (e.g. all-ring or split strategies) are not implemented/tested for this model.","triggerScenarios":"Running a DeepSeek V4 model with enable_prefill_cp=True while cp_strategy is set to anything other than \"interleave\" (e.g. via server args or a config override), during _handle_model_specific_adjustments argument resolution.","commonSituations":"Copying a CP launch line from a non-DeepSeek-V4 model that used a different cp_strategy, or explicitly setting --cp-strategy expecting generic CP support; defaults being changed by another hook before this validator runs.","solutions":["Set --cp-strategy interleave (or remove the explicit cp_strategy override so the DeepSeek V4 default applies)","Disable --enable-prefill-cp if you don't need context parallelism for this model","Check any wrapper scripts/config files that override cp_strategy before launch"],"exampleFix":"# before\npython -m sglang.launch_server --model deepseek-ai/DeepSeek-V4 --enable-prefill-cp --cp-strategy all_ring\n# after\npython -m sglang.launch_server --model deepseek-ai/DeepSeek-V4 --enable-prefill-cp --cp-strategy interleave","handlingStrategy":"validation","validationCode":"from sglang.srt.arg_groups import resolving_view\ncfg = resolving_view(server_args)\nif getattr(cfg, 'enable_prefill_cp', False):\n    assert cfg.cp_strategy == 'interleave', f\"bad cp_strategy: {cfg.cp_strategy}\"","typeGuard":null,"tryCatchPattern":"try:\n    _handle_model_specific_adjustments(server_args, hf_config)\nexcept ValueError as e:\n    if 'interleave CP strategy' in str(e):\n        server_args.cp_strategy = 'interleave'; retry_launch()\n    else: raise","preventionTips":["Pin --cp-strategy interleave in every DeepSeek V4 CP launch script","Assert cp_strategy before launching in CI smoke tests"],"tags":["deepseek","context-parallel","sglang","config-validation"],"backgroundTag":"unsupported-parallelism-strategy","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}