Fix v1 supported oracle for worker-cls and worker-extension-cls (#15324)

Signed-off-by: youkaichao <youkaichao@gmail.com>
Co-authored-by: youkaichao <youkaichao@gmail.com>
This commit is contained in:
hijkzzz
2025-03-23 10:23:35 +08:00
committed by GitHub
parent a827aa815d
commit 0661cfef7a
3 changed files with 7 additions and 12 deletions

View File

@@ -2170,6 +2170,11 @@ def _maybe_force_spawn():
if cuda_is_initialized():
reason = "CUDA is initialized"
elif is_in_ray_actor():
# even if we choose to spawn, we need to pass the ray address
# to the subprocess so that it knows how to connect to the ray cluster.
# env vars are inherited by subprocesses, even if we use spawn.
import ray
os.environ["RAY_ADDRESS"] = ray.get_runtime_context().gcs_address
reason = "In a Ray actor and can only be spawned"
if reason is not None: