[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:
blzheng
2026-03-29 23:43:46 -07:00
committed by GitHub
co-authored by Ma Mingfei
parent 6da8f5f69e
commit ed01e1d5d6
4 changed files with 303 additions and 1 deletions
@@ -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