From a8b91f6b2d0c0988583b5ee32e4d03a76361b07b Mon Sep 17 00:00:00 2001 From: Haichao Zhu Date: Tue, 28 Oct 2025 00:01:42 +0800 Subject: [PATCH] improve mimax-m2 rmsnorm precision (#12186) --- python/sglang/srt/models/minimax_m2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/sglang/srt/models/minimax_m2.py b/python/sglang/srt/models/minimax_m2.py index c5c5074fb..baf3caf53 100644 --- a/python/sglang/srt/models/minimax_m2.py +++ b/python/sglang/srt/models/minimax_m2.py @@ -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