[MoE Refactor] Rename FusedMoE to FusedMoEFactory (#44941)

Signed-off-by: Bill Nell <bnell@redhat.com>
Signed-off-by: bnellnm <49004751+bnellnm@users.noreply.github.com>
Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
bnellnm
2026-07-31 11:28:18 +01:00
committed by GitHub
co-authored by Harry Mellor
parent c911120a6f
commit 6e311c6e20
80 changed files with 243 additions and 234 deletions
+3 -3
View File
@@ -27,7 +27,7 @@ from vllm.model_executor.kernels.mhc.tilelang import (
)
from vllm.model_executor.layers.activation import SiluAndMul, SiluAndMulWithClamp
from vllm.model_executor.layers.fused_moe import (
FusedMoE,
FusedMoEFactory,
fused_moe_make_expert_params_mapping,
)
from vllm.model_executor.layers.fused_moe.router.base_router import (
@@ -670,7 +670,7 @@ class DeepseekV4MoE(nn.Module):
self.physical_expert_start = self.experts_start_idx
self.physical_expert_end = self.experts_end_idx
self.experts = FusedMoE(
self.experts = FusedMoEFactory(
shared_experts=self.shared_experts,
gate=self.gate,
num_experts=config.n_routed_experts,
@@ -736,7 +736,7 @@ class DeepseekV4MoE(nn.Module):
) -> torch.Tensor:
org_shape = hidden_states.shape
if self.experts.is_internal_router:
# In this case, the gate/router runs inside the FusedMoE class
# In this case, the gate/router runs inside the MoERunner class
final_hidden_states = self.experts(
hidden_states=hidden_states,
router_logits=hidden_states,