sgl-project/sglang · error · ValueError

MiniCPM does not support DP attention

Error message

MiniCPM does not support DP attention

What it means

MiniCPM models (MiniCPMForCausalLM / MiniCPMSALAForCausalLM) do not implement DP attention in SGLang; the model-specific override hook rejects enable_dp_attention at argument resolution time.

Source

Thrown at python/sglang/srt/arg_groups/overrides.py:1287

    if server_args.is_attention_backend_not_set():
        overrides["prefill_attention_backend"] = "flashinfer"
        logger.info("Use flashinfer as default prefill attention backend for Moss-VL")
    prefill_backend = (
        overrides.get("prefill_attention_backend")
        or server_args.get_attention_backends()[0]
    )
    assert prefill_backend == "flashinfer", (
        "MossVLForConditionalGeneration requires flashinfer prefill "
        "attention backend for cross-attention custom mask support."
    )
    return overrides


@_register_for("MiniCPMForCausalLM", "MiniCPMSALAForCausalLM")
def _minicpm_sala_overrides(server_args: Any, hf_config: Any) -> dict:
    cfg = resolving_view(server_args)
    if cfg.enable_dp_attention:
        raise ValueError("MiniCPM does not support DP attention")
    has_sparse_attention = getattr(hf_config, "has_minicpm_sparse_attention", False)
    has_hybrid_attention = has_sparse_attention or getattr(
        hf_config, "has_lightning_layers", False
    )
    overrides: Dict[str, Any] = {}
    if has_hybrid_attention:
        if cfg.enable_hierarchical_cache:
            raise ValueError("MiniCPM SALA does not support hierarchical cache")
        overrides["disable_radix_cache"] = True
    if envs.SGLANG_MINICPM_FORCE_DENSE.get():
        dense_backends = {
            "minicpm_flashattn": ("fa4" if is_blackwell_supported() else "fa3"),
            "minicpm_flashinfer": "flashinfer",
        }
        # Literal keys keep the written-field set statically derivable; a loop
        # variable hides it from the census in test_chain_read_ratchet.py.
        dense_attention = dense_backends.get(cfg.attention_backend)
        if dense_attention is not None:

View on GitHub (pinned to 0132848349)

Solutions

  1. Remove --enable-dp-attention from the launch command
  2. If you need data parallelism, use --dp-size with tensor parallelism instead of DP attention
  3. Pick a model that supports DP attention if it is a hard requirement

Example fix

# before
--enable-dp-attention --dp-size 4
# after
--dp-size 4
Defensive patterns

Strategy: validation

Validate before calling

if model_arch in ('MiniCPMForCausalLM', 'MiniCPMSALAForCausalLM'):
    server_args.enable_dp_attention = False

Try / catch

except ValueError as e:
    if 'DP attention' in str(e): server_args.enable_dp_attention = False; retry()
    raise

Prevention

When it happens

Trigger: Launching any MiniCPM variant with --enable-dp-attention (or a config that sets enable_dp_attention=True); _minicpm_sala_overrides raises immediately.

Common situations: Copy-pasting a DeepSeek DP-attention launch line for throughput; cluster defaults injecting --enable-dp-attention globally.

Related errors


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