[XPU] Enable Kimi K3 KDA kernel tests on XPU (#51809)
Signed-off-by: pmanczak <pawel.manczak@intel.com>
This commit is contained in:
@@ -30,9 +30,15 @@ from vllm.models.kimi_k3.nvidia.ops.third_party.kda import (
|
|||||||
fused_recurrent_kda_fwd,
|
fused_recurrent_kda_fwd,
|
||||||
fused_recurrent_kda_packed_decode,
|
fused_recurrent_kda_packed_decode,
|
||||||
)
|
)
|
||||||
|
from vllm.platforms import current_platform
|
||||||
from vllm.third_party.flash_linear_attention.ops.l2norm import l2norm_fwd
|
from vllm.third_party.flash_linear_attention.ops.l2norm import l2norm_fwd
|
||||||
|
|
||||||
DEVICE = "cuda"
|
DEVICE = current_platform.device_type
|
||||||
|
|
||||||
|
pytestmark = pytest.mark.skipif(
|
||||||
|
not (current_platform.is_cuda_alike() or current_platform.is_xpu()),
|
||||||
|
reason="The KDA kernels require a CUDA-alike or XPU device.",
|
||||||
|
)
|
||||||
|
|
||||||
# The AMD and NVIDIA copies of the KDA kernels are vendored separately and are
|
# The AMD and NVIDIA copies of the KDA kernels are vendored separately and are
|
||||||
# free to diverge, so the shared-semantics tests below run against both.
|
# free to diverge, so the shared-semantics tests below run against both.
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ def gather_initial_states(
|
|||||||
) -> torch.Tensor:
|
) -> torch.Tensor:
|
||||||
"""Gather dense state rows, replacing uninitialized rows with zeros."""
|
"""Gather dense state rows, replacing uninitialized rows with zeros."""
|
||||||
assert state.ndim >= 2
|
assert state.ndim >= 2
|
||||||
assert state.is_cuda
|
assert state.is_cuda or state.is_xpu
|
||||||
assert indices.ndim == 1 and has_initial_state.ndim == 1
|
assert indices.ndim == 1 and has_initial_state.ndim == 1
|
||||||
assert indices.shape == has_initial_state.shape
|
assert indices.shape == has_initial_state.shape
|
||||||
assert indices.device == state.device
|
assert indices.device == state.device
|
||||||
|
|||||||
Reference in New Issue
Block a user