[XPU]add sycl path for Mhc (#47245)

Signed-off-by: root <xiaolong.guo@intel.com> Co-authored-by: Kunshang Ji <kunshang.ji@intel.com>

Liangqiusong committed Jul 20, 2026 at 23:32 UTC b23bd73f540175f9e117eaee5029cd7d8df63964
1 file changed +5 -20
vllm/model_executor/layers/mhc.py
+5 -20
@@ -175,7 +175,7 @@ class MHCPreOp(CustomOp):
175 norm_weight: torch.Tensor | None = None,
176 norm_eps: float = 0.0,
177 ) -> tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
178 - return self.forward_native(
178 + return torch.ops._xpu_C.mhc_pre(
179 residual,
180 fn,
181 hc_scale,
@@ -185,9 +185,6 @@ class MHCPreOp(CustomOp):
185 hc_sinkhorn_eps,
186 hc_post_mult_value,
187 sinkhorn_repeat,
188 - n_splits,
189 - norm_weight,
190 - norm_eps,
188 )
189
190
@@ -260,7 +257,7 @@ class MHCPostOp(CustomOp):
257 post_layer_mix: torch.Tensor,
258 comb_res_mix: torch.Tensor,
259 ) -> torch.Tensor:
263 - return self.forward_native(
260 + return torch.ops._xpu_C.mhc_post(
261 x,
262 residual,
263 post_layer_mix,
@@ -369,16 +366,8 @@ class HCHeadOp(CustomOp):
366 out = torch.empty(
367 num_tokens, hidden_size, dtype=torch.bfloat16, device=hidden_states.device
368 )
372 - torch.ops.vllm.hc_head_triton(
373 - hs_flat,
374 - hc_fn,
375 - hc_scale,
376 - hc_base,
377 - out,
378 - hidden_size,
379 - rms_norm_eps,
380 - hc_eps,
381 - hc_mult,
369 + torch.ops._xpu_C.hc_head_fused(
370 + hs_flat, hc_fn, hc_scale, hc_base, out, rms_norm_eps, hc_eps
371 )
372 return out.view(*outer_shape, hidden_size)
373
@@ -548,7 +537,7 @@ class MHCFusedPostPreOp(CustomOp):
537 norm_weight: torch.Tensor | None = None,
538 norm_eps: float = 0.0,
539 ) -> tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]:
551 - return self.forward_native(
540 + return torch.ops._xpu_C.mhc_fused_post_pre(
541 x,
542 residual,
543 post_layer_mix,
@@ -561,8 +550,4 @@ class MHCFusedPostPreOp(CustomOp):
550 hc_sinkhorn_eps,
551 hc_post_mult_value,
552 sinkhorn_repeat,
564 - n_splits,
565 - tile_n,
566 - norm_weight,
567 - norm_eps,
553 )