From 6997a25ac65ed6cc3c2be6d09ca45f633a345f63 Mon Sep 17 00:00:00 2001 From: qscqesze Date: Wed, 3 Sep 2025 19:27:04 +0800 Subject: [PATCH] [Model] Remove useless code from MiniMax implementation (#23982) Signed-off-by: QscQ Signed-off-by: qingjun --- vllm/model_executor/layers/mamba/linear_attn.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/vllm/model_executor/layers/mamba/linear_attn.py b/vllm/model_executor/layers/mamba/linear_attn.py index d93cef1a27ad4..5fe37a6289e01 100644 --- a/vllm/model_executor/layers/mamba/linear_attn.py +++ b/vllm/model_executor/layers/mamba/linear_attn.py @@ -83,17 +83,7 @@ class MiniMaxText01RMSNormTP(CustomOp): variance = tensor_model_parallel_all_reduce( variance) / self.tp_world x = x * torch.rsqrt(variance + self.variance_epsilon) - - 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 + x = x.to(orig_dtype) * self.weight return x def forward(