def get_local_size() -> int:
    """
    Returns:
        The size of the per-machine process group,
        i.e. the number of processes per machine.
    """
    if not dist.is_available():
        return 1
    if not dist.is_initialized():
        return 1
    return dist.get_world_size(group=_LOCAL_PROCESS_GROUP)

    Returns:
        The size of the per-machine process group,
        i.e. the number of processes per machine.
    
video_chat_with_MOSS/models/grit_src/third_party/CenterNet2/detectron2/utils/comm.py