[Misc] Getting and passing ray runtime_env to workers (#22040)

Signed-off-by: Rui Qiao <ruisearch42@gmail.com>
This commit is contained in:
Rui Qiao
2025-08-01 23:54:40 -07:00
committed by GitHub
parent d3a6f2120b
commit 4ac8437352
6 changed files with 77 additions and 13 deletions
+1 -11
View File
@@ -72,6 +72,7 @@ from typing_extensions import Never, ParamSpec, TypeIs, assert_never
import vllm.envs as envs
from vllm.logger import enable_trace_function_call, init_logger
from vllm.ray.lazy_utils import is_in_ray_actor
if TYPE_CHECKING:
from argparse import Namespace
@@ -2835,17 +2836,6 @@ def zmq_socket_ctx(
ctx.destroy(linger=linger)
def is_in_ray_actor():
"""Check if we are in a Ray actor."""
try:
import ray
return (ray.is_initialized()
and ray.get_runtime_context().get_actor_id() is not None)
except ImportError:
return False
def _maybe_force_spawn():
"""Check if we need to force the use of the `spawn` multiprocessing start
method.