Skip to content

Commit

Permalink
Merge branch 'dev' into code-profiler-wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
matouma committed Dec 13, 2024
2 parents 204ca0d + 376ecdc commit a685684
Show file tree
Hide file tree
Showing 18 changed files with 1,964 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,7 @@ dmypy.json

# Ignore artifacts directory created by the `make save-images` target
artifacts/

*.lock

*.db
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,19 @@
from typing import Any

import ray
from ray.experimental.state.api import list_actors
from data_processing.utils import GB, UnrecoverableException
from ray.actor import ActorHandle
from ray.exceptions import RayError
from ray.experimental.state.api import list_actors
from ray.util.actor_pool import ActorPool


# This value matches the constant `RAY_MAX_LIMIT_FROM_API_SERVER` defined in the ray source code here:
# https://github.com/ray-project/ray/blob/569f7df9067c5654fb57ba7bc4792b3ba5aaa846/python/ray/util/state/common.py#L50-L53

RAY_MAX_ACTOR_LIMIT = 10000


class RayUtils:
"""
Class implementing support methods for Ray execution
Expand Down Expand Up @@ -109,11 +115,13 @@ def operator() -> ActorHandle:
time.sleep(creation_delay)
return clazz.options(**actor_options).remote(params)

cls_name = clazz.__class__.__name__.replace('ActorClass(', '').replace(')','')
cls_name = clazz.__class__.__name__.replace("ActorClass(", "").replace(")", "")
actors = [operator() for _ in range(n_actors)]
for i in range(120):
time.sleep(1)
alive = list_actors(filters=[("class_name", "=", cls_name), ("state", "=", "ALIVE")])
alive = list_actors(
filters=[("class_name", "=", cls_name), ("state", "=", "ALIVE")], limit=RAY_MAX_ACTOR_LIMIT
)
if len(actors) == len(alive):
return actors
# failed - raise an exception
Expand Down
Loading

0 comments on commit a685684

Please sign in to comment.