diff --git a/python/sglang/jit_kernel/dsv4/elementwise.py b/python/sglang/jit_kernel/dsv4/elementwise.py index e8c743595..8d17917b6 100644 --- a/python/sglang/jit_kernel/dsv4/elementwise.py +++ b/python/sglang/jit_kernel/dsv4/elementwise.py @@ -8,11 +8,12 @@ from sglang.jit_kernel.utils import ( load_jit, make_cpp_args, ) -from sglang.srt.utils import is_hip +from sglang.srt.utils import is_hip, is_xpu from .utils import make_name _is_hip = is_hip() +_is_xpu = is_xpu() @cache_once @@ -121,7 +122,7 @@ def fused_rope_inplace( positions: [batch_size] int32 or int64, indices into freqs_cis inverse: if True, apply inverse rotation (conjugate freqs) """ - if _is_hip: + if _is_hip or _is_xpu: from sglang.srt.layers.deepseek_v4_rope import apply_rotary_emb_triton apply_rotary_emb_triton(q, freqs_cis, positions=positions, inverse=inverse)