-
Notifications
You must be signed in to change notification settings - Fork 7k
Add Semi-Random Weighting to AutoScaler Node Scheduler #49983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,6 +43,8 @@ | |
| ) | ||
| from ray.core.generated.common_pb2 import PlacementStrategy | ||
|
|
||
| import random | ||
|
|
||
| logger = logging.getLogger(__name__) | ||
|
|
||
| # The minimum number of nodes to launch concurrently. | ||
|
|
@@ -786,8 +788,8 @@ def get_nodes_for( | |
| ) | ||
| break | ||
|
|
||
| utilization_scores = sorted(utilization_scores, reverse=True) | ||
| best_node_type = utilization_scores[0][1] | ||
| weights = [node_types[node_type[1]].get("max_workers", 0) for node_type in utilization_scores] | ||
| best_node_type = random.choices(utilization_scores, weights=weights, k=1)[0][1] | ||
|
||
| nodes_to_add[best_node_type] += 1 | ||
| if strict_spread: | ||
| resources = resources[1:] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the weights should be based on utilization_scores instead of max_workers: we don't want to launch a big machine for a 1 cpu task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done