@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / d6704dd099
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 14, 04:15 UTC

Fix MiniMax-M2 rmsnorm precision and remove useless code (#27627)

Signed-off-by: xuebi <xuebi@minimaxi.com> Co-authored-by: xuebi <xuebi@minimaxi.com>

Roger Young committed Oct 29, 2025 at 21:01 UTC d6704dd099b71a9881613dee74b440d78594fa8f
2 files changed +1 -19
vllm/model_executor/layers/mamba/linear_attn.py
+1 -1
@@ -77,7 +77,7 @@ class MiniMaxText01RMSNormTP(CustomOp):
77 if self.tp_world > 1:
78 variance = tensor_model_parallel_all_reduce(variance) / self.tp_world
79 x = x * torch.rsqrt(variance + self.variance_epsilon)
80 - x = x.to(orig_dtype) * self.weight
80 + x = (x * self.weight).to(orig_dtype)
81 return x
82
83 def forward(
vllm/model_executor/models/minimax_m2.py
-18
@@ -263,23 +263,6 @@ class MiniMaxM2DecoderLayer(nn.Module):
263 # with the layer's index.
264 layer_idx = int(prefix.split(sep=".")[-1])
265
266 - # TODO: support MTP
267 - attn_window_size = getattr(config, "attn_window_size", None)
268 - if attn_window_size is not None:
269 - if isinstance(attn_window_size, list):
270 - attn_window_size = attn_window_size[layer_idx]
271 - elif isinstance(attn_window_size, int):
272 - attn_window_size = attn_window_size
273 - else:
274 - raise ValueError(f"Invalid attn_window_size: {attn_window_size}")
275 - attn_window_size = None if attn_window_size <= 0 else attn_window_size
276 -
277 - # different rope theta for full layer and swa layer
278 - swa_rope_theta = getattr(config, "swa_rope_theta", -1)
279 - # default to full rope theta
280 - swa_rope_theta = rope_theta if swa_rope_theta <= 0 else swa_rope_theta
281 - rope_theta = swa_rope_theta if attn_window_size is not None else rope_theta
282 -
266 self.layer_idx = layer_idx
267 self.self_attn = MiniMaxM2Attention(
268 hidden_size=self.hidden_size,
@@ -288,7 +271,6 @@ class MiniMaxM2DecoderLayer(nn.Module):
271 rotary_dim=config.rotary_dim,
272 rope_theta=rope_theta,
273 rope_scaling=rope_scaling,
291 - attn_window_size=attn_window_size,
274 max_position_embeddings=max_position_embeddings,
275 rms_norm_eps=config.rms_norm_eps,
276 qkv_bias=getattr(config, "attention_bias", False),