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
@@ -105,14 +105,14 @@ class RMSNorm(nn.Layer):
self.tp_rank = self.fd_config.parallel_config.tensor_parallel_rank
self.tp_group = self.fd_config.parallel_config.tp_group
is_input_norm = prefix.endswith(".input_layernorm")
self.is_last_norm = prefix.endswith(".norm")
is_last_norm = prefix.endswith(".norm")
self.split_x = (
self.fd_config.parallel_config.use_sequence_parallel_moe
and self.layer_id == self.fd_config.model_config.moe_layer_start_index
and is_input_norm
)
self.allgather_out = self.fd_config.parallel_config.use_sequence_parallel_moe and (
(self.layer_id > self.fd_config.model_config.moe_layer_start_index and is_input_norm)
(self.layer_id > self.fd_config.model_config.moe_layer_start_index and is_input_norm) or is_last_norm
)
self.init_weight()