[Fix] [NPU] qwen: Fix shared-expert routing with Ascend FuseEP (#40516)

This commit is contained in:
McZyWu
2026-10-17 16:19:44 +08:00
committed by GitHub
parent ef26f6ad49
commit 7a8804edb5
+3
View File
@@ -372,6 +372,7 @@ class Qwen2MoeSparseMoeBlock(nn.Module):
or get_moe_a2a_backend().is_flashinfer()
or get_moe_a2a_backend().is_flashinfer_megamoe()
or get_moe_a2a_backend().is_megamoe()
or get_moe_a2a_backend().is_ascend_fuseep()
)
else {}
),
@@ -393,6 +394,7 @@ class Qwen2MoeSparseMoeBlock(nn.Module):
get_moe_a2a_backend().is_deepep()
or get_moe_a2a_backend().is_deepep_v2()
or get_moe_a2a_backend().is_mori()
or get_moe_a2a_backend().is_ascend_fuseep()
):
self.num_experts = (
config.num_experts + get_exec().moe.ep_num_redundant_experts
@@ -827,6 +829,7 @@ class Qwen2MoeSparseMoeBlock(nn.Module):
get_moe_a2a_backend().is_deepep()
or get_moe_a2a_backend().is_deepep_v2()
or get_moe_a2a_backend().is_mori()
or get_moe_a2a_backend().is_ascend_fuseep()
):
return self._forward_deepep(hidden_states, forward_batch)