[CI] Allowlist-shrink batch 1: wire 17 root-level tests + drop 5 stale watermarking entries into misc.yaml (#58055)

Signed-off-by: Turner Jabbour <doubleujabbour@gmail.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Turner Jabbour
2026-09-27 22:23:46 -07:00
committed by GitHub
co-authored by Claude Sonnet 5
parent af7f9488c2
commit 2407f405b5
8 changed files with 131 additions and 59 deletions
+2 -3
View File
@@ -43,6 +43,7 @@ def prompt_embeds_processor():
logits_processors=None,
is_diffusion=False,
return_sampling_mask=False,
supports_multimodal_inputs=False,
)
model_config.get_vocab_size.return_value = 32
model_config.try_get_generation_config.return_value = {}
@@ -53,9 +54,7 @@ def prompt_embeds_processor():
)
renderer = Mock(tokenizer=None)
renderer.get_eos_token_id.return_value = None
registry = Mock()
registry.supports_multimodal_inputs.return_value = False
return InputProcessor(config, renderer, mm_registry=registry)
return InputProcessor(config, renderer, mm_registry=Mock())
@pytest.mark.parametrize("mask_len", [0, 1, 2, 4])
+49 -14
View File
@@ -10,10 +10,13 @@ from vllm.triton_utils import importing as triton_importing
from vllm.triton_utils.importing import TritonLanguagePlaceholder, TritonPlaceholder
def _has_triton_for_backends(**drivers: bool) -> bool:
def _has_triton_for_backends(*, vllm_version: str = "0.0.0", **drivers: bool) -> bool:
"""Re-evaluate ``HAS_TRITON`` against a synthetic ``triton.backends`` map.
``drivers`` maps backend name to whether its driver reports itself active.
``vllm_version`` selects the build type: importing.py takes its Triton-CPU
branch only when "cpu" is in the installed vLLM version, so pin it rather
than depending on the real install (the CPU CI image is a "+cpu" build).
"""
backends = {}
for name, is_active in drivers.items():
@@ -34,6 +37,7 @@ def _has_triton_for_backends(**drivers: bool) -> bool:
with (
mock.patch.dict(sys.modules, patched_modules),
mock.patch.dict("os.environ", {}, clear=True),
mock.patch("importlib.metadata.version", return_value=vllm_version),
):
return importlib.reload(triton_importing).HAS_TRITON
finally:
@@ -129,19 +133,50 @@ def test_cpu_backend_alone_disables_triton():
assert _has_triton_for_backends(cpu=True) is False
def test_cpu_build_with_cpu_backend_keeps_triton():
assert _has_triton_for_backends(vllm_version="0.0.0+cpu", cpu=True) is True
def test_cpu_build_without_cpu_backend_disables_triton():
assert _has_triton_for_backends(vllm_version="0.0.0+cpu", amd=True) is False
def test_no_triton_fallback():
# clear existing triton modules
sys.modules.pop("triton", None)
sys.modules.pop("triton.language", None)
sys.modules.pop("vllm.triton_utils", None)
sys.modules.pop("vllm.triton_utils.importing", None)
# Save the real modules so they can be put back afterward - popping them
# (rather than mock.patch.dict alone) is what forces vllm.triton_utils to
# be freshly, unmemoized re-imported under the "triton is absent"
# condition below.
saved_modules = {
name: sys.modules.get(name)
for name in (
"triton",
"triton.language",
"vllm.triton_utils",
"vllm.triton_utils.importing",
)
}
for name in saved_modules:
sys.modules.pop(name, None)
# mock triton not being installed
with mock.patch.dict(sys.modules, {"triton": None}):
from vllm.triton_utils import HAS_TRITON, tl, triton
try:
# mock triton not being installed
with mock.patch.dict(sys.modules, {"triton": None}):
from vllm.triton_utils import HAS_TRITON, tl, triton
assert HAS_TRITON is False
assert triton.__class__.__name__ == "TritonPlaceholder"
assert triton.language.__class__.__name__ == "TritonLanguagePlaceholder"
assert tl.__class__.__name__ == "TritonLanguagePlaceholder"
assert tl.constexpr(2**31 - 1) == 2**31 - 1
assert HAS_TRITON is False
assert triton.__class__.__name__ == "TritonPlaceholder"
assert triton.language.__class__.__name__ == "TritonLanguagePlaceholder"
assert tl.__class__.__name__ == "TritonLanguagePlaceholder"
assert tl.constexpr(2**31 - 1) == 2**31 - 1
finally:
# The pops above are outside mock.patch.dict's scope, so exiting the
# `with` restores "triton" to absent, not to the real module - unlike
# _has_triton_for_backends above, nothing here puts it back. Left
# alone, every subsequent import of vllm.triton_utils in this process
# (including other test files, and other tests' cleanup fixtures that
# need real triton) would get this fake, HAS_TRITON=False module.
for name, module in saved_modules.items():
if module is not None:
sys.modules[name] = module
else:
sys.modules.pop(name, None)
+4 -1
View File
@@ -13,7 +13,10 @@ def test_version_is_defined():
def test_version_tuple():
assert len(version.__version_tuple__) in (3, 4, 5)
# (major, minor, patch) plus optional pre-release tag, dev-distance, and
# git-hash components - setuptools_scm can emit any combination of them,
# e.g. 6 when a dev build sits on top of an rc-tagged commit.
assert len(version.__version_tuple__) >= 3
@pytest.mark.parametrize(
+28 -11
View File
@@ -13,6 +13,23 @@ from vllm.platforms import (
)
@pytest.fixture
def caplog_vllm(caplog):
"""`caplog`, but also captures vLLM's loggers.
vllm/logger.py configures the "vllm" logger with propagate=False, so
records from child loggers like "vllm.platforms" reach vLLM's own
handler but never bubble up to the root logger where plain `caplog`
listens. Attach caplog's handler directly to "vllm" to see them too.
"""
logger = logging.getLogger("vllm")
logger.addHandler(caplog.handler)
try:
yield caplog
finally:
logger.removeHandler(caplog.handler)
def test_is_amd_zen_cpu_detects_amd_with_avx512():
cpuinfo = "vendor_id: AuthenticAMD\nflags: avx avx2 avx512f avx512bw"
with (
@@ -65,7 +82,7 @@ def test_cpu_target_selects_cpu_platform_from_non_cpu_wheel(
rocm_plugin.assert_not_called()
def test_broken_zentorch_falls_back_to_cpu_platform(caplog):
def test_broken_zentorch_falls_back_to_cpu_platform(caplog_vllm):
original_import = builtins.__import__
def import_with_broken_zentorch(name, *args, **kwargs):
@@ -84,16 +101,16 @@ def test_broken_zentorch_falls_back_to_cpu_platform(caplog):
patch("vllm.platforms.vllm_version_matches_substr", return_value=True),
patch("vllm.platforms._is_amd_zen_cpu", return_value=True),
patch.object(builtins, "__import__", side_effect=import_with_broken_zentorch),
caplog.at_level(logging.DEBUG, logger="vllm.platforms"),
caplog_vllm.at_level(logging.DEBUG, logger="vllm.platforms"),
):
platform = resolve_current_platform_cls_qualname()
assert platform == "vllm.platforms.cpu.CpuPlatform"
assert "zentorch failed to import" in caplog.text
assert "OSError: incompatible shared library" in caplog.text
assert "zentorch failed to import" in caplog_vllm.text
assert "OSError: incompatible shared library" in caplog_vllm.text
def test_zentorch_failure_other_than_oserror_is_not_recovered(caplog):
def test_zentorch_failure_other_than_oserror_is_not_recovered(caplog_vllm):
original_import = builtins.__import__
def import_with_broken_zentorch(name, *args, **kwargs):
@@ -112,15 +129,15 @@ def test_zentorch_failure_other_than_oserror_is_not_recovered(caplog):
patch("vllm.platforms.vllm_version_matches_substr", return_value=True),
patch("vllm.platforms._is_amd_zen_cpu", return_value=True),
patch.object(builtins, "__import__", side_effect=import_with_broken_zentorch),
caplog.at_level(logging.DEBUG, logger="vllm.platforms"),
caplog_vllm.at_level(logging.DEBUG, logger="vllm.platforms"),
):
platform = resolve_current_platform_cls_qualname()
assert platform == "vllm.platforms.interface.UnspecifiedPlatform"
assert "RuntimeError: unknown zentorch failure" in caplog.text
assert "RuntimeError: unknown zentorch failure" in caplog_vllm.text
def test_platform_plugin_failure_is_logged(caplog):
def test_platform_plugin_failure_is_logged(caplog_vllm):
def failing_plugin():
raise RuntimeError("plugin exploded")
@@ -132,10 +149,10 @@ def test_platform_plugin_failure_is_logged(caplog):
clear=True,
),
patch("vllm.platforms.load_plugins_by_group", return_value={}),
caplog.at_level(logging.DEBUG, logger="vllm.platforms"),
caplog_vllm.at_level(logging.DEBUG, logger="vllm.platforms"),
):
platform = resolve_current_platform_cls_qualname()
assert platform == "vllm.platforms.interface.UnspecifiedPlatform"
assert "Platform plugin cpu failed during detection" in caplog.text
assert "RuntimeError: plugin exploded" in caplog.text
assert "Platform plugin cpu failed during detection" in caplog_vllm.text
assert "RuntimeError: plugin exploded" in caplog_vllm.text