[Perf] Optimize batch invariant with fused rms norm, 2.1% E2E latency improvement (#40413)

Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
Wentao Ye
2026-04-21 19:51:03 +00:00
committed by GitHub
parent 6fbec8ed47
commit 16688b26a6
3 changed files with 89 additions and 5 deletions
+1
View File
@@ -420,6 +420,7 @@ def rms_norm(
def fused_add_rms_norm(
input: torch.Tensor, residual: torch.Tensor, weight: torch.Tensor, epsilon: float
) -> None:
# Note: this func is batch invariant
torch.ops._C.fused_add_rms_norm(input, residual, weight, epsilon)