get_num_ready_tpu_slices#

ray.util.tpu.get_num_ready_tpu_slices(topology: str, accelerator_type: str, tpu_resource_per_chip: int | None = None) int[source]#

Checks the cluster state to determine how many full TPU slices of the specified topology are currently intact and available.

Parameters:
  • topology – The TPU topology string (e.g. “2x4”).

  • accelerator_type – The accelerator type string (e.g. “TPU-V6E”).

  • tpu_resource_per_chip – The number of logical TPU resources per physical chip. This scales the total logical resources expected per slice.

Returns:

The integer count of fully ready and available TPU slices.

PublicAPI (alpha): This API is in alpha and may change before becoming stable.