From 532cd337ed7fa2579baf7582f347fc44b8028245 Mon Sep 17 00:00:00 2001 From: Polisetty V R K Jyothendra Varma Date: Wed, 15 Jul 2026 08:33:53 +0530 Subject: [PATCH] [Intel GPU] DeepSeek V4 12/N: use sgl-kernel implementation of silu_and_mul_clamp to run on XPU (#28428) Signed-off-by: P V R K Jyothendra Varma --- python/sglang/jit_kernel/dsv4/moe.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/python/sglang/jit_kernel/dsv4/moe.py b/python/sglang/jit_kernel/dsv4/moe.py index 931805e44..81a21c85c 100644 --- a/python/sglang/jit_kernel/dsv4/moe.py +++ b/python/sglang/jit_kernel/dsv4/moe.py @@ -9,9 +9,12 @@ from sglang.jit_kernel.utils import ( load_jit, make_cpp_args, ) +from sglang.srt.utils import is_xpu from .utils import make_name +_is_xpu = is_xpu() + @cache_once def _jit_mask_topk_module(): @@ -175,8 +178,13 @@ def silu_and_mul_clamp( output: torch.Tensor, swiglu_limit: float, ) -> None: - module = _jit_silu_and_mul_clamp_module(input.dtype) - module.run(input, output, float(swiglu_limit)) + if _is_xpu: + from sgl_kernel import silu_and_mul_clamp + + silu_and_mul_clamp(input, output, float(swiglu_limit)) + else: + module = _jit_silu_and_mul_clamp_module(input.dtype) + module.run(input, output, float(swiglu_limit)) def silu_and_mul_masked_post_quant(