Repository navigation
[Data] Optimize triple loop in default_autoscaling_coordinator.py - #61487
weimingdiit wants to merge 3 commits into
Conversation
Signed-off-by: weimingdiit <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request effectively optimizes the resource reallocation logic in default_autoscaling_coordinator.py by replacing an inefficient triple nested loop. The new implementation cleverly uses caching for bundle search positions and tracks impossible-to-allocate bundles, which should significantly reduce CPU overhead and improve autoscaler responsiveness, especially in scenarios with many identical resource requests. The logic appears sound and addresses the performance bottleneck described. I have reviewed the changes and found no issues.
slfan1989
left a comment
There was a problem hiding this comment.
@weimingdiit Thanks for the contribution!
Looks good to me with one minor comment.
Signed-off-by: weimingdiit <[email protected]>
|
This pull request has been automatically marked as stale because it has not had You can always ask for help on our discussion forum or Ray's public slack channel. If you'd like to keep this open, just leave any comment, and the stale label will be removed. |
|
Hi, @bveeramani @abrarsheikh when you have a chance, could you please take a look at this PR? |
|
@iamjustinhsu @goutamvenkat-anyscale Hi, could you please take a look at this PR? |
Description
This issue addresses a resource-allocation performance bottleneck in Ray Data autoscaling.
Previously, the coordinator used a triple nested loop when reallocating resources (requesters × requested bundles × cluster nodes). That made allocation cost grow quickly as concurrency increased, causing unnecessary CPU overhead and slower autoscaler reaction times. It was especially inefficient for repeated identical bundles, which were rescanned across nodes from the beginning each time.
Related issues
#61485