code: def apply_rotary_pos_emb_no_cache_xpu(
      q, k, position_ids, model_family
  ):
      if q.device.type != "xpu":
          invalidInputError(
              False, f"only xpu is supported in this function"
          )
      import linear_q4_0
  
      q_embed = torch.empty(q.shape, dtype=q.dtype, device=q.device)
      k_embed = torch.empty(k.shape, dtype=k.dtype, device=k.device)
      if model_family in [
          "llama",
          "baichuan",
          "internlm",
          "aquila",
          "gpt_neox",
          "mistral",
          "mixtral",
      ]:
          linear_q4_0.apply_rotary_embedding_half_qk(
              q, k, position_ids, q_embed, k_embed
          )
          return q_embed, k_embed
      else:
          invalidInputError(False, f"{model_family} is not supported.")
  
imports: import os
  import torch
  from bigdl.llm.utils.common import invalidInputError
  from bigdl.llm.ggml.quantize import ggml_tensor_qtype
  from bigdl.llm.transformers.utils import get_ipex_version, get_xpu_device_type
label_desc: Use image node_id 12 for calling a global function with example usage: apply_rotary_pos_emb_no_cache_xpu(q, k, position_ids, model_family) and returns: q_embed,  k_embed