Ë
    ÄÓ^jÎ  ã                   óÒ  — d dl Z d dlmc mZ 	 d„ Zd„ Zd„ Zd„ Zd„ Z	de j                  ded	ed
ee   def
d„Zdee j                     ded	ed
ee   def
d„Zde j                  dee   dz  dee   dz  d	ed
ee   defd„Zde j                  de j                  fd„Zde j                  ded	efd„Zde j                  ded	efd„Zdee   dee   dee   dee j                     def
d„Zy)é    Nc                 ó„   — t        j                  ||«      }t        j                  j                  j                  | ||«      S ©N)Úc10dÚ$_resolve_group_name_by_ranks_and_tagÚtorchÚopsÚ_c10d_functionalÚ	broadcast)ÚinputÚsrcÚtagÚranksÚ
group_sizeÚ
group_names         úy/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/torch/distributed/_functional_collectives_impl.pyÚ
_broadcastr      s:   € Ü×:Ñ:¸5À#ÓF€JÜ�9‰9×%Ñ%×/Ñ/ØØØóð ó    c                 ó„   — t        j                  ||«      }t        j                  j                  j                  | ||«      S r   )r   r   r   r   r	   Ú
all_reduce©r   Ú	reduce_opr   r   r   r   s         r   Ú_all_reducer      s:   € Ü×:Ñ:¸5À#ÓF€JÜ�9‰9×%Ñ%×0Ñ0ØØØóð r   c                 ó„   — t        j                  ||«      }t        j                  j                  j                  | ||«      S r   )r   r   r   r   r	   Úall_reduce_coalesced©Úinputsr   r   r   r   r   s         r   Ú_all_reduce_coalescedr      s:   € Ü×:Ñ:¸5À#ÓF€JÜ�9‰9×%Ñ%×:Ñ:ØØØóð r   c                 ó„   — t        j                  ||«      }t        j                  j                  j                  | ||«      S r   )r   r   r   r   r	   Úall_gather_into_tensor©r   r   r   r   r   s        r   Ú_all_gather_into_tensorr!   (   s:   € Ü×:Ñ:¸5À#ÓF€JÜ�9‰9×%Ñ%×<Ñ<ØØØóð r   c                 ó„   — t        j                  ||«      }t        j                  j                  j                  | ||«      S r   )r   r   r   r   r	   Ú all_gather_into_tensor_coalescedr    s        r   Ú!_all_gather_into_tensor_coalescedr$   1   s:   € Ü×:Ñ:¸5À#ÓF€JÜ�9‰9×%Ñ%×FÑFØØØóð r   r   r   r   r   r   c                 ó†   — t        j                  ||«      }t        j                  j                  j                  | |||«      S r   )r   r   r   r   r	   Úreduce_scatter_tensorr   s         r   Ú_reduce_scatter_tensorr'   :   s?   € ô ×:Ñ:¸5À#ÓF€JÜ�9‰9×%Ñ%×;Ñ;ØØØØó	ð r   r   c                 ó†   — t        j                  ||«      }t        j                  j                  j                  | |||«      S r   )r   r   r   r   r	   Úreduce_scatter_tensor_coalescedr   s         r   Ú _reduce_scatter_tensor_coalescedr*   J   s?   € ô ×:Ñ:¸5À#ÓF€JÜ�9‰9×%Ñ%×EÑEØØØØó	ð r   Úoutput_split_sizesÚinput_split_sizesc                 óÜ   — |�|€'|€|�t        d«      ‚| j                  d   |z  g|z  }|}t        j                  ||«      }t        j
                  j                  j                  | |||«      S )Nz^output_split_sizes and input_split_sizes must either be specified together or both set to Noner   )ÚAssertionErrorÚshaper   r   r   r   r	   Úall_to_all_single)r   r+   r,   r   r   r   r   s          r   Ú_all_to_all_singler1   Z   sŒ   € ð Ð!Ð%6Ð%>Ø"Ð*Ð/@Ð/HÜ ð9óð ð $Ÿk™k¨!™n°
Ñ:Ð;¸jÑHÐØ.Ðä×:Ñ:¸5À#ÓF€JÜ�9‰9×%Ñ%×7Ñ7ØØØØó	ð r   ÚtensorÚreturnc                 óT   — t         j                  j                  j                  | «      S r   )r   r   r	   Úwait_tensor)r2   s    r   Ú_wait_tensorr6   t   s   € Ü�9‰9×%Ñ%×1Ñ1°&Ó9Ð9r   Údstc                 óZ   — t         j                  j                  j                  | |||«      S r   )r   r   r	   Úisend)r2   r7   r   r   s       r   Ú_isendr:   x   ó#   € Ü�9‰9×%Ñ%×+Ñ+¨F°C¸¸jÓIÐIr   r   c                 óZ   — t         j                  j                  j                  | |||«      S r   )r   r   r	   Úirecv)r2   r   r   r   s       r   Ú_irecvr>   |   r;   r   Úop_listÚ	peer_listÚtag_listÚtensorsr   c                 ó\   — t         j                  j                  j                  | ||||«      S r   )r   r   r	   Úbatch_p2p_ops)r?   r@   rA   rB   r   s        r   Ú_batch_p2p_opsrE   €   s,   € ô �9‰9×%Ñ%×3Ñ3Ø�˜H g¨zóð r   )r   Ú"torch.distributed.distributed_c10dÚdistributedÚdistributed_c10dr   r   r   r   r!   r$   ÚTensorÚstrÚlistÚintr'   r*   r1   r6   r:   r>   rE   © r   r   ú<module>rN      s§  ðó ß 1Ð 1ðòòòòòðØ�<‰<ðàðð 
ðð �‰9ð	ð
 óð Ø�—‘Ñðàðð 
ðð �‰9ð	ð
 óð Ø�<‰<ðà˜S™	 DÑ(ðð ˜C‘y 4Ñ'ðð 
ð	ð
 �‰9ðð óð4:˜Ÿ™ð :¨%¯,©,ó :ðJ�5—<‘<ð J cð J°ó JðJ�5—<‘<ð J cð J°ó Jð	Ø�#‰Yð	à�C‰yð	ð �3‰ið	ð �%—,‘,Ñð		ð
 ô	r   