[NPU] bugfix for model Qwen3-Coder-Next at weight shape transpose for npu. (#18700)
Co-authored-by: McZyWu <zhuoyun.wu.23@ucl.ac.uk>
This commit is contained in:
@@ -118,7 +118,7 @@ def npu_fused_moe_without_routing_weights_bf16(
|
|||||||
# gmm1: gate_up_proj
|
# gmm1: gate_up_proj
|
||||||
hidden_states = torch.ops.npu.npu_grouped_matmul(
|
hidden_states = torch.ops.npu.npu_grouped_matmul(
|
||||||
x=[hidden_states],
|
x=[hidden_states],
|
||||||
weight=[layer.w13_weight.permute(0, 2, 1)],
|
weight=[layer.w13_weight],
|
||||||
split_item=2,
|
split_item=2,
|
||||||
group_list_type=group_list_type,
|
group_list_type=group_list_type,
|
||||||
group_type=0,
|
group_type=0,
|
||||||
@@ -129,7 +129,7 @@ def npu_fused_moe_without_routing_weights_bf16(
|
|||||||
# gmm2: down_proj
|
# gmm2: down_proj
|
||||||
hidden_states = torch.ops.npu.npu_grouped_matmul(
|
hidden_states = torch.ops.npu.npu_grouped_matmul(
|
||||||
x=[hidden_states],
|
x=[hidden_states],
|
||||||
weight=[layer.w2_weight.permute(0, 2, 1)],
|
weight=[layer.w2_weight],
|
||||||
split_item=2,
|
split_item=2,
|
||||||
group_list_type=group_list_type,
|
group_list_type=group_list_type,
|
||||||
group_type=0,
|
group_type=0,
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ from sglang.srt.speculative.spec_info import SpecInput
|
|||||||
from sglang.srt.utils import cpu_has_amx_support, is_cpu, is_cuda, is_npu
|
from sglang.srt.utils import cpu_has_amx_support, is_cpu, is_cuda, is_npu
|
||||||
from sglang.srt.utils.common import rank0_log
|
from sglang.srt.utils.common import rank0_log
|
||||||
|
|
||||||
if not is_cpu() and not is_npu():
|
if not is_cpu():
|
||||||
# fix import error on CPU device, no impacts when non-CPU path
|
# fix import error on CPU device, no impacts when non-CPU path
|
||||||
try:
|
try:
|
||||||
from sglang.jit_kernel.cutedsl_gdn import (
|
from sglang.jit_kernel.cutedsl_gdn import (
|
||||||
|
|||||||
Reference in New Issue
Block a user