[CPU] add kernel apply_rotary_pos_emb_cpu for Qwen3-VL and Qwen3-Omni (#13121)
Co-authored-by: Ma Mingfei <mingfei.ma@intel.com>
This commit is contained in:
@@ -7,9 +7,11 @@ from typing import Tuple
|
||||
|
||||
import torch
|
||||
|
||||
from sglang.srt.utils import get_compiler_backend, is_npu
|
||||
from sglang.srt.utils import cpu_has_amx_support, get_compiler_backend, is_cpu, is_npu
|
||||
|
||||
_is_npu = is_npu()
|
||||
_is_cpu = is_cpu()
|
||||
_is_cpu_amx_available = cpu_has_amx_support()
|
||||
|
||||
if _is_npu:
|
||||
import torch_npu
|
||||
@@ -128,5 +130,7 @@ def apply_rotary_pos_emb_npu(
|
||||
|
||||
if _is_npu:
|
||||
apply_rotary_pos_emb = apply_rotary_pos_emb_npu
|
||||
elif _is_cpu and _is_cpu_amx_available:
|
||||
apply_rotary_pos_emb = torch.ops.sgl_kernel.apply_rotary_pos_emb_cpu
|
||||
else:
|
||||
apply_rotary_pos_emb = apply_rotary_pos_emb_native
|
||||
|
||||
Reference in New Issue
Block a user