+
    –°³j™*  ã                   óŽ  a € R$ t#0 t ^ RIHtHt ^ RIt^ RIt^ RIt^ RI	H
t
Ht ^ RIHt ^ RIHtHtHt ^RIHt / s] ^ k RR	.tR
 tR R ltR R ltR R ltR%R R lltR tR tR R ltR R ltR R ltR&R R llt ]3R R llt!]3R R  llt"]! R!]!4       ]! R"]"4       ]! R#]4       R#   ] d   t]! R4      ]hRtAii ; i)'é    )ÚurlparseÚ
urlunparsezEurllib cannot be found, urlparse from python2 is no longer supported.N)ÚCallableÚIterator)Ú	timedelta)Ú	FileStoreÚStoreÚTCPStore)Údefault_pg_timeoutÚregister_rendezvous_handlerÚ
rendezvousc                óL   € V \         9   d   \        RV  R24      hV\         V &   R# )a�  
Register a new rendezvous handler.

Before we can run collective algorithms, participating processes
need to find each other and exchange information to be able to
communicate. We call this process rendezvous.

The outcome of the rendezvous process is a triplet containing a
shared key/value store, the rank of the process, and the total
number of participating processes.

If none of the bundled rendezvous methods apply to your execution
environment you can opt to register your own rendezvous handler.
Pick a unique name and use the URL scheme to identify it when
calling the `rendezvous()` function.

Args:
    scheme (str): URL scheme to identify your rendezvous handler.
    handler (function): Handler that is invoked when the
        `rendezvous()` function is called with a URL that uses
        the corresponding scheme. It must be a generator function
        that yields the triplet.
zRendezvous handler for z:// already registeredN)Ú_rendezvous_handlersÚRuntimeError)ÚschemeÚhandlers   &&Ú]/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torch/distributed/rendezvous.pyr   r      s.   € ð2 Ô%Ô%ÜÐ4°V°HÐ<RÐSÓTÐTØ#*Ô˜Ó ó    c                óR   € V ^8„  d   QhR\         R\        \         \         3,          /# )é   ÚqueryÚreturn)ÚstrÚdict)Úformats   "r   Ú__annotate__r   9   s"   € ÷ ñ œ#ð ¤$¤s¬C x¥.ñ r   c                 óŽ   € R  \        RV P                  R4      4       4        Uu/ uF  pV^ ,          V^,          bK  	  up# u upi )c              3   óB   "  € T F  qP                  R 4      x € K  	  R# 5i)Ú=N)Úsplit)Ú.0Úpairs   & r   Ú	<genexpr>Ú!_query_to_dict.<locals>.<genexpr><   s   é € ÐPÑ1O¨—Z‘Z —_�_Ó1Oùs   ‚NÚ&)Úfilterr    )r   r"   s   & r   Ú_query_to_dictr'   9   sL   € ñ Q´¸¸e¿k¹kÈ#Ó>NÔ1OÔPóáPˆDð 	ˆQ���a•ÒÙPñð ùò s   ¥Ac                óR   € V ^8„  d   QhR\         \        \        3,          R\        /# )r   Ú
query_dictr   )r   r   Úbool)r   s   "r   r   r   @   s&   € ÷ Pñ P¬t´C¼°H­~ð PÄ$ñ Pr   c                 óø   € \         P                  R 8X  d4   V P                  R\        P                  P                  RR4      4      R8H  # V P                  R\        P                  P                  RR4      4      R8H  # )Úwin32Ú	use_libuvÚ	USE_LIBUVÚ0Ú1)ÚsysÚplatformÚgetÚosÚenviron)r)   s   &r   Ú_get_use_libuv_from_query_dictr6   @   s[   € ô ‡|�|�wÔà�~‰~˜k¬2¯:©:¯>©>¸+ÀsÓ+KÓLÐPSÑSÐSØ�>‰>˜+¤r§z¡z§~¡~°kÀ3Ó'GÓHÈCÑOÐOr   c                óJ   € V ^8„  d   QhR\         R\        R\        R,          /# )r   ÚurlÚrankÚworld_size_optN©r   Úint)r   s   "r   r   r   I   s%   € ÷ >ñ >œCð >¤sð >¼CÀ$½Jñ >r   c                 ó   € \        V 4      pVfg   RpVP                  R8X  dS   \        \        P                  P                  RV4      4      p\        \        P                  P                  RV4      4      pMTpVR8w  g   VR8w  g   Vfµ   \        VP                  4      pRV9   g   RV9   d   \        RV  R24      hVR8w  d   \        V4      VR&   VR8w  g   Vf   \        V4      VR&   TP                  RP                  VP                  4        UUu. uF  w  rxV R	V 2NK  	  upp4       R
7      p\        V4      p VP                  \        9  d   \        RVP                   R24      h\        VP                  ,          ! V 3/ VB # u uppi )NÚenvÚRANKÚ
WORLD_SIZEr9   Ú
world_sizez	The url: z7 has node-specific arguments(rank, world_size) already.r%   r   )r   zNo rendezvous handler for z://éÿÿÿÿ)r   r   r<   r4   r5   r3   r'   r   ÚAssertionErrorr   Ú_replaceÚjoinÚitemsr   r   r   )	r8   r9   r:   ÚkwargsÚresultrA   r)   ÚkÚvs	   &&&,     r   Ú_rendezvous_helperrK   I   so  € Ü�c‹]€FØÒØˆ
Ø�=‰=˜EÔ!Ü”r—z‘z—~‘~ f¨dÓ3Ó4ˆDäœRŸZ™ZŸ^™^¨L¸*ÓEÓFˆJøà#ˆ
Øˆr„z�Z 2Ô%¨Ò)?Ü# F§L¡LÓ1ˆ
Ø�ZÔ <°:Ô#=Ü Ø˜C˜5Ð WÐXóð ð �2Œ:Ü!$ T£ˆJ�vÑØ˜Ô˜~Ò5Ü'*¨:£ˆJ�|Ñ$Ø—‘Ø—X‘X°j×6FÑ6FÔ6HÔIÑ6H©d¨a !  A a S›zÑ6HÒIÓJÐKð !ó 
ˆô ˜Ó ˆà‡}�}Ô0Ô0ÜÐ7¸¿¹°ÀcÐJÓKÐKÜ §¡Ö.¨sÑ=°fÑ=Ð=ùó Js   ÄF
c                ó<   € V ^8„  d   QhR\         R\        R\        /# )r   r8   r9   rA   r;   )r   s   "r   r   r   h   s!   € ÷ 
?ñ 
?”Cð 
?œsð 
?´Sñ 
?r   c                 ó@  € \        V \        \        34      '       g   \        R \	        V 4       RV  24      h\        V\
        P                  4      '       g   \        RV 24      h\        V\
        P                  4      '       g   \        RV 24      h\        WV3/ VB # )z`url` must be a string. z: z`rank` must be an integer. z!`world_size` must be an integer. )Ú
isinstancer   Úbytesr   ÚtypeÚnumbersÚIntegralrK   )r8   r9   rA   rG   s   &&&,r   r   r   h   sŽ   € Ü�cœC¤˜<×(Ò(ÜÐ5´d¸3³i°[ÀÀ3À%ÐHÓIÐIä�dœG×,Ñ,×-Ò-ÜÐ8¸¸Ð?Ó@Ð@ä�j¤'×"2Ñ"2×3Ò3ÜÐ>¸z¸lÐKÓLÐLä˜c¨Ñ>°vÑ>Ð>r   c                 óN   € \        \        V P                  VR 4      4      w  p pV# ©N)ÚnextrK   Úinit_method)Úbackend_optionsr9   ÚstoreÚ_s   &&  r   Ú_create_store_from_optionsrZ   u   s'   € ÜÔ)¨/×*EÑ*EÀtÈTÓRÓS�K€Eˆ1ˆaØ€Lr   c                 ó&   € \        R V ,           4      # )z+Error initializing torch.distributed using )Ú
ValueError©Úmsgs   &r   Ú_rendezvous_errorr_   z   s   € ÜÐCÀcÕIÓJÐJr   c                ó$   € V ^8„  d   QhR\         /# )r   r8   ©r   )r   s   "r   r   r   ~   s   € ÷ Nñ N¤#ñ Nr   c              +   ó4  "  € R  p\        V 4      pVP                  p\        P                  R8X  dd   ^ RIpVP
                  VP                  ,           pVP                  P                  V4      pV'       d    \        P                  P                  V4      pV'       g	   V! R4      h\        VP                  4      pRV9  d	   V! R4      hRV9  d	   V! R4      h\        VR,          4      p\        VR,          4      p	\        WI4      p
W¨V	3x € \        R4      h5i)	c                 ó&   € \        R V ,           4      # )zfile:// rendezvous: ©r_   r]   s   &r   Ú_errorÚ(_file_rendezvous_handler.<locals>._error   s   € Ü Ð!7¸#Õ!=Ó>Ð>r   r,   Nzpath missingr9   úrank parameter missingrA   úworld size parameter missingz3Unable to perform rerendezvous using file:// method)r   Úpathr1   r2   Úurllib.requestÚnetlocÚrequestÚurl2pathnamer4   Únormpathr'   r   r<   r   r   )r8   rG   re   rH   ri   ÚurllibÚ	full_pathr)   r9   rA   rX   s   &,         r   Ú_file_rendezvous_handlerrq   ~   sï   é € ò?ô �c‹]€FØ�;‰;€DÜ
‡|�|�wÔÛà—M‘M F§K¡KÕ/ˆ	Ø�~‰~×*Ñ*¨9Ó5ˆßä—7‘7×#Ñ# DÓ)ˆDçÙ�^Ó$Ð$Ü §¡Ó-€JØ�ZÔÙÐ-Ó.Ð.Ø˜:Ô%ÙÐ3Ó4Ð4äˆz˜&Õ!Ó"€DÜ�Z Õ-Ó.€JÜ�dÓ'€EØ˜
Ð
#Ò#ô ÐLÓ
MÐMùs   ‚A3DÁ6&DÂA;Dc                ó$   € V ^8„  d   QhR\         /# ©r   r   ©r*   )r   s   "r   r   r   ž   s   € ÷ Mñ M¤tñ Mr   c                  óZ   € \         P                  P                  R R4      \        R4      8H  # )ÚTORCHELASTIC_USE_AGENT_STORENT)r4   r5   r3   r   © r   r   Ú_torchelastic_use_agent_storerx   ž   s!   € Ü�:‰:�>‰>Ð8¸$Ó?Ä3ÀtÃ9ÑLÐLr   c                ó$   € V ^8„  d   QhR\         /# rs   rt   )r   s   "r   r   r   ¢   s   € ÷ ñ ¬4ñ r   c                óÐ   € \        4       ;'       dV    \        P                  P                  R4      V 8H  ;'       d,    \        P                  P                  R4      \	        V4      8H  # )a�  Whether the elastic agent is the one serving a store at ``hostname:port``.

``TORCHELASTIC_USE_AGENT_STORE`` only promises a server at the agent's own
``MASTER_ADDR:MASTER_PORT``, which the agent exports alongside it. Honoring
the flag for any other endpoint makes every rank a client of a store nobody
hosts. ``TCPStore``'s C++ constructor applies the same address check before
it forgives a failed server bind.
ÚMASTER_ADDRÚMASTER_PORT)rx   r4   r5   r3   r   )ÚhostnameÚports   &&r   Ú_agent_store_servesr   ¢   sQ   € ô 	&Ó'÷ 	7ð 	7Ü�J‰J�N‰N˜=Ó)¨XÑ5÷	7ð 	7ä�J‰J�N‰N˜=Ó)¬S°«YÑ6ðr   c                ó$   € V ^8„  d   QhR\         /# rs   )r	   )r   s   "r   r   r   ²   s   € ÷ -
ñ -
ä
ñ-
r   c           
     ó²   € ^ Tu;8:  d   R8  g   M \        RV R24      h\        W4      '       d   \        V VVRVR7      # V^ 8H  p\        V VVVVRVR7      # )a   
Smartly creates a c10d Store object on ``rank`` based on whether we need to reuse agent store.

The TCPStore server is assumed to be hosted
on ``hostname:port``.

By default, the TCPStore server uses the asynchronous implementation
``LibUVStoreDaemon`` which utilizes libuv.

If ``torchelastic_use_agent_store()`` is ``True`` *and* ``hostname:port`` is
the agent's own ``MASTER_ADDR:MASTER_PORT``, then it is assumed that the
agent leader (node rank 0) hosts the TCPStore server there. Hence
ALL ranks will create and return a TCPStore client (e.g. ``start_daemon=False``).

Otherwise rank 0 will host the TCPStore (with multi-tenancy) and it is
assumed that rank 0's hostname and port are correctly passed via
``hostname`` and ``port``. All non-zero ranks will create and return a
TCPStore client.
z-port must have value from 0 to 65535 but was Ú.F)Ú	host_namer~   rA   Ú	is_masterÚtimeoutT)rƒ   r~   rA   r„   r…   Úmulti_tenantr-   i   )r\   r   r
   )r}   r~   r9   rA   r…   r-   Ústart_daemons   &&&&&& r   Ú_create_c10d_storerˆ   ²   sz   € ð. �Ö�uÖÜÐHÈÈÈaÐPÓQÐQä˜8×*Ò*äØØØ!ØØô
ð 	
ð ˜q‘yˆÜØØØ!Ø"ØØØô
ð 	
r   c                ó0   € V ^8„  d   QhR\         R\        /# ©r   r8   r…   ©r   r   )r   s   "r   r   r   â   s    € ÷ Nñ NÜ	ðNÜ ñNr   c              +   ó®  "  € R  p\        V 4      pVP                  f	   V! R4      h\        VP                  4      pRV9  d	   V! R4      hRV9  d	   V! R4      h\	        VR,          4      p\	        VR,          4      p\        V4      pVP                  f   \        R4      h\        VP                  VP                  WgW4      p	W–V3x € \        R4      h5i)c                 ó&   € \        R V ,           4      # )ztcp:// rendezvous: rd   r]   s   &r   re   Ú'_tcp_rendezvous_handler.<locals>._errorå   ó   € Ü Ð!6¸Õ!<Ó=Ð=r   zport number missingr9   rg   rA   rh   zhostname cannot be Nonez3Unable to perform re-rendezvous using tcp:// method)
r   r~   r'   r   r<   r6   r}   rC   rˆ   r   )
r8   r…   rG   re   rH   r)   r9   rA   r-   rX   s
   &&,       r   Ú_tcp_rendezvous_handlerr�   â   sÕ   é € ò>ô �c‹]€FØ‡{�{ÒÙÐ*Ó+Ð+Ü §¡Ó-€JØ�ZÔÙÐ-Ó.Ð.Ø˜:Ô%ÙÐ3Ó4Ð4äˆz˜&Õ!Ó"€DÜ�Z Õ-Ó.€JÜ.¨zÓ:€Ià‡�ÒÜÐ6Ó7Ð7äØ�‰˜Ÿ™ d¸ó€Eð ˜
Ð
#Ò#ô ÐLÓ
MÐMùs   ‚CCc                ó0   € V ^8„  d   QhR\         R\        /# rŠ   r‹   )r   s   "r   r   r     s    € ÷ -Nñ -NÜ	ð-NÜ ñ-Nr   c              +   ó¢  aa"  € R  oV3R loR V3R llp\        V 4      p\        VP                  4      pRV9   d   \        VR,          4      pM\        V! R4      4      pRV9   d   \        VR,          4      pM\        V! R4      4      pV! R4      p\        V! R	4      4      p	\	        V4      p
\        W‰WgW4      pW¶V3x € \        R
4      h5i)c                 ó&   € \        R V ,           4      # )zenv:// rendezvous: rd   r]   s   &r   re   Ú'_env_rendezvous_handler.<locals>._error  r�   r   c                 ó   <€ S! R V  R24      # )zenvironment variable z expected, but not setrw   )Úvarre   s   &€r   Ú
_env_errorÚ+_env_rendezvous_handler.<locals>._env_error  s   ø€ ÙÐ-¨c¨UÐ2HÐIÓJÐJr   c                ó0   € V ^8„  d   QhR\         R\         /# )r   Úenv_varr   ra   )r   s   "r   r   Ú-_env_rendezvous_handler.<locals>.__annotate__  s   € ÷ ñ ¤3ð ¬3ñ r   c                 óh   <€ \         P                  P                  V R 4      pV'       g	   S! V 4      hV# rT   )r4   r5   r3   )rš   Úenv_valr—   s   & €r   Ú_get_env_or_raiseÚ2_env_rendezvous_handler.<locals>._get_env_or_raise  s*   ø€ Ü—*‘*—.‘. ¨$Ó/ˆßÙ˜WÓ%Ð%àˆNr   r9   r?   rA   r@   r{   r|   z3Unable to perform re-rendezvous using env:// method)r   r'   r   r<   r6   rˆ   r   )r8   r…   rG   rž   rH   r)   r9   rA   Úmaster_addrÚmaster_portr-   rX   r—   re   s   &&,         @@r   Ú_env_rendezvous_handlerr¢     sÔ   ùé € ò>õK÷ð ô �c‹]€FÜ §¡Ó-€Jð �ÔÜ�:˜fÕ%Ó&‰äÑ$ VÓ,Ó-ˆà�zÔ!Ü˜ LÕ1Ó2‰
äÑ*¨<Ó8Ó9ˆ
á# MÓ2€KÜÑ'¨Ó6Ó7€KÜ.¨zÓ:€IäØ $°Gó€Eð ˜
Ð
#Ò#ô ÐLÓ
MÐMùs   „CCÚtcpr>   Úfilec          
      ó¾   € V ^8„  d   Qh/ ^ \         9   dI   \        \        \        R\        \
        \        \        \        3,          ,          3,          3,          ;R&   # )r   .r   )Ú__conditional_annotations__r   r   r   r   Útupler	   r<   )r   s   "r   r   r      sC   € ÷ ñ ÷$ VÒ U”dœ3¤¨¬h´u¼UÄCÌ¸_Õ7MÕ.NÐ)NÕ OÐOÕPÑ Uò%r   )rB   rB   )T)$r¦   Úurllib.parser   r   ÚImportErrorÚerQ   r4   r1   Úcollections.abcr   r   Údatetimer   Útorch.distributedr   r	   r
   Ú	constantsr   r   Ú__all__r   r'   r6   rK   r   rZ   r_   rq   rx   r   rˆ   r�   r¢   r   )r¦   s   @r   Ú<module>r°      sÞ   øðôß1ó Û 	Û 
ß .Ý ç 8Ñ 8å )ð TVÐ Ó Uà(¨,Ð
7€ò+õ@õPõ>÷>
?òò
KõNõ@Mõ÷ -
ðb $6÷NðB $6÷-Nñ` ˜EÐ#:Ô ;Ù ˜EÐ#:Ô ;Ù ˜FÐ$<Ö =øða	 ô Ù
ØOóàðûðús   ‡B/ Â/CÂ6	B?Â?C