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, accelerator_version: str | None = None, tpu_resource_per_chip: int | 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 (PlacementGroup) – The underlying Ray PlacementGroup.
parent_topology (str) – Full parent TPU topology (e.g. “4x4”).
subslice_topology (str) – Subslice TPU topology (e.g. “2x4”).
subslice_index (int) – Index of this subslice within the parent.
slice_name (str) – Name of the physical TPU slice.
num_hosts (int) – Number of hosts (VM workers) in this subslice.
chips_per_host (int) – TPU chips this subslice uses on each host.
bundle_resources (Dict[str, float]) – Resources per PG bundle.
head_placement_groups (List[PlacementGroup] | None) – Internal head PGs for cleanup.
bundle_label_selectors (List[Dict[str, str]] | None) – Label selectors used per bundle when creating the PG.
accelerator_version (str | None) – The TPU accelerator version (e.g. “v6e” or “v7x”).
tpu_resource_per_chip (int | None) – Logical TPU resources per physical chip.
PublicAPI (alpha): This API is in alpha and may change before becoming stable.
Methods
Returns the JAX TPU environment variables for this subslice.
Returns the PyTorch/TPU (torch_tpu) environment variables for this subslice.
Returns the IP addresses of all worker hosts in this subslice.
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 this subslice uses on each 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.