SubslicePlacementGroup#
- class ray.util.tpu.SubslicePlacementGroup(placement_group: PlacementGroup, parent_topology: str, subslice_topology: str, subslice_index: int, slice_name: str, num_hosts: int, chips_per_host: int, bundle_resources: Dict[str, float], head_placement_groups: List[PlacementGroup] | None = None, bundle_label_selectors: List[Dict[str, str]] | None = None)[source]#
Bases:
objectA handle to a placement group reservation for a TPU subslice.
Reserves a contiguous subset of workers within a larger TPU slice. The selected subset is guaranteed to be a valid slice and TPU topology; i.e. the workers are fully connected with ICI.
Example for a 4x4 v6e slice (4 workers, 4 TPU chips each):
Worker grid: (0,0) --- (1,0) | | (0,1) --- (1,1) Valid 2x4 subslices: Subslice 0: workers (0,0) and (0,1) (left column) Subslice 1: workers (1,0) and (1,1) (right column)- Parameters:
placement_group – The underlying Ray PlacementGroup.
parent_topology – Full parent TPU topology (e.g. “4x4”).
subslice_topology – Subslice TPU topology (e.g. “2x4”).
subslice_index – Index of this subslice within the parent.
slice_name – Name of the physical TPU slice.
num_hosts – Number of hosts (VM workers) in this subslice.
chips_per_host – TPU chips available per host.
bundle_resources – Resources per PG bundle.
head_placement_groups – Internal head PGs for cleanup.
bundle_label_selectors – Label selectors used per bundle when creating the PG.
PublicAPI (alpha): This API is in alpha and may change before becoming stable.
Methods
Remove all internal head placement groups.
Remove the worker placement group and all head PGs.
Attributes
Label selectors used for each bundle when creating the PG.
Resources assigned to each bundle.
TPU chips available per host.
Internal head PGs used for slice reservation.
Number of hosts (VM workers) in this subslice.
The full parent TPU topology.
The underlying PlacementGroup object.
The name of the physical TPU slice.
The subslice index within the parent.
The requested subslice TPU topology.