Skip to content

Commit

Permalink
FIX-#0000: fix xgboost tests with ray>2.6.0
Browse files Browse the repository at this point in the history
Signed-off-by: Anatoly Myachev <[email protected]>
  • Loading branch information
anmyachev committed Jul 28, 2023
1 parent 9c332a3 commit 9b6d3e6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions modin/experimental/xgboost/xgboost_ray.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,17 @@ def create_actors(num_actors):
List of pairs (ip, actor).
"""
num_cpus_per_actor = _get_cpus_per_actor(num_actors)
# starting from ray 2.6 there is a new field: 'node:__internal_head__'
# example:
# >>> ray.cluster_resources()
# {'object_store_memory': 1036438732.0, 'memory': 2072877467.0, 'node:127.0.0.1': 1.0, 'CPU': 8.0, 'node:__internal_head__': 1.0}
node_ips = [
key for key in ray.cluster_resources().keys() if key.startswith("node:")
key
for key in ray.cluster_resources().keys()
if key.startswith("node:") and "__internal_head__" not in key
]
num_actors_per_node = num_actors // len(node_ips)

num_actors_per_node = max(num_actors // len(node_ips), 1)

Check warning on line 281 in modin/experimental/xgboost/xgboost_ray.py

View check run for this annotation

Codecov / codecov/patch

modin/experimental/xgboost/xgboost_ray.py#L281

Added line #L281 was not covered by tests
actors_ips = [ip for ip in node_ips for _ in range(num_actors_per_node)]

actors = [
Expand Down

0 comments on commit 9b6d3e6

Please sign in to comment.