{"record":{"id":"930ad09c5079160b","repo":"sgl-project/sglang","slug":"the-enable-mixed-chunk-feature-is-currently-unsu","errorCode":null,"errorMessage":"The 'enable-mixed-chunk' feature is currently unsupported in the following scenarios: 1. When using the MLA backend on Ascend NPU devices, 2. When using the deepseekv3.2 model on Ascend NPU devices, 3. When the environment variable ASCEND_USE_FIA is set to 0 and qk_head_dim exceeds 128 on Ascend NPU devices.","messagePattern":"The 'enable-mixed-chunk' feature is currently unsupported in the following scenarios: 1\\. When using the MLA backend on Ascend NPU devices, 2\\. When using the deepseekv3\\.2 model on Ascend NPU devices, 3\\. When the environment variable ASCEND_USE_FIA is set to 0 and qk_head_dim exceeds 128 on Ascend NPU devices\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/hardware_backend/npu/attention/ascend_backend.py","lineNumber":2907,"sourceCode":"\n    def forward_mixed(\n        self,\n        q: torch.Tensor,\n        k: torch.Tensor,\n        v: torch.Tensor,\n        layer: RadixAttention,\n        forward_batch: ForwardBatch,\n        save_kv_cache: bool = True,\n        q_rope: Optional[torch.Tensor] = None,\n        k_rope: Optional[torch.Tensor] = None,\n        topk_indices: Optional[torch.Tensor] = None,\n    ):\n        if (\n            topk_indices is not None\n            or self.use_mla\n            or (not self.use_fia and layer.qk_head_dim > 128)\n        ):\n            raise NotImplementedError(\n                \"The 'enable-mixed-chunk' feature is currently unsupported in the following scenarios: \"\n                \"1. When using the MLA backend on Ascend NPU devices, \"\n                \"2. When using the deepseekv3.2 model on Ascend NPU devices, \"\n                \"3. When the environment variable ASCEND_USE_FIA is set to 0 and qk_head_dim exceeds 128 on Ascend NPU devices.\"\n            )\n        if save_kv_cache:\n            self.token_to_kv_pool.set_kv_buffer(\n                layer,\n                KVWriteLoc(\n                    forward_batch.out_cache_loc,\n                    self.forward_metadata.swa_out_cache_loc,\n                ),\n                k,\n                v,\n            )\n        k_cache = self.token_to_kv_pool.get_key_buffer(layer.layer_id)\n        v_cache = self.token_to_kv_pool.get_value_buffer(layer.layer_id)\n        num_block, block_size, _, _ = k_cache.shape","sourceCodeStart":2889,"sourceCodeEnd":2925,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/hardware_backend/npu/attention/ascend_backend.py#L2889-L2925","documentation":"forward_mixed implements mixed-chunk (combined prefill+decode) attention on the Ascend backend, but only for the plain, non-MLA, FIA-enabled path. It raises NotImplementedError when topk_indices are supplied (sparse/MTP routing), when the MLA backend is in use (covers deepseekv3.2 MLA on Ascend), or when FIA is off and qk_head_dim > 128.","triggerScenarios":"Launching with --enable-mixed-chunk on Ascend plus any of: MLA backend active (e.g. deepseek models with MLA), deepseekv3.2, topk_indices (speculative/MoE routing) passed to the mixed path, or ASCEND_USE_FIA=0 with a layer whose qk_head_dim > 128.","commonSituations":"Copying a CUDA-oriented launch config with --enable-mixed-chunk to an Ascend deployment of DeepSeek-family models; speculative decoding feeding topk indices into mixed batches.","solutions":["Remove --enable-mixed-chunk from server args on Ascend for these model configs","Set ASCEND_USE_FIA=1 if your only blocker is the qk_head_dim>128 non-FIA clause","Switch to a non-MLA model or disable speculative/MTP features that pass topk_indices","Track the SGLang Ascend roadmap for mixed-chunk MLA support"],"exampleFix":"# before\npython -m sglang.launch_server --model deepseek-ai/DeepSeek-V3.2 --enable-mixed-chunk\n# after\npython -m sglang.launch_server --model deepseek-ai/DeepSeek-V3.2","handlingStrategy":"validation","validationCode":"def mixed_chunk_ok_on_ascend(use_mla, use_fia, qk_head_dim, topk_used):\n    return not use_mla and (use_fia or qk_head_dim <= 128) and not topk_used","typeGuard":"def can_use_mixed_chunk_ascend(backend, layer) -> bool:\n    return (\n        not backend.use_mla\n        and (backend.use_fia or layer.qk_head_dim <= 128)\n    )","tryCatchPattern":"try:\n    backend.forward_mixed(...)\nexcept NotImplementedError as e:\n    if \"enable-mixed-chunk\" in str(e):\n        # fall back to separate prefill/decode scheduling\n        run_unmixed_schedule()","preventionTips":["Omit --enable-mixed-chunk for MLA/DeepSeek models on Ascend","Set ASCEND_USE_FIA=1 for high-qk-head-dim models","Gate server args on backend capability checks at startup"],"tags":["ascend","npu","mixed-chunk","mla","deepseek","not-implemented","huawei"],"backgroundTag":"feature-not-implemented","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}