Skip to content

[NPU/Ascend] RuntimeError: unsupported mega_chunk_gdn (NumValueHeads, NumKeyHeads) pair on Qwen3-6-27B with GDN backend #522

Description

@AndyLi429

Environment

Model: Qwen3-6-27B (1P config)
CANN:9.0.0
Device: Ascend NPU
Attention backend: ascend (GDN triton path)
Speculative decoding: NEXTN

Launch Command

PYTORCH_NPU_ALLOC_CONF=expandable_segments:True \
STREAMS_PER_DEVICE=32 \
HCCL_SOCKET_IFNAME=lo \
GLOO_SOCKET_IFNAME=lo \
HCCL_OP_EXPANSION_MODE=AIV \
SGLANG_SET_CPU_AFFINITY=1 \
SGLANG_ENABLE_SPEC_V2=1 \
SGLANG_ENABLE_OVERLAP_PLAN_STREAM=0 \
SGLANG_SCHEDULER_DECREASE_PREFILL_IDLE=1 \
SGLANG_PREFILL_DELAYER_MAX_DELAY_PASSES=130 \
python -m sglang.launch_server \
    --tp-size 2 \
    --nnodes 1 \
    --attention-backend ascend \
    --device npu \
    --chunked-prefill-size -1 \
    --max-prefill-tokens 60000 \
    --disable-radix-cache \
    --trust-remote-code \
    --max-running-requests 54 \
    --max-mamba-cache-size 64 \
    --mem-fraction-static 0.7 \
    --cuda-graph-bs 2 8 16 32 45 54 \
    --enable-multimodal \
    --quantization modelslim \
    --mm-attention-backend ascend_attn \
    --dtype bfloat16 \
    --mamba-ssm-dtype bfloat16 \
    --speculative-algorithm NEXTN \
    --speculative-num-steps 3 \
    --speculative-eagle-topk 1 \
    --speculative-num-draft-tokens 4

Error
Server crashes during prefill/extend with:
RuntimeError: unsupported mega_chunk_gdn (NumValueHeads, NumKeyHeads) pair
Full Stack Trace

File ".../sglang/srt/models/qwen3_5.py", line 511, in forward
    core_attn_out = self.attn(
File ".../torch/nn/modules/module.py", line 1776, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
File ".../sglang/srt/layers/radix_linear_attention.py", line 111, in forward
    return get_attn_backend().forward(
File ".../sglang/srt/layers/attention/hybrid_linear_attn_backend.py", line 1005, in forward
    return self.forward_extend(
File ".../sglang/srt/layers/attention/hybrid_linear_attn_backend.py", line 957, in forward_extend
    return self.linear_attn_backend.forward_extend(
File ".../sglang/srt/hardware_backend/npu/attention/ascend_gdn_backend.py", line 338, in forward_extend
    core_attn_out, last_recurrent_state, h = self.kernel_dispatcher.extend(
File ".../sglang/srt/layers/attention/linear/gdn_backend.py", line 222, in extend
    return self.extend_kernel.extend(
File ".../sglang/srt/layers/attention/linear/kernels/gdn_triton.py", line 147, in extend
    return chunk_gated_delta_rule(
File ".../sgl_kernel_npu/fla/utils.py", line 86, in wrapper
    return fn(*contiguous_args, **contiguous_kwargs)
File ".../sgl_kernel_npu/fla/chunk.py", line 384, in chunk_gated_delta_rule_npu
    _, o, _, final_state, _, h, _ = chunk_gated_delta_rule_fwd(
File ".../sgl_kernel_npu/fla/chunk.py", line 219, in chunk_gated_delta_rule_fwd
    g, o, A, final_state, w, h, v_new = run_mega_chunk_gdn(
File ".../sgl_kernel_npu/fla/mega_chunk_gdn.py", line 207, in run_mega_chunk_gdn
    torch.ops.npu.mega_chunk_gdn(
File ".../torch/_ops.py", line 1209, in __call__
    return self._op(*args, **kwargs)
RuntimeError: unsupported mega_chunk_gdn (NumValueHeads, NumKeyHeads) pair

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions