
    Ph                        d dl Z d dlZd dlmZ d dlZd dlZd dlZdefdZ e       r"ej                  j                         s ed      ej                  j                  Zej                  j                  Zej                  j                   Zej                  j$                  Z e       rd dlmZmZmZmZmZmZmZmZmZmZm Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z- dde.fdZ/ej`                  d	k7  rd d
lm1Z1m2Z2 ddl3 ddl3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z: ddl;m;Z;m<Z<m=Z= ddl>m?Z?  e,        y G d d      Z@e@ej                  d   _        y)    N)Enumreturnc                  6    t        t        j                  d      S )a  
    Return ``True`` if the distributed package is available.

    Otherwise,
    ``torch.distributed`` does not expose any other APIs. Currently,
    ``torch.distributed`` is available on Linux, MacOS and Windows. Set
    ``USE_DISTRIBUTED=1`` to enable it when building PyTorch from source.
    Currently, the default value is ``USE_DISTRIBUTED=1`` for Linux and Windows,
    ``USE_DISTRIBUTED=0`` for MacOS.
    
_c10d_init)hasattrtorch_C     eC:\Users\daisl\Desktop\realtime-object-detection\venv\Lib\site-packages\torch/distributed/__init__.pyis_availabler   	   s     588\**r   z&Failed to initialize torch.distributed)Store	FileStoreTCPStoreProcessGroupBackendPrefixStoreReducerLoggerBuiltinCommHookType
GradBucketWork_DEFAULT_FIRST_BUCKET_BYTES_register_comm_hook_register_builtin_comm_hook_broadcast_coalesced"_compute_bucket_assignment_by_size_verify_params_across_processes_test_python_store
DebugLevelget_debug_levelset_debug_levelset_debug_level_from_env_make_nccl_premul_sumrankc                    t               | k(  rd}t        t        j                  t        j
                        r$t        j                  }t        d      t        _        	 t        d|  d       |4t        j                  j                          |t        _        t                yt                y# |*t        j                  j                          |t        _        w w xY w)a  
        Set a breakpoint, but only on a single rank.  All other ranks will wait for you to be
        done with the breakpoint before continuing.  This calls ``breakpoint()`` under the
        hood, so you can customize it using the normal facilities, e.g., ``PYTHONBREAKPOINT``
        environment variable.

        Args:
            rank (int): Which rank to break on.  Default: ``0``
        Nr   zS
!!! ATTENTION !!!

Type 'up' to get to the frame that called dist.breakpoint(rank=z)
)header)
get_rank
isinstancesysstdinioTextIOWrapperopen
breakpointclosebarrier)r%   	old_stdins     r   r/   r/   ;   s     : I#))R%5%56II	 G	*VVZU[[^`
 (IIOO% )CI		 (IIOO% )CI )s   B. ..Cwin32)	HashStore_round_robin_process_groups   )*)_all_gather_base_reduce_scatter_base_create_process_group_wrapper_rank_not_in_group_coalescing_manager_CoalescingManager_get_process_group_name)
rendezvous_create_store_from_optionsregister_rendezvous_handler)_remote_devicec                       e Zd Zy)_ProcessGroupStubN)__name__
__module____qualname__r
   r   r   rD   rD      s    r   rD   ztorch.distributed)r   )Bosr*   enumr   pdbr,   r   boolr   r	   r   RuntimeError
_DistError	DistError_DistBackendErrorDistBackendError_DistNetworkErrorDistNetworkError_DistStoreErrorDistStoreErrortorch._C._distributed_c10dr   r   r   r   r   _Backendr   r   r   r   r   r   _Workr   r   r   r   r   r   r   r    r!   r"   r#   r$   intr/   platformr4   r5   distributed_c10dr8   r9   r:   r;   r<   r=   r>   r?   r@   rA   remote_devicerB   rD   modulesr
   r   r   <module>r]      s   	 
  
 	 +d + >%((--/
?
@@ HH	88-- 88-- ))>      4 : ||w	

 $    . 4ECKK#$1r   