[Model] Remove useless code from MiniMax implementation (#23982)

Signed-off-by: QscQ <qscqesze@gmail.com>
Signed-off-by: qingjun <qingjun@minimaxi.com>
This commit is contained in:
qscqesze 2025-09-03 19:27:04 +08:00 committed by GitHub
parent 28f350e147
commit 6997a25ac6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -83,17 +83,7 @@ class MiniMaxText01RMSNormTP(CustomOp):
variance = tensor_model_parallel_all_reduce( variance = tensor_model_parallel_all_reduce(
variance) / self.tp_world variance) / self.tp_world
x = x * torch.rsqrt(variance + self.variance_epsilon) x = x * torch.rsqrt(variance + self.variance_epsilon)
x = x.to(orig_dtype) * self.weight
weight = self.weight
if x.size(-1) != self.weight.size(0):
if self.weight.size(0) < x.size(-1):
repeat_count = (x.size(-1) + self.weight.size(0)) // x.size(-1)
full_weight = self.weight.repeat(repeat_count)
weight = full_weight[:x.size(-1)]
else:
weight = self.weight[:x.size(-1)]
x = x.to(orig_dtype) * weight
return x return x
def forward( def forward(