Parallel stage initialization (admission + SH/EX device locks) (Worker refactor 1/N) (#5224)
Signed-off-by: Taichang Zhou <tzhouam@connect.ust.hk> Signed-off-by: tzhouam <tzhouam@connect.ust.hk> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5d7fdf9350
commit
142151fef5
15 files changed
+1888
-194
No files matched your search
@@ -170,36 +170,6 @@ def _print_device_processes() -> None:
|
||||
print("=" * 80)
|
||||
|
||||
|
||||
def _cleanup_stale_device_locks() -> None:
|
||||
"""Remove stale device-initialization lock files whose recorded PID is dead.
|
||||
|
||||
Lock files at ``/tmp/vllm_omni_device_*_init.lock`` may persist after a
|
||||
crashed / killed test run and block subsequent orchestrator startups.
|
||||
"""
|
||||
import glob as _glob
|
||||
|
||||
for lock_file in _glob.glob("/tmp/vllm_omni_device_*_init.lock"):
|
||||
try:
|
||||
with open(lock_file) as fh:
|
||||
content = fh.read().strip()
|
||||
if not content:
|
||||
continue
|
||||
pid = int(content)
|
||||
except (OSError, ValueError):
|
||||
continue
|
||||
|
||||
try:
|
||||
os.kill(pid, 0)
|
||||
except ProcessLookupError:
|
||||
print(f" Removing stale device lock {lock_file} (PID {pid} is dead)")
|
||||
try:
|
||||
os.unlink(lock_file)
|
||||
except OSError:
|
||||
pass
|
||||
except PermissionError:
|
||||
pass
|
||||
|
||||
|
||||
def cleanup_test_environment(*, shutdown_ray: bool = False) -> None:
|
||||
"""Tear down distributed state and reset device memory for tests."""
|
||||
from vllm import envs
|
||||
@@ -224,8 +194,6 @@ def cleanup_test_environment(*, shutdown_ray: bool = False) -> None:
|
||||
ray.shutdown()
|
||||
|
||||
print("Pre-test device status:")
|
||||
_cleanup_stale_device_locks()
|
||||
|
||||
num_devices = current_omni_platform.device_count()
|
||||
if num_devices > 0:
|
||||
try:
|
||||
|
||||
Reference in new issue
Block a user