{"record":{"id":"18d8249853b8d72d","repo":"sgl-project/sglang","slug":"dual-chunk-attention-is-enabled-but-attention-bac","errorCode":null,"errorMessage":"Dual chunk attention is enabled, but attention backend is set to {}. Please set it to 'dual_chunk_flash_attn'.","messagePattern":"Dual chunk attention is enabled, but attention backend is set to (.+?)\\. Please set it to 'dual_chunk_flash_attn'\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/arg_groups/overrides.py","lineNumber":2642,"sourceCode":"        if view.page_size not in supported_page_sizes:\n            logger.warning(\n                f\"{msg} only supports page_sizes of {supported_page_sizes}, changing page_size from {view.page_size} to 128.\"\n            )\n            return {\"page_size\": 128}\n    return {}\n\n\n@register_post_process\ndef _attention_backend_dual_chunk(view: Any) -> dict:\n    if (\n        getattr(view.get_model_config().hf_config, \"dual_chunk_attention_config\", None)\n        is not None\n    ):\n        if view.attention_backend is None:\n            logger.info(\"Dual chunk attention is turned on by default.\")\n            return {\"attention_backend\": \"dual_chunk_flash_attn\"}\n        elif view.attention_backend != \"dual_chunk_flash_attn\":\n            raise ValueError(\n                \"Dual chunk attention is enabled, but attention backend is set to \"\n                f\"{view.attention_backend}. Please set it to 'dual_chunk_flash_attn'.\"\n            )\n    return {}\n\n\n@register_post_process\ndef _page_size_default(view: Any) -> dict:\n    if view.page_size is not None:\n        return {}\n\n    # SHUFFLE 5D vectorized KV layout (aiter backend + pa_decode_gluon)\n    # is tuned for and prefers page_size=64 — making it the default\n    # when the layout flag is set avoids users having to pass\n    # --page-size 64 explicitly. The env var is only consumed by the\n    # ROCm AITER backend, so the auto-bump is gated on HIP; on other\n    # platforms the SHUFFLE 5D pool has no consumer kernels and the\n    # env var is silently ignored (see MHATokenToKVPool).","sourceCodeStart":2624,"sourceCodeEnd":2660,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/arg_groups/overrides.py#L2624-L2660","documentation":"When dual chunk attention is enabled (e.g. via --enable-dual-chunk-attention for models like Gemma with interleaved attention), the attention backend must be dual_chunk_flash_attn. If an explicit different backend is already set, SGLang raises this conflict instead of silently overriding it.","triggerScenarios":"Enabling dual chunk attention while --attention-backend is explicitly set to something other than dual_chunk_flash_attn (fa3, flashinfer, trtllm_mla, ...).","commonSituations":"A launch script that always sets an attention backend being reused with a dual-chunk-attention model; setting a backend globally for a fleet where one model needs dual chunk attention.","solutions":["Remove the explicit --attention-backend flag so the default dual_chunk_flash_attn is applied","Or explicitly set --attention-backend dual_chunk_flash_attn","Disable dual chunk attention if the model does not need it"],"exampleFix":"# before\n--enable-dual-chunk-attention --attention-backend fa3\n# after\n--enable-dual-chunk-attention --attention-backend dual_chunk_flash_attn","handlingStrategy":"validation","validationCode":"if args.enable_dual_chunk_attention and args.attention_backend not in (None, \"dual_chunk_flash_attn\"):\n    args.attention_backend = \"dual_chunk_flash_attn\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not globally pin --attention-backend in fleet-wide scripts","Warn when dual chunk attention is on and backend is overridden"],"tags":["sglang","dual-chunk-attention","attention-backend","config-conflict"],"backgroundTag":"unsupported-argument-combination","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}