{"record":{"id":"2f5be992ccae5b30","repo":"sgl-project/sglang","slug":"minicpm-sparse-attention-does-not-support-pd-disag","errorCode":null,"errorMessage":"MiniCPM sparse attention does not support PD disaggregation","messagePattern":"MiniCPM sparse attention does not support PD disaggregation","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/arg_groups/overrides.py","lineNumber":1323,"sourceCode":"        if dense_attention is not None:\n            overrides[\"attention_backend\"] = dense_attention\n        dense_prefill = dense_backends.get(cfg.prefill_attention_backend)\n        if dense_prefill is not None:\n            overrides[\"prefill_attention_backend\"] = dense_prefill\n        dense_decode = dense_backends.get(cfg.decode_attention_backend)\n        if dense_decode is not None:\n            overrides[\"decode_attention_backend\"] = dense_decode\n    elif has_sparse_attention:\n        uses_sparse_backend = cfg.is_attention_backend_not_set() or any(\n            backend in (\"minicpm_flashattn\", \"minicpm_flashinfer\")\n            for backend in (\n                cfg.attention_backend,\n                cfg.prefill_attention_backend,\n                cfg.decode_attention_backend,\n            )\n        )\n        if uses_sparse_backend and cfg.disaggregation_mode != \"null\":\n            raise ValueError(\n                \"MiniCPM sparse attention does not support PD disaggregation\"\n            )\n        if cfg.is_attention_backend_not_set():\n            overrides[\"attention_backend\"] = (\n                \"minicpm_flashinfer\"\n                if is_blackwell_supported()\n                else \"minicpm_flashattn\"\n            )\n    return overrides\n\n\n@_register_for(\"MiniCPMV4_6ForConditionalGeneration\")\ndef _minicpm_v4_6_overrides(server_args: Any, hf_config: Any) -> dict:\n    cfg = resolving_view(server_args)\n    if is_sm100_supported() and cfg.attention_backend is None:\n        return {\"attention_backend\": \"triton\"}\n    return {}\n","sourceCodeStart":1305,"sourceCodeEnd":1341,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/arg_groups/overrides.py#L1305-L1341","documentation":"MiniCPM sparse attention backends (minicpm_flashattn/minicpm_flashinfer selected explicitly or by default) are incompatible with prefill-decode disaggregation. If a sparse backend is in use and disaggregation_mode != 'null', the override hook raises ValueError.","triggerScenarios":"Running MiniCPM with --disaggregation-mode prefill or decode while a minicpm_* sparse attention backend is set in attention_backend/prefill/decode fields.","commonSituations":"Joining a PD-disaggregation cluster with a MiniCPM SALA model; PD scripts that always pass --disaggregation-mode.","solutions":["Set --disaggregation-mode null (or omit the flag) for MiniCPM","Or force a dense path: set SGLANG_MINICPM_FORCE_DENSE=1 and a non-sparse backend, only if validated for your checkpoint","Use a model that supports PD disaggregation for disaggregated serving"],"exampleFix":"# before\n--disaggregation-mode prefill\n# after\n# (no disaggregation; monolithic server)","handlingStrategy":"validation","validationCode":"sparse = {'minicpm_flashattn', 'minicpm_flashinfer'} & {attention_backend, prefill_backend, decode_backend}\nif model_arch.startswith('MiniCPM') and sparse:\n    server_args.disaggregation_mode = 'null'","typeGuard":null,"tryCatchPattern":"except ValueError as e:\n    if 'PD disaggregation' in str(e): server_args.disaggregation_mode = 'null'; retry()\n    raise","preventionTips":["Keep MiniCPM out of PD-disaggregated fleets or force dense mode deliberately","Validate disaggregation_mode against model backend matrix at submit time"],"tags":["minicpm","pd-disaggregation","sparse-attention","sglang"],"backgroundTag":"unsupported-feature-for-model","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}