+
    &j                         ^ RI t ^ RIt^ RIHt ^ RIt. ROt^ tR tR t	R t
R tR R ltR]RR3R	 ltR^ ]RR3R
R/R R llltRR R lltRR R llt]RR3R R lltR# )    N)Sequencec                 z   \        \        P                  R 4      '       g   \        P                  ! R^R7       R# \        4       pV  Fp  pVP                  '       d    R# VP                  4       '       g    R# VP                  '       g    R# VP                  4       pW19   d    R# VP                  V4       Kr  	  R# )_nccl_all_reducez)PyTorch is not compiled with NCCL support
stacklevelFT)hasattrtorch_Cwarningswarnset	is_sparseis_contiguousis_cuda
get_deviceadd)tensorsdevicestensordevices   &   g/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/torch/cuda/nccl.pyis_availabler      s    588/00AaPeG##%%~~~""$F      c                     \         P                  P                  4       p V ^ ,	          pV ^,	          R,          pV R,          p\         P                  P                  4       P	                  R4      pVR8X  d   WV3# WW43# )a  
Returns the version of the NCCL.


This function returns a tuple containing the major, minor, and patch version numbers of the NCCL.
The suffix is also included in the tuple if a version suffix exists.
Returns:
    tuple: The version information of the NCCL.
i  zutf-8 )r	   r
   _nccl_version_nccl_version_suffixdecode)vermajorminorpatchsuffixs        r   versionr$   #   sp     ((
 
 
"C2IEBY%E%KEXX**,33G<F|e$$e,,r   c                  >    \         P                  P                  4       # N)r	   r
   _nccl_unique_id r   r   	unique_idr)   8   s    88##%%r   c                 B    \         P                  P                  WV4      # r&   )r	   r
   _nccl_init_rank)	num_ranksuidranks   &&&r   	init_rankr/   <   s    88##ID99r   c                |    V ^8  d   QhR\         P                  \        \         P                  ,          ,          RR/# )   inputsreturnN)r	   Tensorr   )formats   "r   __annotate__r6   @   s0     D D0F!F D4 Dr   c                     \        V \        P                  P                  4      '       d!   \        V \        P
                  4      '       d   \        R 4      hR# )z(Inputs should be a collection of tensorsN)
isinstancecollectionsabc	Containerr	   r4   	TypeError)r2   s   &r   _check_sequence_typer=   @   sA    fkoo7788J= = BCC=r   c                     \        V 4       Vf   T p\        V4       \        P                  P                  WW#V4       R # r&   )r=   r	   r
   r   r2   outputsopstreamscommss   &&&&&r   
all_reducerD   G   s2     !	HHfrEBr   r@   c                t   V ^8  d   QhR\         \        P                  ,          R\        P                  \         \        P                  ,          ,          R,          R\        R\        R\         \        P                  P
                  ,          R,          R\         \        P                  ,          R,          RR/# )	r1   r2   outputNrootrA   rB   r@   r3   )r   r	   r4   intcudaStream)r5   s   "r   r6   r6   Q   s     (E (EU\\"(ELL8ELL11D8(E (E 		(E
 ejj''(4/(E ell#d*(E 
(Er   c                   \        V 4       Ve6   Ve   \        R4      h\        P                  ! R\        ^R7       Wb,          pM~\        V\        P                  4      '       gQ   \        V\        P                  P                  4      '       d'   \        P                  ! R\        ^R7       W,          pMVf	   W,          MTp\        P                  P                  WW#WE4       R # )Nz'output' and 'outputs' can not be both specified. 'outputs' is deprecated in favor of 'output', taking in a single output tensor. The signature of reduce is: reduce(inputs, output=None, root=0, op=SUM, streams=None, comms=None).z`nccl.reduce` with an output tensor list is deprecated. Please specify a single output tensor with argument 'output' instead instead.r   z\nccl.reduce with an output tensor list is deprecated. Please specify a single output tensor.)r=   
ValueErrorr   r   FutureWarningr8   r	   r4   r9   r:   r   r
   _nccl_reduce)r2   rF   rG   rA   rB   rC   r@   _outputs   &&&&&&$ r   reducerP   Q   s      Y  MM`	 mG--*((3 3 	5		
 ,"(.&,f	HH&4WDr   c                ^    V ^8  d   QhR\         \        P                  ,          R\        RR/# )r1   r2   rG   r3   Nr   r	   r4   rH   )r5   s   "r   r6   r6   |   s-     ; ;U\\";*-;	;r   c                 \    \        V 4       \        P                  P                  WW#4       R # r&   )r=   r	   r
   _nccl_broadcast)r2   rG   rB   rC   s   &&&&r   	broadcastrU   |   s       	HHV7:r   c                    V ^8  d   QhR\         \        P                  ,          R\         \        P                  ,          RR/# )r1   r2   r@   r3   N)r   r	   r4   )r5   s   "r   r6   r6      s8     ? ?U\\"?ell#?
 
?r   c                 r    \        V 4       \        V4       \        P                  P                  WW#4       R # r&   )r=   r	   r
   _nccl_all_gather)r2   r@   rB   rC   s   &&&&r   
all_gatherrY      s(      !	HHfw>r   c                    V ^8  d   QhR\         \        P                  ,          R\         \        P                  ,          R\        RR/# )r1   r2   r@   rA   r3   NrR   )r5   s   "r   r6   r6      sH     	G 	GU\\"	Gell#	G 		G 
	Gr   c                 t    \        V 4       \        V4       \        P                  P                  WW#V4       R # r&   )r=   r	   r
   _nccl_reduce_scatterr?   s   &&&&&r   reduce_scatterr]      s*      !	HH!!&2Fr   )rD   rP   rU   rY   r]   )r   NN)NN)r9   r   collections.abcr   
torch.cudar	   __all__SUMr   r$   r)   r/   r=   rD   rP   rU   rY   r]   r(   r   r   <module>rb      s      $  P*-*&:D  $T C <@26
(E .2(E (EV;? 
	G 	Gr   