mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-10 03:05:02 +08:00
[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:
parent
28f350e147
commit
6997a25ac6
@ -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(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user