sgl-project/sglang · critical · RuntimeError

PD decode DCP currently requires prefill attention CP=1, got

Error message

PD decode DCP currently requires prefill attention CP=1, got {info.attn_cp_size}.

What it means

Raised in try_ensure_parallel_info when decode DCP is enabled and the prefill server reports attn_cp_size != 1. The current PD DCP implementation can only shard/sync the MLA latent on the decode side if prefill runs attention without context parallelism, so any prefill CP > 1 is rejected.

Source

Thrown at python/sglang/srt/disaggregation/common/conn.py:648

            )

        if (
            info.kv_cache_dtype is not None
            and info.kv_cache_dtype != self.kv_cache_dtype_str
        ):
            raise RuntimeError(
                f"KV cache dtype mismatch: prefill server has kv_cache_dtype={info.kv_cache_dtype}, "
                f"but decode server has kv_cache_dtype={self.kv_cache_dtype_str}. "
                f"Both servers must use the same --kv-cache-dtype value."
            )

        if self.dcp_size > 1:
            if not (self.is_mla_backend or self.is_hybrid_mla_backend):
                raise RuntimeError(
                    "PD decode DCP requires an MLA or hybrid-MLA KV pool."
                )
            if info.attn_cp_size != 1:
                raise RuntimeError(
                    "PD decode DCP currently requires prefill attention CP=1, "
                    f"got {info.attn_cp_size}."
                )

        self._resolve_rank_mapping(info)
        self.prefill_info_table[bootstrap_addr] = info
        logger.debug(f"Prefill parallel info for [{bootstrap_addr}]: {info}")
        return True

    def _resolve_rank_mapping(self, info: PrefillServerInfo) -> None:
        """Compute TP/CP/PP rank mapping and store on the PrefillServerInfo object.
        Deterministic for a given (bootstrap_addr, decode engine) pair."""
        # TP rank mapping
        if self.attn_tp_size == info.attn_tp_size:
            target_tp_rank = self.kv_args.engine_rank % self.attn_tp_size
            required_dst_info_num = 1
            required_prefill_response_num = 1
            target_tp_ranks = [target_tp_rank]

View on GitHub (pinned to 0132848349)

Solutions

  1. Relaunch the prefill server with attention CP disabled (attn_cp_size=1)
  2. Keep DCP on decode only and ensure prefill uses plain TP/DP attention
  3. Check both servers' logs for their reported CP sizes and reconcile the launch flags

Example fix

# before
# prefill: --cp-size 2 ...
# after
# prefill: --cp-size 1 ... (plain TP instead)
Defensive patterns

Strategy: validation

Validate before calling

if decode_args.dcp_size > 1:
    assert prefill_args.attn_cp_size == 1, 'PD DCP requires prefill attention CP=1'

Prevention

When it happens

Trigger: Decode server with dcp_size > 1 bootstraps against a prefill server launched with attention context parallelism (attn CP > 1, e.g. --enable-dp-attention style CP configs or cp-size > 1).

Common situations: Reusing a large-MLA prefill config that enabled attention CP for long context, then wiring it to a DCP decode pool; version upgrades where prefill CP and decode DCP combos are not jointly tested.

Related errors


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