def get_dist_info(group=None) -> Tuple[int, int]:
    """Get distributed information of the given process group.

    Note:
        Calling ``get_dist_info`` in non-distributed environment will return
        (0, 1).

    Args:
        group (ProcessGroup, optional): The process group to work on. If None,
            the default process group will be used. Defaults to None.

    Returns:
        tuple[int, int]: Return a tuple containing the ``rank`` and
        ``world_size``.
    """
    world_size = get_world_size(group)
    rank = get_rank(group)
    return rank, world_size
Get distributed information of the given process group.

Note:
Calling ``get_dist_info`` in non-distributed environment will return
(0, 1).

Args:
group (ProcessGroup, optional): The process group to work on. If None,
the default process group will be used. Defaults to None.

Returns:
tuple[int, int]: Return a tuple containing the ``rank`` and
``world_size``.
projects/llava_sam2/evaluation/utils/dist.py