sgl-project/sglang · error · NotImplementedError
The 'enable-mixed-chunk' feature is currently unsupported in
Error message
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.
What it means
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.
Source
Thrown at python/sglang/srt/hardware_backend/npu/attention/ascend_backend.py:2907
def forward_mixed(
self,
q: torch.Tensor,
k: torch.Tensor,
v: torch.Tensor,
layer: RadixAttention,
forward_batch: ForwardBatch,
save_kv_cache: bool = True,
q_rope: Optional[torch.Tensor] = None,
k_rope: Optional[torch.Tensor] = None,
topk_indices: Optional[torch.Tensor] = None,
):
if (
topk_indices is not None
or self.use_mla
or (not self.use_fia and layer.qk_head_dim > 128)
):
raise NotImplementedError(
"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."
)
if save_kv_cache:
self.token_to_kv_pool.set_kv_buffer(
layer,
KVWriteLoc(
forward_batch.out_cache_loc,
self.forward_metadata.swa_out_cache_loc,
),
k,
v,
)
k_cache = self.token_to_kv_pool.get_key_buffer(layer.layer_id)
v_cache = self.token_to_kv_pool.get_value_buffer(layer.layer_id)
num_block, block_size, _, _ = k_cache.shapeView on GitHub (pinned to 0132848349)
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
Example fix
# before python -m sglang.launch_server --model deepseek-ai/DeepSeek-V3.2 --enable-mixed-chunk # after python -m sglang.launch_server --model deepseek-ai/DeepSeek-V3.2
Defensive patterns
Strategy: validation
Validate before calling
def mixed_chunk_ok_on_ascend(use_mla, use_fia, qk_head_dim, topk_used):
return not use_mla and (use_fia or qk_head_dim <= 128) and not topk_used Type guard
def can_use_mixed_chunk_ascend(backend, layer) -> bool:
return (
not backend.use_mla
and (backend.use_fia or layer.qk_head_dim <= 128)
) Try / catch
try:
backend.forward_mixed(...)
except NotImplementedError as e:
if "enable-mixed-chunk" in str(e):
# fall back to separate prefill/decode scheduling
run_unmixed_schedule() Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- CP attention for non-FIA path on Ascend is not yet implement
- NPU packed attention does not support a sequence that is emp
- Ascend PD transfer does not support HiSparse destination dev
- Short-conv hybrid models (ZAYA1 CCA, LFM2 / LFM2-MoE) are no
- {name} is required for NPU packed attention
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/930ad09c5079160b.
Report an issue: GitHub.