[ROCm][CI] Select CPU platform for native no-GPU jobs (#49515)

Signed-off-by: Andreas Karatzas <Andreas.Karatzas@amd.com>
This commit is contained in:
Andreas Karatzas
2026-08-14 23:30:56 -07:00
committed by GitHub
parent acb0f1dcdb
commit 44fc57d7b7
3 changed files with 60 additions and 15 deletions
+23 -1
View File
@@ -2,7 +2,9 @@
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
from unittest.mock import mock_open, patch
from vllm.platforms import _is_amd_zen_cpu
import pytest
from vllm.platforms import _is_amd_zen_cpu, resolve_current_platform_cls_qualname
def test_is_amd_zen_cpu_detects_amd_with_avx512():
@@ -35,3 +37,23 @@ def test_is_amd_zen_cpu_returns_false_for_intel_with_avx512():
def test_is_amd_zen_cpu_returns_false_when_cpuinfo_missing():
with patch("os.path.exists", return_value=False):
assert not _is_amd_zen_cpu()
def test_cpu_target_selects_cpu_platform_from_non_cpu_wheel(
monkeypatch: pytest.MonkeyPatch,
):
monkeypatch.setenv("VLLM_TARGET_DEVICE", "cpu")
with (
patch("vllm.platforms.vllm_version_matches_substr") as version_matches,
patch("vllm.platforms._is_amd_zen_cpu", return_value=False),
patch("vllm.platforms.rocm_platform_plugin") as rocm_plugin,
):
assert (
resolve_current_platform_cls_qualname() == "vllm.platforms.cpu.CpuPlatform"
)
# An explicit target does not depend on the installed wheel's version
# suffix or host accelerators (a native CI job can reuse a ROCm wheel).
version_matches.assert_not_called()
rocm_plugin.assert_not_called()