§
    Ÿ²Åj=  ã                   óB  — d dl Z d dlmZ d dlmZ d dlmZmZ ej        fd„Z	d ej        fd„Z
d ej        fd„Zej        ej        fd„Zej        ej        fd„Zej        fd	„Zej        fd
„Zej        fd„Zddej        fd„Zej        ej        fd„Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d „ d!e¦  «        ZdS )"é    N)ÚFunction)ÚgroupÚReduceOpc                 ó:   — t                                ||| ¦  «        S )a»  
    Broadcasts the tensor to the whole group.

    ``tensor`` must have the same number of elements in all processes
    participating in the collective.

    Arguments:
        tensor (Tensor): Data to be sent if ``src`` is the rank of current
            process.
        src (int): Source rank.
        group (ProcessGroup, optional): The process group to work on.

    Returns:
        Tensor: Received tensor from the broadcast op.

    )Ú
_BroadcastÚapply)ÚtensorÚsrcr   s      úPC:\Projects\Historical\venv\Lib\site-packages\torch/distributed/nn/functional.pyÚ	broadcastr      s   € õ" ×Ò˜C ¨Ñ/Ô/Ð/ó    c                 ó:   — t                                ||| ¦  «        S )aT  
    Gathers a list of tensors in a single process.

    Arguments:
        tensor (Tensor): Input tensor.
        dst (int, optional): Destination rank (default is 0).
        group (ProcessGroup, optional): The process group to work on.

    Returns:
        tuple[Tensor]: List of appropriately-sized tensors with the gathered data.
    )Ú_Gatherr   )r	   Údstr   s      r   Úgatherr       s   € õ �=Š=˜˜e VÑ,Ô,Ð,r   c                 ó(   — t          j        ||g| ¢R Ž S )aö  
    Scatters a list of tensors to all processes in a group.

    Each process will receive exactly one tensor and store its data in the
    ``tensor`` argument.

    Arguments:
        tensors (list[Tensor]): List of tensors to scatter on the source rank.
            Receivers must pass ``None`.
        src (int, optional): Source rank (default is 0).
        group (ProcessGroup, optional): The process group to work on.

    Returns:
        Tensor: Output tensor from the scatter operation.

    )Ú_Scatterr   )Útensorsr
   r   s      r   Úscatterr   /   s   € õ" Œ>˜#˜uÐ/ wÐ/Ð/Ð/Ð/r   c                 ó<   — t                                |||| ¦  «        S )a  
    Reduces the tensor data across all machines.

    Only the process with rank ``dst`` is going to receive the final result.

    Arguments:
        tensor (Tensor): Input of the collective.
        dst (int): Destination rank.
        op (optional): One of the values from
            ``torch.distributed.ReduceOp``
            enum.  Specifies an operation used for element-wise reductions.
        group (ProcessGroup, optional): The process group to work on.

    Returns:
        Tensor: Output of the collective.

    )Ú_Reducer   )r	   r   Úopr   s       r   Úreducer   C   s   € õ$ �=Š=˜˜b %¨Ñ0Ô0Ð0r   c                 ó*   — t          j        ||| g|¢R Ž S )aõ  
    Reduces, then scatters a list of tensors to all processes in a group.

    Arguments:
        output (Tensor): Output tensor.
        input_list (list[Tensor]): List of tensors to reduce and scatter.
        op (optional): One of the values from
            ``torch.distributed.ReduceOp``
            enum.  Specifies an operation used for element-wise reductions.
        group (ProcessGroup, optional): The process group to work on.

    Returns:
        Tensor: Output of the collective.

    )Ú_Reduce_Scatterr   )ÚoutputÚ
input_listr   r   s       r   Úreduce_scatterr   X   s!   € õ  Ô   U¨FÐ@°ZÐ@Ð@Ð@Ð@r   c                 ó8   — t                                || ¦  «        S )a  
    Gathers tensors from the whole group in a list.

    Arguments:
        tensor (Tensor): Tensor to be broadcast from current process.
        group (ProcessGroup, optional): The process group to work on.

    Returns:
        tuple([Tensor]): Output of the collective.

    )Ú
_AllGatherr   )r	   r   s     r   Ú
all_gatherr!   k   s   € õ ×Ò˜E 6Ñ*Ô*Ð*r   c                 ó:   — t                                | ||¦  «        S )aâ  
    Single tensor all gather. Gathers a single tensor from all ranks, and puts them in a single output tensor.

    Args:
        output_tensor (Tensor): Output tensor. It should contain
            correctly-sized tensors to be used for output of the collective.
        input_tensor (Tensor): Tensor to be broadcast from current process.
        group (ProcessGroup, optional): The process group to work on. If None,
            the default process group will be used.

    Examples:
        >>> # All tensors below are of torch.int64 dtype.
        >>> # We have 2 process groups, 2 ranks.
        >>> # xdoctest: +SKIP("incorrect want text")
        >>> output_tensor = torch.zeros(2, dtype=torch.int64)
        >>> output_tensor
        [tensor([0, 0])] # Rank 0 and 1
        >>> tensor = torch.arange(1, dtype=torch.int64) + 1 + rank
        >>> tensor
        tensor([1]) # Rank 0
        tensor([2]) # Rank 1
        >>> dist.all_gather_base(output_tensor, tensor)
        >>> output_tensor
        tensor([1,2]) # Rank 0
        tensor([1,2]) # Rank 1

    .. warning::
        `_all_gather_base` is experimental and subject to change.
        It is the caller's responsibility to ensure the output_tensor
        is correctly sized.

    )Ú_AllGatherBaser   )Úoutput_tensorÚinput_tensorr   s      r   Ú_all_gather_baser&   z   s   € õB ×Ò ¨|¸UÑCÔCÐCr   c                 ó(   — t          j        || g|¢R Ž S )aÃ  
    Each process scatters list of input tensors to all processes in a group and return gathered list of tensors in output list.

    Arguments:
        output_tensor_list (list[Tensor]): list of tensors to gather one per rank.
        input_tensor_list (list[Tensor]): List of tensors to scatter one per rank.
        group (ProcessGroup, optional): The process group to work on.

    Returns:
        tuple([Tensor]): Output of the collective.

    )Ú	_AlltoAllr   )Úoutput_tensor_listÚinput_tensor_listr   s      r   Ú
all_to_allr+   ž   s    € õ Œ?˜5Ð"4ÐIÐ7HÐIÐIÐIÐIr   c                 ó>   — t                                || |||¦  «        S )a  
    Each process splits input tensor and then scatters the split list to all processes in a group.

    Then concatenate the received tensors from all the processes in the group and return single output tensor.

    Arguments:
        output (Tensor): Gathered concatenated output tensor.
        input (Tensor): Input tensor to scatter.
        output_split_sizes: (list[Int], optional): Output split sizes for dim 0
            if specified None or empty, dim 0 of ``output`` tensor must divide
            equally by ``world_size``.
        input_split_sizes: (list[Int], optional): Input split sizes for dim 0
            if specified None or empty, dim 0 of ``input`` tensor must divide
            equally by ``world_size``.

    Returns:
        Tensor: Output of the collective.

    )Ú_AlltoAllSingler   )r   ÚinputÚoutput_split_sizesÚinput_split_sizesr   s        r   Úall_to_all_singler1   ®   s)   € õ4 × Ò ØˆvÐ)Ð+<¸eñô ð r   c                 ó:   — t                                ||| ¦  «        S )a&  
    Reduces the tensor data across all machines in such a way that all get the final result.

    After the call the returned tensor is going to be bitwise
    identical in all processes.

    Arguments:
        tensor (Tensor): Input of the collective.
        op (optional): One of the values from
            ``torch.distributed.ReduceOp``
            enum.  Specifies an operation used for element-wise reductions.
        group (ProcessGroup, optional): The process group to work on.

    Returns:
        Tensor: Output of the collective

    )Ú
_AllReducer   )r	   r   r   s      r   Ú
all_reducer4   Í   s   € õ$ ×Ò˜B  vÑ.Ô.Ð.r   c                   ó:   — e Zd Zed„ ¦   «         Zed„ ¦   «         ZdS )r   c                 ó¬   — || _         || _        t          j        |¬¦  «        | _        |                     ¦   «         }t          j        |||¬¦  «         |S ©N©r   )r
   r   ÚdistÚget_rankÚrankÚcloner   )Úctxr
   r   r	   s       r   Úforwardz_Broadcast.forwardã   sO   € àˆŒØˆŒ	Ý”= uÐ-Ñ-Ô-ˆŒð —’‘”ˆÝŒ�v˜s¨%Ð0Ñ0Ô0Ð0Øˆr   c                 ó¶   — t                                | j        t          j        | j        |¦  «        }| j        | j        k    r|                     ¦   «          d d |fS ©N)r   r   r
   r   ÚSUMr   r;   Úzero_)r=   Úgrad_outputÚgxs      r   Úbackwardz_Broadcast.backwardî   sH   € å�]Š]˜3œ7¥H¤L°#´)¸[ÑIÔIˆØŒ7�c”hÒÐØ�HŠH‰JŒJˆJØ�d˜BÐÐr   N©Ú__name__Ú
__module__Ú__qualname__Ústaticmethodr>   rE   © r   r   r   r   â   sH   € € € € € Øðð ñ „\ðð ð ð  ñ „\ð ð  ð  r   r   c                   ó:   — e Zd Zed„ ¦   «         Zed„ ¦   «         ZdS )r   c                 óV  ‡— || _         || _        ˆfd„t          t          j        |¬¦  «        ¦  «        D ¦   «         }‰                     ¦   «         Št          j        |¬¦  «        |k    rt          j        ‰|||¬¦  «         nt          j        ‰d ||¬¦  «         t          |¦  «        S )Nc                 ó8   •— g | ]}t          j        ‰¦  «        ‘ŒS rK   )ÚtorchÚ
zeros_like)Ú.0Úir	   s     €r   ú
<listcomp>z#_Gather.forward.<locals>.<listcomp>ÿ   s1   ø€ ð 
ð 
ð 
Ø)*�EÔ˜VÑ$Ô$ð
ð 
ð 
r   r8   )	r   r   Úranger9   Úget_world_sizeÚ
contiguousr:   r   Útuple)r=   r   r   r	   Útensor_lists      ` r   r>   z_Gather.forward÷   s½   ø€ àˆŒØˆŒ	ð

ð 
ð 
ð 
Ý.3µDÔ4GÈeÐ4TÑ4TÔ4TÑ.UÔ.Uð
ñ 
ô 
ˆð ×"Ò"Ñ$Ô$ˆÝŒ=˜uÐ%Ñ%Ô%¨Ò,Ð,ÝŒK˜ ¨S¸Ð>Ñ>Ô>Ð>Ð>åŒK˜  c°Ð7Ñ7Ô7Ð7Ý�[Ñ!Ô!Ð!r   c                 óD   — dt          j        | j        | j        g|¢R Ž fz   S ©N©NN)r   r   r   r   )r=   Úgrad_outputss     r   rE   z_Gather.backward
  s(   € à�xœ~¨c¬g°s´yÐPÀ<ÐPÐPÐPÐRÑRÐRr   NrF   rK   r   r   r   r   ö   sM   € € € € € Øð"ð "ñ „\ð"ð$ ðSð Sñ „\ðSð Sð Sr   r   c                   ó:   — e Zd Zed„ ¦   «         Zed„ ¦   «         ZdS )r   c                 ó@  ‡— || _         || _        t          ˆfd„‰D ¦   «         ¦  «        sJ ‚t          j        ‰d         ¦  «        }t          j        |¬¦  «        |k    r&t          j        |t          ‰¦  «        ||¬¦  «         nt          j        |d ||¬¦  «         |S )Nc              3   óx   •K  — | ]4}|                      ¦   «         ‰d                                ¦   «         k    V — Œ5dS )r   N©Úsize)rQ   Útr   s     €r   ú	<genexpr>z#_Scatter.forward.<locals>.<genexpr>  s>   øè è € ÐBÐB°Q�1—6’6‘8”8˜w qœzŸšÑ0Ô0Ò0ÐBÐBÐBÐBÐBÐBr   r   r8   )	r
   r   ÚallrO   rP   r9   r:   r   Úlist)r=   r
   r   r   r   s      ` r   r>   z_Scatter.forward  s¦   ø€ àˆŒØˆŒ	ÝÐBÐBÐBÐB¸'ÐBÑBÔBÑBÔBÐBÐBÐBÝÔ! '¨!¤*Ñ-Ô-ˆÝŒ=˜uÐ%Ñ%Ô%¨Ò,Ð,ÝŒL˜¥ g¡¤°¸5ÐAÑAÔAÐAÐAåŒL˜  s°%Ð8Ñ8Ô8Ð8Øˆr   c                 óT   — dt                                | j        | j        |¦  «        z   S rZ   )r   r   r
   r   ©r=   rC   s     r   rE   z_Scatter.backward  s!   € à�gŸmšm¨C¬G°S´YÀÑLÔLÑLÐLr   NrF   rK   r   r   r   r     sM   € € € € € Øð	ð 	ñ „\ð	ð ðMð Mñ „\ðMð Mð Mr   r   c                   ó:   — e Zd Zed„ ¦   «         Zed„ ¦   «         ZdS )r   c                 óz   — || _         || _        |                     ¦   «         }t          j        ||||¬¦  «         |S ©N©r   r   )r
   r   r<   r9   r   )r=   r
   r   r   r	   s        r   r>   z_Reduce.forward"  s;   € àˆŒØˆŒ	Ø—’‘”ˆÝŒ�F˜C B¨eÐ4Ñ4Ô4Ð4Øˆr   c                 óV   — dt                                | j        | j        |¦  «        fz   S ©N)NNN)r   r   r
   r   rg   s     r   rE   z_Reduce.backward*  s&   € à!¥Z×%5Ò%5°c´g¸s¼yÈ+Ñ%VÔ%VÐ$XÑXÐXr   NrF   rK   r   r   r   r   !  sM   € € € € € Øðð ñ „\ðð ðYð Yñ „\ðYð Yð Yr   r   c                   ó:   — e Zd Zed„ ¦   «         Zed„ ¦   «         ZdS )r   c                 ó¸   — || _         |                     ¦   «         }t          d„ |D ¦   «         ¦  «        }t          j        |t          |¦  «        ||¬¦  «         |S )Nc              3   ó>   K  — | ]}|                      ¦   «         V — Œd S r@   ©rV   ©rQ   rb   s     r   rc   z*_Reduce_Scatter.forward.<locals>.<genexpr>5  s*   è è € Ð!LÐ!L°Q !§,¢,¡.¤.Ð!LÐ!LÐ!LÐ!LÐ!LÐ!Lr   rk   )r   rV   rW   r9   r   re   )r=   r   r   r	   r*   s        r   r>   z_Reduce_Scatter.forward0  s`   € àˆŒ	à×"Ò"Ñ$Ô$ˆÝ!Ð!LÐ!LÐ:KÐ!LÑ!LÔ!LÑLÔLÐÝÔ˜F¥DÐ):Ñ$;Ô$;ÀÈ%ÐPÑPÔPÐPØˆr   c                 óH   — dt                                | j        |¦  «        z   S rm   )r    r   r   rg   s     r   rE   z_Reduce_Scatter.backward9  s   € à!¥J×$4Ò$4°S´YÀÑ$LÔ$LÑLÐLr   NrF   rK   r   r   r   r   /  sM   € € € € € Øðð ñ „\ðð ðMð Mñ „\ðMð Mð Mr   r   c                   ó:   — e Zd Zed„ ¦   «         Zed„ ¦   «         ZdS )r    c                 óâ   ‡— ‰                      ¦   «         Š|| _        ˆfd„t          t          j        |¬¦  «        ¦  «        D ¦   «         }t          j        |‰|¬¦  «         t          |¦  «        S )Nc                 ó8   •— g | ]}t          j        ‰¦  «        ‘ŒS rK   ©rO   Ú
empty_like)rQ   Ú_r	   s     €r   rS   z&_AllGather.forward.<locals>.<listcomp>E  s1   ø€ ð 
ð 
ð 
Ø)*�EÔ˜VÑ$Ô$ð
ð 
ð 
r   r8   )rV   r   rT   r9   rU   r!   rW   )r=   r   r	   Úout_tensor_lists     ` r   r>   z_AllGather.forward?  s‚   ø€ ð ×"Ò"Ñ$Ô$ˆàˆŒ	ð
ð 
ð 
ð 
Ý.3µDÔ4GÈeÐ4TÑ4TÔ4TÑ.UÔ.Uð
ñ 
ô 
ˆõ 	Œ˜¨°uÐ=Ñ=Ô=Ð=Ý�_Ñ%Ô%Ð%r   c                 ó¨  — t          j        | j        ¬¦  «        t           j        j        u rXt          j        | j        ¬¦  «        }t          j        ||         ¦  «        }t          j	        t          j        | j        |g|¢R Ž }nLd„ |D ¦   «         }t          j	        | j        |g|¢R Ž }t          j        t          j        |¦  «        d¬¦  «        }d |fS )Nr8   c                 ó6   — g | ]}t          j        |¦  «        ‘ŒS rK   rw   )rQ   r	   s     r   rS   z'_AllGather.backward.<locals>.<listcomp>U  s#   € ÐOÐOÐO¸�5Ô+¨FÑ3Ô3ÐOÐOÐOr   r   )Údim)r9   Úget_backendr   ÚBackendÚNCCLr:   rO   rx   r   r   r   rA   r(   ÚsumÚstack)r=   r\   r;   rD   rX   Úgxss         r   rE   z_AllGather.backwardL  sÆ   € åÔ #¤)Ð,Ñ,Ô,µ´Ô0AÐAÐAÝ”= s¤yÐ1Ñ1Ô1ˆDÝÔ! ,¨tÔ"4Ñ5Ô5ˆBÝ Ô&¥x¤|°S´YÀÐRÀ\ÐRÐRÐRˆBˆBð PÐOÀ,ÐOÑOÔOˆKÝ”/ #¤)¨[ÐH¸<ÐHÐHÐHˆCÝ”�5œ; sÑ+Ô+°Ð3Ñ3Ô3ˆBØ�bˆzÐr   NrF   rK   r   r   r    r    >  sH   € € € € € Øð
&ð 
&ñ „\ð
&ð ðð ñ „\ðð ð r   r    c                   ó:   — e Zd Zed„ ¦   «         Zed„ ¦   «         ZdS )r#   c                 óf   — || _         t          j        ||                     ¦   «         |¬¦  «         |S r7   )r   r9   r&   rV   )r=   r$   r%   r   s       r   r>   z_AllGatherBase.forward\  s3   € àˆŒ	ÝÔ˜m¨\×-DÒ-DÑ-FÔ-FÈeÐTÑTÔTÐTØÐr   c                 ó  — t          j        | j        ¬¦  «        t           j        j        u rÍt          j        | j        ¬¦  «        }t          |                     ¦   «         ¦  «        }|d         |z  dk    rt          d|› d|› �¦  «        ‚|d         t          j        | j        ¬¦  «        z  |d<   t          j
        ||j        |j        ¬¦  «        }t          j        ||t          j        | j        ¦  «         nt          d¦  «        ‚d |d fS )Nr8   r   zTensor with dimensions: z8 does not have first dimension divisible by world_size: ©ÚdeviceÚdtypezBackend not supported!)r9   r~   r   r   r€   rU   re   ra   ÚRuntimeErrorrO   Úemptyrˆ   r‰   Ú_reduce_scatter_baser   rA   )r=   rC   Ú
world_sizeÚout_sizerD   s        r   rE   z_AllGatherBase.backwardb  s  € åÔ #¤)Ð,Ñ,Ô,µ´Ô0AÐAÐAÝÔ,°3´9Ð=Ñ=Ô=ˆJÝ˜K×,Ò,Ñ.Ô.Ñ/Ô/ˆHØ˜Œ{˜ZÑ'¨1Ò,Ð,Ý"ðV¨xð Vð VØISðVð Vñô ð ð # 1œ+­Ô)<À3Ä9Ð)MÑ)MÔ)MÑMˆH�Q‰KÝ”Ø Ô!3¸;Ô;Lðñ ô ˆBõ Ô% b¨+µx´|ÀSÄYÑOÔOÐOÐOåÐ7Ñ8Ô8Ð8Ø�b˜$ÐÐr   NrF   rK   r   r   r#   r#   [  sH   € € € € € Øðð ñ „\ðð
 ð ð  ñ „\ð ð  ð  r   r#   c                   ó:   — e Zd Zed„ ¦   «         Zed„ ¦   «         ZdS )r(   c                 ó<  ‡— || _         ˆfd„t          t          j        |¬¦  «        ¦  «        D ¦   «         | _        t          j        |¬¦  «        }t          d„ ‰D ¦   «         ¦  «        Št          j        |¬¦  «        t          j        j	        u r[t          t          j        |¬¦  «        ¦  «        D ]7}d }||k    rt          ‰¦  «        }t          j        ||         |||¬¦  «         Œ8n$t          j        |t          ‰¦  «        |¬¦  «         t          |¦  «        S )Nc                 óD   •— g | ]}‰|                               ¦   «         ‘ŒS rK   r`   )rQ   rR   r   s     €r   rS   z%_AlltoAll.forward.<locals>.<listcomp>z  s4   ø€ ð &
ð &
ð &
Ø"#ˆG�AŒJ�OŠOÑÔð&
ð &
ð &
r   r8   c              3   ó>   K  — | ]}|                      ¦   «         V — Œd S r@   rq   rr   s     r   rc   z$_AlltoAll.forward.<locals>.<genexpr>~  s*   è è € Ð8Ð8¨1˜Ÿš™œÐ8Ð8Ð8Ð8Ð8Ð8r   )r   rT   r9   rU   Úinput_tensor_size_listr:   rW   r~   r   ÚGLOOre   r   r+   )r=   r   rz   r   Úmy_rankrR   Úto_sends      `   r   r>   z_AlltoAll.forwardw  s:  ø€ àˆŒ	ð&
ð &
ð &
ð &
Ý',­TÔ-@ÀuÐ-MÑ-MÔ-MÑ'NÔ'Nð&
ñ &
ô &
ˆÔ"õ ”- eÐ,Ñ,Ô,ˆÝÐ8Ð8°Ð8Ñ8Ô8Ñ8Ô8ˆåÔ %Ð(Ñ(Ô(­D¬LÔ,=Ð=Ð=Ý�4Ô.°UÐ;Ñ;Ô;Ñ<Ô<ð Jð J�Ø�Ø˜’<�<Ý" 7™mœm�GÝ”˜_¨QÔ/°¸!À5ÐIÑIÔIÐIÐIð	Jõ ŒOØÝ�W‘”Øðñ ô ð õ
 �_Ñ%Ô%Ð%r   c                 ó`   ‡— ˆfd„| j         D ¦   «         }dt          j        | j        |g‰¢R Ž z   S )Nc                 ój   •— g | ]/}t          j        |‰d          j        ‰d          j        ¬¦  «        ‘Œ0S )r   r‡   )rO   r‹   rˆ   r‰   )rQ   ra   r\   s     €r   rS   z&_AlltoAll.backward.<locals>.<listcomp>�  sQ   ø€ ð 
ð 
ð 
ð õ ŒKØ˜\¨!œ_Ô3¸<È¼?Ô;Pðñ ô ð
ð 
ð 
r   r[   )r“   r(   r   r   )r=   r\   rX   s    ` r   rE   z_AlltoAll.backwardŽ  sS   ø€ ð
ð 
ð 
ð 
ð Ô2ð	
ñ 
ô 
ˆð �iœo¨c¬i¸ÐTÀ|ÐTÐTÐTÑTÐTr   NrF   rK   r   r   r(   r(   v  sM   € € € € € Øð&ð &ñ „\ð&ð, ðUð Uñ „\ðUð Uð Ur   r(   c                   ó:   — e Zd Zed„ ¦   «         Zed„ ¦   «         ZdS )r-   c                 ó”   — || _         |                     ¦   «         | _        || _        || _        t          j        |||||¬¦  «         |S )N)r/   r0   r   )r   ra   Ú
input_sizer/   r0   r9   r1   )r=   r   r   r/   r0   r.   s         r   r>   z_AlltoAllSingle.forwardš  sX   € àˆŒ	ØŸš™œˆŒØ!2ˆÔØ 2ˆÔÝÔØØØ1Ø/Øð	
ñ 	
ô 	
ð 	
ð ˆr   c           	      óÔ   — t          j        | j        |j        |j        ¬¦  «        }dt
                               | j        || j        | j	        | 
                    ¦   «         ¦  «        fz   S )Nr‡   )NNNN)rO   r‹   r›   rˆ   r‰   r-   r   r   r/   r0   rV   )r=   rC   r	   s      r   rE   z_AlltoAllSingle.backward©  sq   € å”ØŒN ;Ô#5¸[Ô=Nð
ñ 
ô 
ˆð (Ý×!Ò!Ø”	ØØÔ&ØÔ%Ø×&Ò&Ñ(Ô(ñô ð+
ñ 
ð 	
r   NrF   rK   r   r   r-   r-   ™  sH   € € € € € Øðð ñ „\ðð ð
ð 
ñ „\ð
ð 
ð 
r   r-   c                   ó:   — e Zd Zed„ ¦   «         Zed„ ¦   «         ZdS )r3   c                 óx   — || _         || _        |                     ¦   «         }t          j        |||¬¦  «         |S rj   )r   r   r<   r9   r4   )r=   r   r   r	   s       r   r>   z_AllReduce.forwardº  s9   € àˆŒ	ØˆŒØ—’‘”ˆÝŒ˜ 2¨UÐ3Ñ3Ô3Ð3Øˆr   c                 óV   — dt                                | j        | j        |¦  «        fz   S rZ   )r3   r   r   r   rg   s     r   rE   z_AllReduce.backwardÂ  s&   € à�z×/Ò/°´¸¼	À;ÑOÔOÐQÑQÐQr   NrF   rK   r   r   r3   r3   ¹  sM   € € € € € Øðð ñ „\ðð ðRð Rñ „\ðRð Rð Rr   r3   )rO   Útorch.distributedÚdistributedr9   Útorch.autogradr   r   r   ÚWORLDr   r   r   rA   r   r   r!   r&   r+   r1   r4   r   r   r   r   r   r    r#   r(   r-   r3   rK   r   r   ú<module>r¤      s`  ðà €€€Ø  Ð  Ð  Ð  Ð  Ð  Ø #Ð #Ð #Ð #Ð #Ð #ð
 .Ð -Ð -Ð -Ð -Ð -Ð -Ð -ð "'¤ð 0ð 0ð 0ð 0ð(  ¤ð -ð -ð -ð -ð  %¤+ð 0ð 0ð 0ð 0ð( $œ<¨u¬{ð 1ð 1ð 1ð 1ð* +3¬,¸e¼kð Að Að Að Að& #œ[ð +ð +ð +ð +ð 9>¼ð !Dð !Dð !Dð !DðH =B¼Kð Jð Jð Jð Jð& ØØ
Œ+ðð ð ð ð> #œ,¨e¬kð /ð /ð /ð /ð* ð  ð  ð  ð  �ñ  ô  ð  ð(Sð Sð Sð Sð Sˆhñ Sô Sð Sð2Mð Mð Mð Mð Mˆxñ Mô Mð Mð$Yð Yð Yð Yð Yˆhñ Yô Yð YðMð Mð Mð Mð M�hñ Mô Mð Mðð ð ð ð �ñ ô ð ð: ð  ð  ð  ð  �Xñ  ô  ð  ð6 Uð  Uð  Uð  Uð  U�ñ  Uô  Uð  UðF
ð 
ð 
ð 
ð 
�hñ 
ô 
ð 
ð@Rð Rð Rð Rð R�ñ Rô Rð Rð Rð Rr   