mirror of
https://github.com/wassname/ray.git
synced 2026-07-23 13:10:11 +08:00
[autoscaler] Flag flip for resource_demand_scheduler should take into account queue (#11615)
This commit is contained in:
+11
-1
@@ -12,6 +12,8 @@ from ray.autoscaler._private.autoscaler import StandardAutoscaler
|
||||
from ray.autoscaler._private.commands import teardown_cluster
|
||||
from ray.autoscaler._private.constants import AUTOSCALER_UPDATE_INTERVAL_S
|
||||
from ray.autoscaler._private.load_metrics import LoadMetrics
|
||||
from ray.autoscaler._private.constants import \
|
||||
AUTOSCALER_MAX_RESOURCE_DEMAND_VECTOR_SIZE
|
||||
import ray.gcs_utils
|
||||
import ray.utils
|
||||
import ray.ray_constants as ray_constants
|
||||
@@ -56,9 +58,17 @@ def parse_resource_demands(resource_load_by_shape):
|
||||
backlog_queue = waiting_bundles
|
||||
for _ in range(resource_demand_pb.backlog_size):
|
||||
backlog_queue.append(request_shape)
|
||||
if len(waiting_bundles+infeasible_bundles) > \
|
||||
AUTOSCALER_MAX_RESOURCE_DEMAND_VECTOR_SIZE:
|
||||
break
|
||||
except Exception:
|
||||
logger.exception("Failed to parse resource demands.")
|
||||
return waiting_bundles, infeasible_bundles
|
||||
|
||||
# Bound the total number of bundles to 2xMAX_RESOURCE_DEMAND_VECTOR_SIZE.
|
||||
# This guarantees the resource demand scheduler bin packing algorithm takes
|
||||
# a reasonable amount of time to run.
|
||||
return waiting_bundles[:AUTOSCALER_MAX_RESOURCE_DEMAND_VECTOR_SIZE], \
|
||||
infeasible_bundles[:AUTOSCALER_MAX_RESOURCE_DEMAND_VECTOR_SIZE]
|
||||
|
||||
|
||||
class Monitor:
|
||||
|
||||
Reference in New Issue
Block a user