[Chore] Separate out vllm.utils.async_utils (#26913)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
Cyrus Leung
2025-10-15 15:33:00 +00:00
committed by GitHub
parent 136a17fe6e
commit 828523ad8e
17 changed files with 364 additions and 354 deletions
+7 -2
View File
@@ -20,12 +20,11 @@ from vllm.platforms import current_platform
from vllm.ray.ray_env import get_env_vars_to_copy
from vllm.sequence import ExecuteModelRequest
from vllm.utils import (
_run_task_with_lock,
get_distributed_init_method,
get_ip,
get_open_port,
)
from vllm.utils.func import make_async
from vllm.utils.async_utils import make_async
from vllm.v1.outputs import SamplerOutput
if ray is not None:
@@ -748,3 +747,9 @@ class RayDistributedExecutor(DistributedExecutorBase):
# Assume that the Ray workers are healthy.
# TODO: check the health of the Ray workers
return
async def _run_task_with_lock(task: Callable, lock: asyncio.Lock, *args, **kwargs):
"""Utility function to run async task in a lock"""
async with lock:
return await task(*args, **kwargs)