[Core][TPU] Add per_slice_pgs paramater to SlicePlacementGroup - #64072
Conversation
|
cc: @spencer-p |
There was a problem hiding this comment.
Code Review
This pull request introduces the per_slice_pgs option to slice_placement_group, allowing users to create individual placement groups per TPU slice instead of a single placement group across all slices. It also updates the cleanup logic and adds unit tests for this new feature. The review comments point out two critical issues: first, a potential resource leak if an exception occurs during slice reservation because partially created placement groups are not yet tracked in self._managed_pgs; second, a potential IndexError when accessing placement_group after shutdown() has cleared self._managed_pgs.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
3114bf2 to
7b831ff
Compare
|
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. |
|
not stale, just needs review |
e552ddc to
6723b7b
Compare
Signed-off-by: Ryan O'Leary <ryanaoleary@google.com> Fix release_head_pgs for per-slice mode Fix tests, allow dispatch to target specific slices, and free all head pgs Signed-off-by: Ryan O'Leary <ryanaoleary@google.com>
6723b7b to
621faa3
Compare
andrewsykim
left a comment
There was a problem hiding this comment.
Very minor nits on naming, feel free to ignore
Signed-off-by: Ryan O'Leary <ryanaoleary@google.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b2fd409. Configure here.
Signed-off-by: Ryan O'Leary <ryanaoleary@google.com>
|
cc: @andrewsykim some changes made in 660450d after approval to fix a cursor comment, otherwise I think this is good to merge |
Signed-off-by: Ryan O'Leary <113500783+ryanaoleary@users.noreply.github.com>

Description
Currently
SlicePlacementGroupaccepts anum_slicesparameter - atomically reserving that many slices- and returns a single PG handle spanning all the Ray nodes across thosenum_slicesslices. This works well for multi-slice training or inference where the MEGASCALE backend it utilized to perform collectives across all the TPU hosts.However, for other use-cases like RL or disaggregated serving it'd be useful for users to be able to reserve multiple TPU slices, but utilize the individual slices at their discretion for different workloads. This PR introduced a
per_slice_pgsthat when set exposes aper_slice_placement_groupsproperty.per_slice_placement_groupsis a list of placement group handles where each PG reserves 1 TPU slice.Related issues
#64071
Additional information