From 5de1e9b9cdd5ab0688f657f465d67350f54d1ec9 Mon Sep 17 00:00:00 2001 From: Mimi Liao Date: Mon, 25 Nov 2024 12:39:35 -0600 Subject: [PATCH] skip placed bundle when request resource Signed-off-by: Mimi Liao --- .../ray/autoscaler/_private/resource_demand_scheduler.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python/ray/autoscaler/_private/resource_demand_scheduler.py b/python/ray/autoscaler/_private/resource_demand_scheduler.py index 1db20be69c62..6084b6ae1468 100644 --- a/python/ray/autoscaler/_private/resource_demand_scheduler.py +++ b/python/ray/autoscaler/_private/resource_demand_scheduler.py @@ -985,8 +985,14 @@ def placement_groups_to_resource_demands( """ resource_demand_vector = [] unconverted = [] + shapes = [] for placement_group in pending_placement_groups: - shapes = [dict(bundle.unit_resources) for bundle in placement_group.bundles] + # Skip **placed** bundle (which has node id associated with it). + for bundle in placement_group.bundles: + if bundle.node_id: + continue + shapes.append(dict(bundle.unit_resources)) + if ( placement_group.strategy == PlacementStrategy.PACK or placement_group.strategy == PlacementStrategy.SPREAD