improve mimax-m2 rmsnorm precision (#12186)

This commit is contained in:
Haichao Zhu
2025-10-28 00:01:42 +08:00
committed by GitHub
parent 959d1ab84b
commit a8b91f6b2d

View File

@@ -122,7 +122,7 @@ class MiniMaxM2RMSNormTP(nn.Module):
# Normalize and apply local weight shard
x = x * torch.rsqrt(variance + self.variance_epsilon)
x = x.to(orig_dtype) * self.weight
x = (x * self.weight).to(orig_dtype)
return x