
    ȅi                     X   % S SK r S SKrS SKrS SKrS SKJr  S SKr\ R                  " \5      r	S\
4S jr\" 5       (       a'  \R                  R                  5       (       d  \" S5      e\R                  R                  r\R                  R"                  r\R                  R&                  r\R                  R*                  r\R                  R.                  r\" 5       (       a  S SKJrJrJrJrJrJrJ r J!r!J"r"J#r#J$r%J&r&J'r'J(r(J)r)J*r*J+r+J,r,J-r-J.r.J/r/J0r0J1r1J2r2J3r4  S r50 r6\7\8\Rr                  4   \:S'   SS	\8S
\84S jjr;\Rx                  S:w  a  S SKJ=r=  SSK>J?r?J@r@  SSKA7  SSKAJBrBJCrCJDrDJErEJFrFJGrGJHrHJIrIJJrJ  SSKKJLrL  SSKMJNrNJOrOJMrM  \0" 5         g " S S5      rP\P\R                  S   l-        g)    N)	timedeltareturnc                  6    [        [        R                  S5      $ )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     T/home/james-whalen/.local/lib/python3.13/site-packages/torch/distributed/__init__.pyis_availabler      s     588\**r   z&Failed to initialize torch.distributed)_broadcast_coalesced"_compute_bucket_assignment_by_size_ControlCollectives_DEFAULT_FIRST_BUCKET_BYTES_make_nccl_premul_sum_register_builtin_comm_hook_register_comm_hook_StoreCollectives_test_python_store_verify_params_across_processesBackendBuiltinCommHookType
DebugLevel	FileStoreget_debug_level
GradBucketLoggerPrefixStoreProcessGroupReducerset_debug_levelset_debug_level_from_envStoreTCPStoreWorkc                  J   ^ SSK m " U4S jSTR                  5      n U " 5       $ )zm
Supports using PDB from inside a multiprocessing child process.

Usage:
_make_distributed_pdb().set_trace()
r   Nc                   "   > \ rS rSrU 4S jrSrg)._make_distributed_pdb.<locals>._DistributedPdbN   c                    > [         R                  n [        S5       [         l        TR                  R                  " U /UQ70 UD6  S S S 5        U[         l        g ! , (       d  f       N= f! U[         l        f = f)Nz
/dev/stdin)sysstdinopenPdbinteraction)selfargskwargs_stdinpdbs       r   r0   :_make_distributed_pdb.<locals>._DistributedPdb.interactionO   sZ    'l+sy++DB4B6B , !'CI ,+ !'CIs"   A- *AA- 
A*&A- -A:r
   N)__name__
__module____qualname____firstlineno__r0   __static_attributes__)r5   s   r   _DistributedPdbr)   N   s    ' 'r   r<   )r5   r/   )r<   r5   s    @r   _make_distributed_pdbr=   C   s#     		'cgg 	'   r   _breakpoint_cacherankskipc                 h   US:  ae  [        [        [        R                  " 5       5      5      n[        R                  US5      S-   nU[        U'   XA::  a  [        R                  SU5        gUb\  [        R                  R                  R                   H4  n[        R                  R                  R                  [        US9U5        M6     [        5       U :X  a/  [        5       nUR!                  SU  S35        UR#                  5         [        R$                  R'                  5       n[        R$                  R)                  5       n[        R$                  R+                  S5         [-        5         [        R$                  R+                  U5        Ag! [        R$                  R+                  U5        Af = f)	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.

Args:
    rank (int): Which rank to break on.  Default: ``0``
    skip (int): Skip the first ``skip`` calls to this breakpoint. Default: ``0``.
r      zSkip the breakpoint, counter=%dN)secondszS
!!! ATTENTION !!!

Type 'up' to get to the frame that called dist.breakpoint(rank=z)
F)hashstr	traceback
format_excr>   getlogwarningr   distributeddistributed_c10d_pg_map_set_pg_timeoutr   get_rankr=   message	set_tracer	   _meta_in_tls_dispatch_include_DisableTorchDispatch!_set_meta_in_tls_dispatch_includebarrier)	r?   r@   	timeout_skeycountergroupr5   meta_in_tlsguards	            r   
breakpointr\   [   sU    !8s9//123C'++C3a7G%,c"=wG  **;;CC!!22BBi0% D
 :')CKKRRVQWWZ\ MMO hh<<>..02259	IHH66{C HH66{Cs   $
F "F1win32)	HashStorerB   )
DeviceMeshinit_device_mesh)*)	_all_gather_base_coalescing_manager_CoalescingManager_create_process_group_wrapper_get_process_group_name_rank_not_in_group_reduce_scatter_base_time_estimatorget_node_local_rank)_remote_device)_create_store_from_optionsregister_rendezvous_handler
rendezvousc                       \ rS rSrSrg)_ProcessGroupStub   r
   N)r7   r8   r9   r:   r;   r
   r   r   rp   rp      s    r   rp   ztorch.distributed)r   r   i  )Rloggingr,   rF   typingdatetimer   r   	getLoggerr7   rI   boolr   r	   r   RuntimeError
_DistError	DistError_DistBackendErrorDistBackendError_DistNetworkErrorDistNetworkError_DistStoreErrorDistStoreError_DistQueueEmptyErrorQueueEmptyErrortorch._C._distributed_c10dr   r   r   r   r   r   r   r   r   r   r   _Backendr   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   _Workr=   r>   dictintAny__annotations__r\   platformr^   device_meshr_   r`   rL   rb   rc   rd   re   rf   rg   rh   ri   rj   remote_devicerk   rn   rl   rm   rp   modulesr
   r   r   <module>r      sf    
     !+d + >>%((--//
?
@@ HH	88-- 88-- ))((//>>      8!, 02tCO,1( ( (T ||w89
 $
 
 
 .    5FCKK#$1r   