release_head_pgs#
- SlicePlacementGroup.release_head_pgs(slice_index: int | None = None) None[source]#
Remove all internal head placement groups or a specific slice’s head placement group.
The head PGs exist only to atomically claim a TPU slice’s label during the race window between slice selection and worker-PG construction. Once the worker PG’s bundles are scheduled, the worker PG holds the TPU resources on every host in the slice and the head PGs are redundant.
Callers should invoke this idempotent call after
self.slice_placement_group.ready()resolves successfully (orself.slice_placement_groups[slice_index].ready()whenpg_per_slice=True).- Parameters:
slice_index – The index of the slice whose head PG should be released. If None, all head PGs are released. If
pg_per_slice=Trueand slices may become ready independently, it is recommended to release them by index as they become ready.
DeveloperAPI: This API may change across minor Ray releases.