[CI] Remove VLLM_TEST_CLEAN_GPU_MEMORY to avoid environment variable pollution that causes unnecessary GPU detection, thereby slowing down test case execution. (#3446)
Signed-off-by: wangyu <410167048@qq.com> Signed-off-by: [Your Name] <your.email@example.com> Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
1 parent
77480215f5
commit
26d481fc84
54 files changed
+54
-156
No files matched your search
+2
-21
@@ -16,11 +16,6 @@ from contextlib import contextmanager
|
||||
import torch
|
||||
|
||||
|
||||
def run_forced_gpu_cleanup_round() -> None:
|
||||
run_pre_test_cleanup(enable_force=True)
|
||||
run_post_test_cleanup(enable_force=True)
|
||||
|
||||
|
||||
def get_physical_device_indices(devices):
|
||||
visible_devices = os.environ.get("CUDA_VISIBLE_DEVICES")
|
||||
if visible_devices is None:
|
||||
@@ -232,16 +227,7 @@ def _print_gpu_processes() -> None:
|
||||
print("=" * 80)
|
||||
|
||||
|
||||
_SKIPPED_GPU_CLEANUP_MSG = (
|
||||
"\nSkipping GPU memory cleanup check (typically: instance already up; no check needed between tests)\n"
|
||||
)
|
||||
|
||||
|
||||
def run_pre_test_cleanup(enable_force: bool = False) -> None:
|
||||
if os.getenv("VLLM_TEST_CLEAN_GPU_MEMORY", "0") != "1" and not enable_force:
|
||||
print(_SKIPPED_GPU_CLEANUP_MSG)
|
||||
return
|
||||
|
||||
def run_pre_test_cleanup() -> None:
|
||||
print("Pre-test GPU status:")
|
||||
|
||||
num_gpus = torch.accelerator.device_count()
|
||||
@@ -255,11 +241,7 @@ def run_pre_test_cleanup(enable_force: bool = False) -> None:
|
||||
print(f"Pre-test cleanup note: {e}")
|
||||
|
||||
|
||||
def run_post_test_cleanup(enable_force: bool = False) -> None:
|
||||
if os.getenv("VLLM_TEST_CLEAN_GPU_MEMORY", "0") != "1" and not enable_force:
|
||||
print(_SKIPPED_GPU_CLEANUP_MSG)
|
||||
return
|
||||
|
||||
def run_post_test_cleanup() -> None:
|
||||
if torch.cuda.is_available():
|
||||
gc.collect()
|
||||
torch.accelerator.empty_cache()
|
||||
@@ -318,6 +300,5 @@ __all__ = [
|
||||
"get_physical_device_indices",
|
||||
"run_post_test_cleanup",
|
||||
"run_pre_test_cleanup",
|
||||
"run_forced_gpu_cleanup_round",
|
||||
"wait_for_gpu_memory_to_clear",
|
||||
]
|
||||
Reference in new issue
Block a user