From 72f639927f6caf3495d69dec63b9d4a87ed782ef Mon Sep 17 00:00:00 2001 From: zofia <110436990+zufangzhu@users.noreply.github.com> Date: Tue, 30 Jun 2026 03:03:06 +0800 Subject: [PATCH] [XPU] [RMSNorm] revert weightless change on xpu (#46987) Signed-off-by: Zhu, Zufang Co-authored-by: Kunshang Ji --- vllm/kernels/xpu_ops.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/vllm/kernels/xpu_ops.py b/vllm/kernels/xpu_ops.py index 8a86b1226b..df82962d80 100644 --- a/vllm/kernels/xpu_ops.py +++ b/vllm/kernels/xpu_ops.py @@ -31,10 +31,8 @@ def rms_norm( ) -> Tensor: assert variance_size is None if weight is None: - # Weightless _C ops are CUDA-only; native skips the multiply on XPU. - return ir.ops.rms_norm.impls["native"].impl_fn( - x, weight, epsilon, variance_size - ) + # Kernel requires weight tensor, pass ones + weight = torch.ones(x.shape[-1], device=x.device, dtype=x.dtype) output = torch.empty(x.shape, device=x.device, dtype=x.dtype) torch.ops._C.rms_norm(output, x, weight, epsilon) return output @@ -61,12 +59,7 @@ def fused_add_rms_norm( ) -> tuple[Tensor, Tensor]: assert variance_size is None if weight is None: - # Weightless _C ops are CUDA-only; native skips the multiply on XPU. - output, residual = ir.ops.fused_add_rms_norm.impls["native"].impl_fn( - x, x_residual, weight, epsilon, variance_size - ) - x.copy_(output) - x_residual.copy_(residual) - return x, x_residual + # Kernel requires weight tensor, pass ones + weight = torch.ones(x.shape[-1], device=x.device, dtype=x.dtype) torch.ops._C.fused_add_rms_norm(x, x_residual, weight, epsilon) return x, x_residual