get_worker_addrs#

SlicePlacementGroup.get_worker_addrs(slice_index: int = 0) → List[str | None][source]#

Returns the IP addresses of all worker hosts in a given slice.

Parameters:

slice_index (int) – The 0-based index of the TPU slice.

Returns:

A list of IP address strings (or None for unscheduled bundles) ordered by host rank (0 to hosts_per_slice - 1).

Raises:
  • ValueError – If slice_index is out of range.

  • RuntimeError – If this SlicePlacementGroup has been shut down.

Return type:

List[str | None]