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 (or self.slice_placement_groups[slice_index].ready() when pg_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=True and 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.