[Intel GPU] DeepSeek V4 9/N: use sgl-kernel implementation of hadamard_transform on XPU (#28046)
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
e9ef06c560
commit
0c01971eeb
@@ -49,6 +49,7 @@ from sglang.srt.utils import (
|
|||||||
is_gfx95_supported,
|
is_gfx95_supported,
|
||||||
is_hip,
|
is_hip,
|
||||||
is_npu,
|
is_npu,
|
||||||
|
is_xpu,
|
||||||
)
|
)
|
||||||
from sglang.srt.utils.custom_op import register_custom_op
|
from sglang.srt.utils.custom_op import register_custom_op
|
||||||
|
|
||||||
@@ -58,6 +59,7 @@ global _use_multi_stream
|
|||||||
_is_cuda = is_cuda()
|
_is_cuda = is_cuda()
|
||||||
_is_hip = is_hip()
|
_is_hip = is_hip()
|
||||||
_is_npu = is_npu()
|
_is_npu = is_npu()
|
||||||
|
_is_xpu = is_xpu()
|
||||||
|
|
||||||
if not _is_npu:
|
if not _is_npu:
|
||||||
from sglang.jit_kernel.dsa import (
|
from sglang.jit_kernel.dsa import (
|
||||||
@@ -338,6 +340,8 @@ def rotate_activation(x: torch.Tensor) -> torch.Tensor:
|
|||||||
# from sgl_kernel import hadamard_transform
|
# from sgl_kernel import hadamard_transform
|
||||||
if _is_hip:
|
if _is_hip:
|
||||||
from fast_hadamard_transform import hadamard_transform
|
from fast_hadamard_transform import hadamard_transform
|
||||||
|
elif _is_xpu:
|
||||||
|
from sgl_kernel import hadamard_transform
|
||||||
else:
|
else:
|
||||||
from sglang.jit_kernel.hadamard import hadamard_transform
|
from sglang.jit_kernel.hadamard import hadamard_transform
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user