o
    ci                     @   sx   d dl mZ d dlmZ d dlmZ edddee fddZedddee fd	d
Z	edddefddZ
dS )    )Optional)TPUAcceleratorManager)	PublicAPIalpha)	stabilityreturnc                  C   s   t  } | dkr
d} | S )z
    Return the name of the TPU pod that the worker is a part of.

    Returns:
        The name of the TPU pod. Returns None if not part of a TPU pod.
     N)r   get_current_node_tpu_name)tpu_name r   M/home/ubuntu/.local/lib/python3.10/site-packages/ray/util/accelerators/tpu.pyget_current_pod_name   s   r   c                   C      t  S )z
    Count the number of workers associated with the TPU pod that the worker belongs to.

    Returns:
        The total number of workers in the TPU pod. Returns None if the worker is not
        part of a TPU pod.
    )r   "get_num_workers_in_current_tpu_podr   r   r   r   get_current_pod_worker_count   s   	r   )stablityc                   C   r   )z
    Return the number of TPU chips on the node.
    Returns:
        The total number of chips on the TPU node. Returns 0 if none are found.
    )r   !get_current_node_num_acceleratorsr   r   r   r   get_num_tpu_chips_on_node    s   r   N)typingr   ray._private.acceleratorsr   ray.util.annotationsr   strr   intr   r   r   r   r   r   <module>   s    