[XPU] Route topk_sigmoid and topk_softmax to AOT sgl-kernel-xpu symbols (#31038)

Co-authored-by: vshekhawat-hlab <vshekhawat@habana.ai>
Co-authored-by: Ma Mingfei <mingfei.ma@intel.com>
This commit is contained in:
ashwini rathi
2026-07-16 10:29:19 +08:00
committed by GitHub
co-authored by vshekhawat-hlab Ma Mingfei
parent 14095ef78a
commit 3a8ddd3fd0
+6 -1
View File
@@ -128,7 +128,6 @@ _is_cpu = is_cpu()
_is_cpu_amx_available = cpu_has_amx_support() _is_cpu_amx_available = cpu_has_amx_support()
_is_xpu = is_xpu() _is_xpu = is_xpu()
_is_npu = is_npu() _is_npu = is_npu()
_is_xpu = is_xpu()
_use_aiter = get_bool_env_var("SGLANG_USE_AITER") and _is_hip _use_aiter = get_bool_env_var("SGLANG_USE_AITER") and _is_hip
_is_musa = is_musa() _is_musa = is_musa()
@@ -177,6 +176,12 @@ if _is_cuda:
fused_topk_deepseek = None fused_topk_deepseek = None
if _is_cuda or _is_hip or _is_xpu: if _is_cuda or _is_hip or _is_xpu:
if _is_xpu:
# XPU has no tvm_ffi, so the CUDA JIT topk_sigmoid isn't reachable;
# use the AOT symbols from sgl_kernel directly. topk_sigmoid was aligned
# with the post-#28715 CUDA signature in sgl-kernel-xpu#285.
from sgl_kernel import topk_sigmoid, topk_softmax
else:
from sglang.kernels.ops.moe import topk_softmax from sglang.kernels.ops.moe import topk_softmax
try: try: