[Intel GPU] DeepSeek V4 7/N: Support fused_rope_inplace on XPU using triton (#27915)
Signed-off-by: P V R K Jyothendra Varma <polisettyvarma@gmail.com> Co-authored-by: Rahul Vijayaraghavan <rahul.vijayaraghavan@intel.com> Co-authored-by: Ma Mingfei <mingfei.ma@intel.com>
This commit is contained in:
co-authored by
Rahul Vijayaraghavan
Ma Mingfei
parent
cb06c4e6ce
commit
790156c98f
@@ -8,11 +8,12 @@ from sglang.jit_kernel.utils import (
|
|||||||
load_jit,
|
load_jit,
|
||||||
make_cpp_args,
|
make_cpp_args,
|
||||||
)
|
)
|
||||||
from sglang.srt.utils import is_hip
|
from sglang.srt.utils import is_hip, is_xpu
|
||||||
|
|
||||||
from .utils import make_name
|
from .utils import make_name
|
||||||
|
|
||||||
_is_hip = is_hip()
|
_is_hip = is_hip()
|
||||||
|
_is_xpu = is_xpu()
|
||||||
|
|
||||||
|
|
||||||
@cache_once
|
@cache_once
|
||||||
@@ -121,7 +122,7 @@ def fused_rope_inplace(
|
|||||||
positions: [batch_size] int32 or int64, indices into freqs_cis
|
positions: [batch_size] int32 or int64, indices into freqs_cis
|
||||||
inverse: if True, apply inverse rotation (conjugate freqs)
|
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
|
from sglang.srt.layers.deepseek_v4_rope import apply_rotary_emb_triton
|
||||||
|
|
||||||
apply_rotary_emb_triton(q, freqs_cis, positions=positions, inverse=inverse)
|
apply_rotary_emb_triton(q, freqs_cis, positions=positions, inverse=inverse)
|
||||||
|
|||||||
Reference in New Issue
Block a user