o
    }oi                     @   s.   d dl mZ d dlZdee defddZdS )    )OptionalNrankreturnc                 C   s@   t  }| du r
dS t| tr|| kS td|  dt|  d)z
    Check if the current MPI rank matches the specified rank.

    Args:
        rank (Optional[int]): The rank to check against.

    Returns:
        bool: True if the current rank matches the specified rank or if rank is None.
    NTzInvalid rank argument z	 of type .)tensorrt_llmmpi_rank
isinstanceint
ValueErrortype)r   current_rank r   M/home/ubuntu/.local/lib/python3.10/site-packages/nemo/export/trt_llm/utils.pyis_rank   s   

r   )typingr   r   r	   boolr   r   r   r   r   <module>   s   