From 7571a4a7e5e87c85fd9f84ead184182cd4ff8a9a Mon Sep 17 00:00:00 2001 From: Jee Jee Li Date: Thu, 10 Jul 2025 17:57:19 +0800 Subject: [PATCH] [CI/Build] Fix Basic Models Test (#20728) Signed-off-by: Jee Jee Li --- tests/models/test_initialization.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/models/test_initialization.py b/tests/models/test_initialization.py index 25bc96bf3..76726c0c8 100644 --- a/tests/models/test_initialization.py +++ b/tests/models/test_initialization.py @@ -12,11 +12,20 @@ from vllm.utils import GiB_bytes from vllm.v1.core.kv_cache_utils import get_kv_cache_config from vllm.v1.engine.core import EngineCore as V1EngineCore +from ..utils import create_new_process_for_each_test from .registry import HF_EXAMPLE_MODELS @pytest.mark.parametrize("model_arch", HF_EXAMPLE_MODELS.get_supported_archs()) +@create_new_process_for_each_test() def test_can_initialize(model_arch: str, monkeypatch: pytest.MonkeyPatch): + """The reason for using create_new_process_for_each_test is to avoid + the WARNING: + "We must use the 'spawn' multiprocessing start method. Overriding + VLLM_WORKER_MULTIPROC_METHOD to 'spawn'." + The spawn process causes the _initialize_kv_caches_v1 function below to + become ineffective. + """ model_info = HF_EXAMPLE_MODELS.get_hf_info(model_arch) model_info.check_available_online(on_fail="skip") model_info.check_transformers_version(on_fail="skip")