From 854c33f3801241574223644d25f80fbd735a44e5 Mon Sep 17 00:00:00 2001 From: Andreas Karatzas Date: Sun, 26 Jul 2026 22:19:55 -0500 Subject: [PATCH] [CI][ROCm] Keep global GPU memory cleanup opt-in (#49911) Signed-off-by: Andreas Karatzas --- tests/conftest.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 2c5a907e55..6cb8e260c6 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1729,13 +1729,9 @@ def disable_deepgemm_ue8m0(monkeypatch): def _should_clean_gpu_memory_between_tests() -> bool: - setting = os.getenv("VLLM_TEST_CLEAN_GPU_MEMORY") - if setting == "1": - return True - if setting == "0": - return False - # ROCm reclaims VRAM lazily; default to waiting between tests on ROCm CI. - return current_platform.is_rocm() + # This must stay opt-in: a function-scoped fixture cannot distinguish + # stale VRAM from allocations owned by longer-lived module/session fixtures. + return os.getenv("VLLM_TEST_CLEAN_GPU_MEMORY", "0") == "1" @pytest.fixture(autouse=True)