[Perf][DSv4] Use native CUDA SwiGLU clamp kernel for Humming MoE (throughput +1.40%) (#53685)

Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
This commit is contained in:
Chauncey
2026-08-27 13:52:45 -07:00
committed by GitHub
parent 9818bb3db8
commit 7d5769b2d9
2 changed files with 17 additions and 0 deletions
@@ -647,6 +647,8 @@ def swiglu_limit_func(
# requires topk_ids. Fall back to the torch implementation otherwise.
if topk_ids is not None:
_swiglu_limit_pad_aware(output, input, topk_ids, swiglu_limit, expert_map)
elif current_platform.is_cuda():
torch.ops._C.silu_and_mul_with_clamp(output, input, swiglu_limit, 1.0, 0.0)
else:
_swiglu_limit_torch(output, input, swiglu_limit)