Remove boilerplate missed by #46820 (#46956)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Harry Mellor
2026-06-29 08:11:17 +08:00
committed by GitHub
parent 0472436541
commit 311ad689ad
6 changed files with 1 additions and 35 deletions
-20
View File
@@ -705,8 +705,6 @@ class Param2MoEModel(nn.Module):
class Param2MoEMixtureOfExperts(MixtureOfExperts):
"""Implements the vLLM MixtureOfExperts protocol for Param2MoE."""
expert_weights: list[torch.Tensor]
def extract_moe_parameters(self, example_moe: Param2MoEMoEBlock | None) -> None:
if example_moe is None:
raise RuntimeError(
@@ -745,24 +743,6 @@ class Param2MoEMixtureOfExperts(MixtureOfExperts):
if hasattr(fused, "update_expert_map"):
fused.update_expert_map()
def set_eplb_state(
self,
expert_load_view: torch.Tensor,
logical_to_physical_map: torch.Tensor,
logical_replica_count: torch.Tensor,
) -> None:
self.expert_weights = []
for layer_idx, layer in enumerate(self.moe_layers):
if hasattr(layer, "get_expert_weights"):
self.expert_weights.append(layer.get_expert_weights())
if hasattr(layer, "set_eplb_state"):
layer.set_eplb_state(
moe_layer_idx=layer_idx,
expert_load_view=expert_load_view,
logical_to_physical_map=logical_to_physical_map,
logical_replica_count=logical_replica_count,
)
class Param2MoEForCausalLM(
nn.Module, SupportsPP, SupportsLoRA, Param2MoEMixtureOfExperts