-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[core] [1/2] Topology aware scheduling public API #63479
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
Merged
MengjinYan
merged 30 commits into
ray-project:master
from
aaronscalene:aaron/pg-public-api
Jun 26, 2026
Merged
Changes from 24 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
048f2ae
styling
aaronscalene b39025b
fix
aaronscalene 1b96c6f
fix
aaronscalene 141bdaf
testing
aaronscalene 9e7d9af
format stale comments
aaronscalene ba7f43f
comment
aaronscalene b0e8f85
lint
aaronscalene 5b8979f
i
aaronscalene 972ca0e
Merge branch 'master' into aaron/pg-public-api
aaronscalene 88364be
g
aaronscalene 734fcbf
Merge branch 'aaron/pg-public-api' of github.com:aaronscalene/ray int…
aaronscalene 6d3a742
test
aaronscalene 867b20b
remove tpdemo
aaronscalene 016361c
fix
aaronscalene 7c6a2b9
fix
aaronscalene 17f8a35
fix
aaronscalene 627688d
fix
aaronscalene 0db8536
fix
aaronscalene e5afe1f
fix
aaronscalene 27cba4f
fix
aaronscalene e49ae4f
Merge branch 'master' into aaron/pg-public-api
aaronscalene dc20d13
fix
aaronscalene 1f675bb
lint
aaronscalene e60213e
m
aaronscalene dda9bab
delete
aaronscalene e8c530d
better comments
aaronscalene 093469f
fix: addressed nit comments, added validation testing
aaronlinear 2aeea5e
fix: added circular dependency comment
aaronlinear fb280df
Merge remote-tracking branch 'upstream/master' into aaron/pg-public-api
aaronlinear 7a52b43
fix: add todo for future rename
aaronlinear File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -712,6 +712,17 @@ cdef int prepare_actor_concurrency_groups( | |
| return 1 | ||
|
|
||
|
|
||
| cdef CPlacementStrategy prepare_c_strategy(c_string strategy) except *: | ||
| if strategy == b"PACK": | ||
| return PLACEMENT_STRATEGY_PACK | ||
| elif strategy == b"SPREAD": | ||
| return PLACEMENT_STRATEGY_SPREAD | ||
| elif strategy == b"STRICT_PACK": | ||
| return PLACEMENT_STRATEGY_STRICT_PACK | ||
| else: | ||
| return PLACEMENT_STRATEGY_STRICT_SPREAD | ||
|
|
||
|
|
||
| def raise_sys_exit_with_custom_error_message( | ||
| ray_terminate_msg: str, | ||
| exit_code: int = 0) -> None: | ||
|
|
@@ -3671,23 +3682,18 @@ cdef class CoreWorker: | |
| c_string strategy, | ||
| c_bool is_detached, | ||
| soft_target_node_id, | ||
| c_vector[unordered_map[c_string, c_string]] bundle_label_selector): | ||
| c_vector[unordered_map[c_string, c_string]] bundle_label_selector, | ||
| topology_strategy): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better to make the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
| cdef: | ||
| CPlacementGroupID c_placement_group_id | ||
| CPlacementStrategy c_strategy | ||
| CNodeID c_soft_target_node_id = CNodeID.Nil() | ||
| unordered_map[c_string, CPlacementStrategy] c_topology_strategy | ||
|
|
||
| if strategy == b"PACK": | ||
| c_strategy = PLACEMENT_STRATEGY_PACK | ||
| elif strategy == b"SPREAD": | ||
| c_strategy = PLACEMENT_STRATEGY_SPREAD | ||
| elif strategy == b"STRICT_PACK": | ||
| c_strategy = PLACEMENT_STRATEGY_STRICT_PACK | ||
| else: | ||
| if strategy == b"STRICT_SPREAD": | ||
| c_strategy = PLACEMENT_STRATEGY_STRICT_SPREAD | ||
| else: | ||
| raise TypeError(strategy) | ||
| c_strategy = prepare_c_strategy(strategy) | ||
|
|
||
| for label, level_strategy in topology_strategy.items(): | ||
| c_topology_strategy[label] = prepare_c_strategy(level_strategy) | ||
|
|
||
| if soft_target_node_id is not None: | ||
| c_soft_target_node_id = CNodeID.FromHex(soft_target_node_id) | ||
|
|
@@ -3702,7 +3708,8 @@ cdef class CoreWorker: | |
| bundles, | ||
| is_detached, | ||
| c_soft_target_node_id, | ||
| bundle_label_selector), | ||
| bundle_label_selector, | ||
| c_topology_strategy), | ||
| &c_placement_group_id)) | ||
|
|
||
| return PlacementGroupID(c_placement_group_id.Binary()) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.