[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
@@ -16,7 +16,7 @@ from vllm.distributed import (
)
from vllm.model_executor.layers.activation import SiluAndMul
from vllm.model_executor.layers.attention import Attention
from vllm.model_executor.layers.fused_moe import FusedMoE
from vllm.model_executor.layers.fused_moe import FusedMoEFactory
from vllm.model_executor.layers.linear import (
MergedColumnParallelLinear,
QKVParallelLinear,
@@ -300,7 +300,7 @@ class Cohere2Moe(nn.Module):
self.shared_experts = None
self.shared_expert_combination_strategy = None
self.experts = FusedMoE(
self.experts = FusedMoEFactory(
num_experts=config.num_experts,
top_k=config.num_experts_per_tok,
hidden_size=config.hidden_size,
@@ -318,7 +318,7 @@ class Cohere2Moe(nn.Module):
orig_shape = hidden_states.shape
hidden_states = hidden_states.view(-1, self.hidden_size)
router_logits, _ = self.gate(hidden_states)
# FusedMoE handles shared expert overlap internally and returns
# FusedMoEFactory handles shared expert overlap internally and returns
# shared_output + routed_output when shared_experts is set.
final_hidden_states = self.experts(hidden_states, router_logits)
if self.shared_expert_combination_strategy == "average":