From 5f016ff72dd108cff9b1ab1a705481aeda57086a Mon Sep 17 00:00:00 2001 From: Antoni Baum Date: Sun, 11 Dec 2022 20:20:09 -0800 Subject: [PATCH] Add special case in `_get_tune_resources` (#250) * Adds special case in _get_tune_resources Signed-off-by: Antoni Baum * Lint Signed-off-by: Antoni Baum Signed-off-by: Antoni Baum --- xgboost_ray/tune.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xgboost_ray/tune.py b/xgboost_ray/tune.py index 72833435..efde3773 100644 --- a/xgboost_ray/tune.py +++ b/xgboost_ray/tune.py @@ -122,6 +122,11 @@ def _get_tune_resources(num_actors: int, cpus_per_actor: int, bundles = [head_bundle] + child_bundles placement_options = placement_options or {} placement_options.setdefault("strategy", "PACK") + # Special case, same as in + # ray.air.ScalingConfig.as_placement_group_factory + # TODO remove after Ray 2.3 is out + if placement_options.get("_max_cpu_fraction_per_node", None) is None: + placement_options.pop("_max_cpu_fraction_per_node", None) placement_group_factory = PlacementGroupFactory( bundles, **placement_options)