[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
+1 -1
View File
@@ -44,7 +44,7 @@ class FusedMoEWithLoRA(BaseLayerWithLoRA):
"Monolithic kernels are not supported for Fused MoE LoRA."
)
# Use the MoE-aware TP rank/size: when EP is active, FusedMoE collapses
# Use the MoE-aware TP rank/size: when EP is active, MoERunner collapses
# moe_parallel_config.tp_size to 1 (experts are sharded across the
# TP group instead).
moe_parallel_config = self.moe_config.moe_parallel_config
+2 -2
View File
@@ -24,7 +24,7 @@ logger = init_logger(__name__)
@dataclass(frozen=True)
class MoEEPLoadSpec:
"""Per-expert-parallel slicing metadata for one FusedMoE LoRA module.
"""Per-expert-parallel slicing metadata for one FusedMoEFactory LoRA module.
Threaded into the LoRA loader so per-expert weights from EP ranks
other than this one can be skipped before they ever hit CPU memory.
@@ -193,7 +193,7 @@ class LoRAModel:
skip_prefixes: List of module name prefixes to skip during loading.
Models can define this to skip modules not used in inference
(e.g., MTP layers). Format: ["mtp."]
moe_ep_spec: When 2D FusedMoE LoRA modules are present with
moe_ep_spec: When 2D FusedMoEFactory LoRA modules are present with
expert parallelism enabled, the (ep_rank, local, global)
slicing metadata shared across all MoE layers. Non-local
expert weights are skipped at read time instead of being
+2 -2
View File
@@ -739,7 +739,7 @@ class LoRAModelManager:
def _create_merged_loras_inplace(self, lora_model: LoRAModel) -> None:
for module_name, new_module_names in self.packed_modules.items():
# For 2D FusedMoE modules with EP, narrow the per-expert
# For 2D RoutedExperts modules with EP, narrow the per-expert
# sub-module list to this rank's owned experts so pack_moe
# produces a tensor sized to local_num_experts directly.
packed_module_names = new_module_names
@@ -1096,7 +1096,7 @@ class LoRAModelManager:
def _build_moe_ep_load_spec(self) -> MoEEPLoadSpec | None:
"""
Per-rank slicing metadata for 2D FusedMoE LoRA modules.
Per-rank slicing metadata for 2D RoutedEXperts LoRA modules.
"""
if not self._use_ep or not self._is_moe:
return None