Perf/minimax h3 dit swiglu rope cache npu (#6410)

Signed-off-by: Wenjia Li <wjialish@gmail.com>
Co-authored-by: WeiQing Chen <40507679+david6666666@users.noreply.github.com>
This commit is contained in:
Wenjia LiandWeiQing Chen authored and GitHub committed 2026-08-29 09:14:52 +00:00
1 parent bb5bf8fd0a
commit d9980c75e8
11 files changed
+920 -33

No files matched your search

+4 -1
View File
@@ -1,4 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
"""Custom activation functions for diffusion models."""
import torch
@@ -31,7 +32,9 @@ class SiluAndMul(CustomOp):
return out
def forward_npu(self, x: torch.Tensor) -> torch.Tensor:
return self.forward_native(x)
import torch_npu
return torch_npu.npu_swiglu(x, dim=-1)
def forward_xpu(self, x: torch.Tensor) -> torch.Tensor:
return self.forward_native(x)