[XPU] Misc changes to support XPU (#39817)

Signed-off-by: P V R K Jyothendra Varma <polisetty.v.r.k.jyothendra.varma@intel.com>
This commit is contained in:
Polisetty V R K Jyothendra Varma
2026-10-09 10:26:46 +08:00
committed by GitHub
parent 51686cf8e7
commit e54f08c860
5 changed files with 7 additions and 9 deletions
@@ -223,6 +223,7 @@ class ExecKernel(msgspec.Struct):
"triton",
"aiter",
"trtllm",
"intel_xpu",
],
resolvable=True,
),
@@ -263,6 +264,7 @@ class ExecKernel(msgspec.Struct):
"triton",
"aiter",
"trtllm",
"intel_xpu",
],
resolvable=True,
),
@@ -586,11 +586,6 @@ def _dsa_split_backend_resolution(view: Any) -> dict:
declared["dsa_prefill_backend"] = "intel_xpu"
if view.dsa_decode_backend is None:
declared["dsa_decode_backend"] = "intel_xpu"
# sgl-kernel topk ops (the default) are CUDA-only; fall back to the
# torch-native topk implementation on XPU, unless the user already
# picked a different backend explicitly (e.g. "flashinfer").
if view.dsa_topk_backend == "sgl-kernel":
declared["dsa_topk_backend"] = "torch"
logger.warning(
"Set DSA backends for XPU: prefill=%s, decode=%s, topk=%s.",
declared.get("dsa_prefill_backend", view.dsa_prefill_backend),
@@ -1274,8 +1274,10 @@ class UnquantizedFusedMoEMethod(FusedMoEMethodBase, BaseFusedOp):
b1=getattr(layer, "w13_weight_bias", None),
b2=getattr(layer, "w2_weight_bias", None),
activation=moe_runner_config.activation,
routed_scaling_factor=moe_runner_config.routed_scaling_factor,
gemm1_alpha=moe_runner_config.gemm1_alpha,
gemm1_limit=moe_runner_config.gemm1_clamp_limit,
swiglu_limit=moe_runner_config.swiglu_limit,
)
return StandardCombineInput(hidden_states=output)
else:
+2 -2
View File
@@ -154,8 +154,8 @@ class HYV3ForCausalLMNextN(nn.Module):
del self.lm_head.weight
self.model.embed_tokens.weight = embed
self.lm_head.weight = head
torch.cuda.empty_cache()
torch.cuda.synchronize()
torch.get_device_module().empty_cache()
torch.get_device_module().synchronize()
def load_weights(self, weights: Iterable[Tuple[str, torch.Tensor]]):
nextn_layer_id = self.config.num_hidden_layers