[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
+4 -11
View File
@@ -127,17 +127,10 @@ class InternS2MobiusMetaMoeBlock(nn.Module):
if self.is_sequence_parallel and not already_sequence_parallel:
hidden_states = sequence_parallel_chunk(hidden_states)
if self.experts.is_internal_router:
final_hidden_states = self.experts(
hidden_states=hidden_states,
router_logits=hidden_states,
)
else:
router_logits, _ = self.gate(hidden_states)
final_hidden_states = self.experts(
hidden_states=hidden_states,
router_logits=router_logits,
)
final_hidden_states = self.experts(
hidden_states=hidden_states,
router_logits=hidden_states,
)
if self.is_sequence_parallel and not already_sequence_parallel:
final_hidden_states = tensor_model_parallel_all_gather(