o
    ÚÜÓhk
  ã                   @   sF  d dl Z d dlZd dlmZ d dlZdefdd„Zeƒ r%ej ¡ s%e	dƒ‚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% ej&dkrkd d	lm'Z'm(Z( d
dl)T d
dl)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/ d
dl0m0Z0m1Z1m2Z2 d
dl3m4Z4 e$ƒ  dS G dd„ dƒZ5e5ej6d _dS )é    N)ÚEnumÚreturnc                   C   s   t tjdƒS )a›  
    Returns ``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© r   r   úP/var/www/html/ai/venv/lib/python3.10/site-packages/torch/distributed/__init__.pyÚis_available   s   	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Úwin32)Ú	HashStoreÚ_round_robin_process_groupsé   )Ú*)Ú_all_gather_baseÚ_reduce_scatter_baseÚ_create_process_group_wrapperÚ_rank_not_in_groupÚ_coalescing_managerÚ_CoalescingManager)Ú
rendezvousÚ_create_store_from_optionsÚregister_rendezvous_handler)Ú_remote_devicec                   @   s   e Zd ZdS )Ú_ProcessGroupStubN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r	   r1   Z   s    r1   ztorch.distributed)7ÚosÚsysÚenumr   r   Úboolr
   r   r   ÚRuntimeErrorÚ_DistBackendErrorÚDistBackendErrorÚ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!   Úplatformr#   r$   Údistributed_c10dr'   r(   r)   r*   r+   r,   r-   r.   r/   Úremote_devicer0   r1   Úmodulesr   r   r   r	   Ú<module>   s&    d
 	
	