[Refactor] Delete dead code in models (#51838)

Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
Wentao Ye
2026-08-11 15:44:26 -04:00
committed by GitHub
parent ded6c452c3
commit fd04edef3e
25 changed files with 34 additions and 223 deletions
-6
View File
@@ -92,7 +92,6 @@ class MixtralMoE(nn.Module):
self.hidden_size = hidden_size
self.ep_group = get_ep_group().device_group
self.ep_rank = get_ep_group().rank_in_group
self.ep_size = self.ep_group.size()
# Expert Parallelism Load balancing settings.
@@ -105,11 +104,6 @@ class MixtralMoE(nn.Module):
self.n_redundant_experts = parallel_config.eplb_config.num_redundant_experts
self.n_physical_experts = self.n_logical_experts + self.n_redundant_experts
self.n_local_physical_experts = self.n_physical_experts // self.ep_size
self.physical_expert_start = self.ep_rank * self.n_local_physical_experts
self.physical_expert_end = (
self.physical_expert_start + self.n_local_physical_experts
)
# Gate always runs at half / full precision for now.
self.gate = ReplicatedLinear(