Repository navigation
[core] Skip placement group resource parsing when updating existing available resources - #66318
Conversation
0622202 to
2e7cb44
Compare
There was a problem hiding this comment.
Code Review
This pull request refactors the resource allocation logic in NodeResourceInstanceSet::TryAllocate to optimize lookups and handle implicit resources. However, the implementation incorrectly assumes that mixed resource demands (such as 1.5 GPUs) are invalid, splitting the allocation into mutually exclusive integer and fractional branches. This introduces a critical regression where mixed requests always fail, which also led to modifying several unit tests to use integer demands instead of fractional ones. To resolve this, the allocation logic should be updated to allow mixed demands by falling through to fractional allocation after allocating full instances, and the corresponding unit tests should be reverted to their original state.
2e7cb44 to
e6d5e7e
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit e6d5e7e. Configure here.
Yicheng-Lu-llll
left a comment
There was a problem hiding this comment.
I suspect the major time we spend is regex(ParsePgFormattedResource) not vector copying. could you do some experiments to very that? if regex is the major cost, If, we could just skip the parse when the key is already there.
place and undoing on failure feels fragile.
Signed-off-by: dancingactor <s990346@gmail.com>
bab3d94 to
621b3f5
Compare
|
After verifying, your suspicion makes perfect sense. The biggest cost is regex(ParsePgFormattedResource) not vector copying, so I've gone with the
|
|
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. |
Yicheng-Lu-llll
left a comment
There was a problem hiding this comment.
Thanks! left some nits, would be great to also update the pr body.
Signed-off-by: dancingactor <s990346@gmail.com>
Signed-off-by: dancingactor <s990346@gmail.com>
|
Updated the PR description. Thanks for review! |

Description
This PR skips placement group resource parsing when updating existing available resources.
Since this updating logic is going to be used in global scheduling (selecting a node within the cluster to assign a task) and local allocation in the upcoming PR #65871, this critical path needs to be optimized.
Performance Test
The optimization is 1.7×–24× faster on the alloc/free paths:
Related PR
Related to #65871