[Model][Bugfix] fix ernie45 moe 300B SharedFusedMoE output tuple (#27316)

Signed-off-by: wangyafeng <wangyafeng@baidu.com>
This commit is contained in:
CSWYF3634076 2025-10-27 11:53:31 +08:00 committed by GitHub
parent 5980604c44
commit 63b22e0dbb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -215,6 +215,8 @@ class Ernie4_5_MoeMoE(nn.Module):
if self.has_shared_experts:
final_hidden_states = final_hidden_states[0] + final_hidden_states[1]
else:
final_hidden_states = final_hidden_states[1]
if self.tp_size > 1:
final_hidden_states = self.experts.maybe_all_reduce_tensor_model_parallel(