[Hardware][XPU] Register matmul and linear batch-invariant kernels for XPU (#49209)

Signed-off-by: tzielinski-habana <tomasz.zielinski@intel.com>
Signed-off-by: Tomasz Zielinski <85164140+tzielinski-habana@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Tomasz Zielinski
2026-09-02 13:31:38 +00:00
committed by GitHub
co-authored by mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Claude Opus 5 Harry Mellor
parent 7894394b07
commit ffe3bb3c72
7 changed files with 272 additions and 33 deletions
+3 -1
View File
@@ -228,7 +228,9 @@ class UnquantizedLinearMethod(LinearMethodBase):
x: torch.Tensor,
bias: torch.Tensor | None = None,
) -> torch.Tensor:
if envs.VLLM_BATCH_INVARIANT and current_platform.is_cuda_alike():
if envs.VLLM_BATCH_INVARIANT and (
current_platform.is_cuda_alike() or current_platform.is_xpu()
):
return linear_batch_invariant(x, layer.weight, bias)
return self._gemm_impl(layer, x, layer.weight, bias)
@@ -71,7 +71,9 @@ class UnquantizedEmbeddingMethod(QuantizeMethodBase):
x: torch.Tensor,
bias: torch.Tensor | None = None,
) -> torch.Tensor:
if envs.VLLM_BATCH_INVARIANT and current_platform.is_cuda_alike():
if envs.VLLM_BATCH_INVARIANT and (
current_platform.is_cuda_alike() or current_platform.is_xpu()
):
return linear_batch_invariant(x, layer.weight, bias)
return dispatch_unquantized_gemm()(layer, x, layer.weight, bias)