[Kernel] Use fused rmsnorm for some models like qwen3 series (#17735)
Signed-off-by: evian <eviantai@u.nus.edu> Co-authored-by: evian <eviantai@u.nus.edu>
This commit is contained in:
+3
-1
@@ -186,7 +186,9 @@ def batched_rotary_embedding(positions: torch.Tensor, query: torch.Tensor,
|
||||
# layer norm ops
|
||||
def rms_norm(out: torch.Tensor, input: torch.Tensor, weight: torch.Tensor,
|
||||
epsilon: float) -> None:
|
||||
torch.ops._C.rms_norm(out, input, weight, epsilon)
|
||||
# TODO: Remove this contiguous call when the kernel is updated to support non-contiguous input
|
||||
input_contiguous = input.contiguous()
|
||||
torch.ops._C.rms_norm(out, input_contiguous, weight, epsilon)
|
||||
|
||||
|
||||
def fused_add_rms_norm(input: torch.Tensor, residual: torch.Tensor,
|
||||
|
||||
Reference in New Issue
Block a user