Revert "[TSP] last_norm allgather move to model.py (#5924)" (#5961)

This reverts commit 2bb838fed9.
This commit is contained in:
Yuanle Liu
2026-01-09 15:20:40 +08:00
committed by GitHub
parent 1d20957340
commit 8c3513a410
9 changed files with 8 additions and 30 deletions
@@ -325,10 +325,7 @@ class Ernie4_5_MTPModel(nn.Layer):
for i in range(self.num_layers):
hidden_states, residual = self.mtp_block[i](forward_meta, hidden_states, residual)
hidden_states = self.norm(hidden_states, residual, forward_meta=forward_meta)[0]
if self.norm.is_last_norm and self.norm.fd_config.parallel_config.use_sequence_parallel_moe:
hidden_states = self.norm.allgather(hidden_states, forward_meta.ids_remove_padding.shape[0])
hidden_states = self.norm(hidden_states, residual)[0]
return hidden_states
@@ -399,7 +396,7 @@ class Ernie4_5_MTPForCausalLM(ModelForCasualLM):
),
)
def compute_logits(self, hidden_states: paddle.Tensor, forward_meta: ForwardMeta):
def compute_logits(self, hidden_states: paddle.Tensor):
"""
compute logits
"""