[XPU][Rebase v0.22] Fix for 0.22 rebase (#4059)

Signed-off-by: Chendi Xue <chendi.xue@intel.com>
This commit is contained in:
Chendi.Xue authored and GitHub committed 2026-06-02 10:16:44 +08:00
1 parent bc794e625f
commit 2a2033df02
3 files changed
+9 -4

No files matched your search

+6 -2
View File
@@ -21,8 +21,10 @@ def cuda_marks(*, res: str, num_cards: int):
return marks
test_distributed = pytest.mark.distributed_cuda(num_cards=num_cards)
if not current_platform.is_cuda():
return marks + [test_distributed]
test_skipif = pytest.mark.skipif(
not current_platform.is_cuda() or (current_platform.device_count() < num_cards),
current_platform.device_count() < num_cards,
reason=f"Need at least {num_cards} CUDA GPUs to run the test.",
)
return marks + [test_distributed, test_skipif]
@@ -52,8 +54,10 @@ def xpu_marks(*, res: str, num_cards: int):
return marks
test_distributed = pytest.mark.distributed_xpu(num_cards=num_cards)
if not current_platform.is_xpu():
return marks + [test_distributed]
test_skipif = pytest.mark.skipif(
not current_platform.is_xpu() or (current_platform.device_count() < num_cards),
current_platform.device_count() < num_cards,
reason=f"Need at least {num_cards} XPUs to run the test.",
)
return marks + [test_distributed, test_skipif]