§
    ŠŠtjõ ã                   ó¶  — d dl Z d dlZd dlZd dlZd dlmZmZmZ d dlZd dl	m
Z d dlm
c mZ d dlmZ d dlmZ d dlmZ ddlmZ 	 d dlmZ n# e$ r	 d dlmZ Y nw xY w	 d d	lmZ n # e$ r  ej         d
d¬¦  «         d„ ZY nw xY w	 	 	 e!e"         e!e!e"                  z  ej#        z  ez  e$de"f         z  ej%        z  Z&d dlm'Z' 	 d„ Z(d¿dej)        de"de&de*fd„Z+d¿dej)        de*de&de*fd„Z,	 d¿dej)        de"de&de*dej)        f
d„Z-	 d¿dej)        de"de&de*fd„Z.	 d¿dej)        de*de"de&de*f
d„Z/	 d¿dej)        de*de"de&de*f
d„Z0	 d¿dej)        de"de&de*dej)        f
d „Z1	 d¿dej)        de"de&de*fd!„Z2	 d¿dej)        de*de"de&de*f
d"„Z3	 d¿dej)        de*de"de&de*f
d#„Z4	 d¿de!ej)                 de*de&de*de!ej)                 f
d$„Z5	 d¿de!ej)                 de&de*de!ej)                 fd%„Z6	 d¿d&e!ej)                 de*de!e"         de&de*de!ej)                 fd'„Z7	 d¿de!ej)                 de&de*de!ej)                 fd(„Z8	 d¿d&e!ej)                 de*de!e"         de&de*de!ej)                 fd)„Z9d*„ Z:	 d¿dej)        d+e!e"         dz  d,e!e"         dz  de&de*dej)        fd-„Z;	 d¿dej)        d+e!e"         dz  d,e!e"         dz  de&de*dej)        fd.„Z<d/ej)        fd0„Z=d1„ Z>ej?         @                    d2e=e>¬3¦  «         d/ej)        fd4„ZAd5„ ZBej?         @                    d6eAeB¬3¦  «         d/ej)        fd7„ZCd8„ ZDej?         @                    d9eCeD¬3¦  «         d/ej)        fd:„ZEd;„ ZFej?         @                    d<eEeF¬3¦  «         d/ej)        fd=„ZGd>„ ZHej?         @                    d?eGeH¬3¦  «         ej?         @                    d@eCeD¬3¦  «         ej?         @                    dAeEeF¬3¦  «         ej?         @                    dBeGeH¬3¦  «         dCe!ej)                 fdD„ZIdE„ ZJej?         @                    dFeIeJ¬3¦  «         dCe!ej)                 fdG„ZKdH„ ZLej?         @                    dIeKeL¬3¦  «         dCe!ej)                 fdJ„ZMdK„ ZNej?         @                    dLeMeN¬3¦  «         	 d¿dej)        dMe!e"         de&de*dej)        f
dN„ZO G dO„ dPej)        ¦  «        ZP	 d¿de&de*de$e*e!e"         e"f         fdQ„ZQ	 d¿de&de*dej#        ej%        z  fdR„ZRd¿de&de*dej%        fdS„ZSej?         T                    dTdUdV¬W¦  «        dXej)        dej)        fdY„¦   «         ZUeUjV        dXej)        dej)        fdZ„¦   «         ZWd/ej)        fd[„ZXd\„ ZYeU @                    eXeY¬3¦  «         deZfd]„Z[dej)        fd^„Z\e j]        dÀd`eZfda„¦   «         Z^db„ Z_dc„ Z`dd„ Zade„ Zbdf„ Zcdg„ Zddh„ Zedi„ Zfdj„ Zgdk„ Zhdl„ Zidm„ Zjdn„ Zkdo„ Zldp„ Zmdq„ Zndr„ Zods„ Zpdt„ Zqdu„ Zrdv„ Zsdw„ Ztej?         u                    dxdy¦  «        Zvev w                    dzebd{¦  «         ev w                    d|ejd{¦  «         ev w                    d}eid{¦  «         ev w                    d~eld{¦  «         ev w                    decd{¦  «         ev w                    d€edd{¦  «         ev w                    d�eed{¦  «         ev w                    d‚efd{¦  «         ev w                    dƒeod{¦  «         ev w                    d„epd{¦  «         ev w                    d…eqd{¦  «         ev w                    d†erd{¦  «         ev w                    d‡esd{¦  «         ev w                    dˆetd{¦  «         ev w                    d‰end{¦  «         ev w                    dŠead{¦  «         ev w                    d‹ekd{¦  «         ej?         u                    dŒdy¦  «        Zxex w                    d„epd{¦  «         ex w                    d†erd{¦  «         ex w                    d‰end{¦  «         ejy        jz         {                    ej|        j}        j(        j~        ¦  «         ejy        jz         {                    ej|        j}        j(        ¦  «         ejy        jz         {                    ej|        j}        j        j~        ¦  «         ejy        jz         {                    ej|        j}        j        ¦  «         ejy        jz         {                    ej|        j}        j€        j~        ¦  «         ejy        jz         {                    ej|        j}        j€        ¦  «         ejy        jz         {                    ej|        j}        j�        j~        ¦  «         ejy        jz         {                    ej|        j}        j�        ¦  «         ej?         u                    d�dŽ¦  «        Z‚ej?         u                    d�dy¦  «        Zƒg d�¢Z„ej…        e†         Z‡e„D ]fZˆeˆd eˆ ‰                    d�¦  «        …         ZŠ e‹ed‘eŠ› �¦  «        ZŒe‚ �                    eˆejŽ        j�        ¬’¦  «         eƒ w                    eŠeŒd“¦  «         Œg	 	 	 	 	 dÁd•ej)        d–ej)        d—eZde*de"f
d˜„Z�	 	 	 	 	 dÂdšej)        dXej)        d›e*d—eZde"de*fdœ„Z‘ej’        j“        d™ej’        j”        d�ej’        j•        džej’        j–        dŸej’        j—        d ej’        j˜        d¡ej’        j™        d¢ej’        jš        d£iZ›	 	 	 	 dÃd¤ej)        d›e*d—eZde*fd¥„Zœ	 	 	 	 	 dÄdšej)        dXej)        de*fd¦„Z�	 	 	 dÅd§e!ej)                 d¤ej)        de*fd¨„Zž	 	 	 dÆd¤ej)        dªe"de"dej#        dz  d«e"f
d¬„ZŸ	 	 	 dÆd¤ej)        de"de"dej#        dz  d­e"f
d®„Z d¯e!e*         d°e!e"         d±e!e"         d²e!ej)                 d³e&f
d´„Z¡dej#        ej%        z  dej#        ej%        z  fdµ„Z¢d d¶lm£Z¤m¥Z¦m§Z¨m©Zªm-Z«m,Z¬m;Z­m®Z¯m€Z°mZ±m/Z²m3Z³ d·„ Z´d¸„ Zµd¹„ Z¶dº„ Z·d»„ Z¸d¼„ Z¹d½„ Zºd¾„ Z»eªe´e«e´e³eµe²eµe¬e¶e­e·e¨e¸e¦eµe¤e´e±e¹e°eºe¯e»iZ¼dS )Çé    N)ÚAnyÚcastÚTYPE_CHECKING)Ú_maybe_view_chunk_cat)Ú
DeviceMesh)Úget_proxy_modeé   )Ú_functional_collectives_impl)Útree_map_only)Úis_dynamo_compilingzdUnable to import torchdynamo util `is_torchdynamo_compiling`, so won't support torchdynamo correctlyé   ©Ú
stacklevelc                  ó   — dS )NF© r   ó    úg/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/torch/distributed/_functional_collectives.pyÚis_torchdynamo_compilingr       s   € Øˆur   zdist.tensor.DeviceMesh)Ú_chunk_or_narrow_catc                 óJ   — t           j        j                             | ¦  «        S )z¡
    Wait on a tensor returned by the collectives ops.

    Waiting follows device semantics, which means blocking on CPU and synchronizing streams on CUDA.
    )ÚtorchÚopsÚ_c10d_functionalÚwait_tensor)Útensors    r   r   r   ˆ   s   € õ Œ9Ô%×1Ò1°&Ñ9Ô9Ð9r   Ú ÚselfÚsrcÚgroupÚtagc                 ó¦   — t          ||¦  «        }t          j        j                             | |t          |¦  «        ¦  «        }t          |¦  «        S )a  
    Broadcasts the tensor to all processes in the given process group.

    Args:
        src (int): Source rank
        group (ProcessGroup or List[int]): The process group to work on.
        tag (str, optional): A unique identifier for the collective. Default: empty string
    )Ú_resolve_groupr   r   r   Ú	broadcastÚ_group_or_group_nameÚ_maybe_wrap_tensor)r   r   r   r    r   s        r   r#   r#   ‘   sM   € õ ˜5 #Ñ&Ô&€EÝŒYÔ'×1Ò1ØˆcÕ'¨Ñ.Ô.ñô €Fõ ˜fÑ%Ô%Ð%r   ÚreduceOpc                 óÊ   — t          ||¦  «        }t          j        j                             | |                     ¦   «         t          |¦  «        ¦  «        }t          |¦  «        S )aø  
    Reduces the tensor data across all machines in such a way that all get
    the final result.

    The input tensor is left unmodified.

    Group can be one of:
        List[int]: ranks participating in the collective.
        List[List[int]]: 2D mesh of ranks taking part of this collective in MPMD.
        ProcessGroup: Will perform a collective using the ranks and tag of the PG.
        DeviceMesh: Do a SPMD collective over all ranks of the mesh
        (DeviceMesh, int): Do a MPMD collective over one dimension of the DeviceMesh

    :: N.B. If you pass a PG or a 1D list to perform a MPMD collective, the compiler won't be able to recover
    that information and perform collective algebraic optimization. Use other forms of input for that.
    )r"   r   r   r   Ú
all_reduceÚlowerr$   r%   )r   r&   r   r    r   s        r   r(   r(   ¡   sW   € õ" ˜5 #Ñ&Ô&€EÝŒYÔ'×2Ò2Øˆh�nŠnÑÔÕ 4°UÑ ;Ô ;ñô €Fõ ˜fÑ%Ô%Ð%r   Ú
gather_dimÚreturnc                 óê  — t          ||¦  «        }t          j        |¦  «        }t          j        j                             | |t          |¦  «        ¦  «        }t          |¦  «        }|dk    r†t          |t          ¦  «        r`t          |j        ¦  «        }|dk    rt          j        |d|…         ¦  «        nd}|d         |k    o|dk    }	|	s|                     ¦   «         }t!          |||¦  «        }|S )a%  
    Gather tensor data across from all machines and concatenate over ``gather_dim``.

    Note that it currently only supports gather_dim = 0.

    The input tensor is left unmodified.
    Group can be one of:
        List[int]: ranks participating in the collective.
        List[List[int]]: 2D mesh of ranks taking part of this collective in MPMD.
        ProcessGroup: Will perform a collective using the ranks and tag of the PG.
        DeviceMesh: Do a SPMD collective over all ranks of the mesh
        (DeviceMesh, int): Do a MPMD collective over one dimension of the DeviceMesh

    :: N.B. If you pass a PG or a 1D list to perform a MPMD collective, the compiler won't be able to recover
    that information and perform collective algebraic optimization. Use other forms of input for that.
    r   r	   )r"   Úc10dÚ_get_group_size_by_namer   r   r   Úall_gather_into_tensorr$   r%   Ú
isinstanceÚAsyncCollectiveTensorÚlistÚshapeÚmathÚprodÚwaitr   )
r   r*   r   r    Ú
group_sizer   Úresr3   Únumel_betweenÚcan_use_views
             r   Úall_gather_singler;   ¹   sð   € õ, ˜5 #Ñ&Ô&€EÝÔ-¨eÑ4Ô4€JÝŒYÔ'×>Ò>ØˆjÕ.¨uÑ5Ô5ñô €Fõ ˜VÑ
$Ô
$€CØ�Q‚€õ �cÕ0Ñ1Ô1ð 	!Ý˜œ‘O”OˆEØ>HÈ1ºn¸n�DœI e¨A¨j¨LÔ&9Ñ:Ô:Ð:ÐRSˆMØ  œ8 zÒ1ÐH°mÀqÒ6HˆLØð !Ø—h’h‘j”j�Ý# C¨°ZÑ@Ô@ˆØ€Jr   c                 ó&   — t          | |||¦  «        S )a<  
    Gather tensor data across from all machines and concatenate over ``gather_dim``.

    Note that it currently only supports gather_dim = 0.

    This function is the same as all_gather_single but will propagate the
    backwards gradient across workers.

    See all_gather_single for more details on usage.
    )r;   ©r   r*   r   r    s       r   Úall_gather_single_autogradr>   ã   s   € õ" ˜T :¨u°cÑ:Ô:Ð:r   Úscatter_dimc                 ó´  — t          ||¦  «        }t          j        |¦  «        }|                      |¦  «        |z  dk    r)t	          d|                      d¦  «        › d|› d�¦  «        ‚|dk    rt          | ||d¬¦  «        } t          j        j         	                    | | 
                    ¦   «         |t          |¦  «        ¦  «        }t          |¦  «        }|S )a(  
    Reduces the tensor data across all machines in such a way that all get
    the final result, then scatter the results to corresponding ranks.


    The input tensor is left unmodified.
    Group can be one of:
        List[int]: ranks participating in the collective.
        List[List[int]]: 2D mesh of ranks taking part of this collective in MPMD.
        ProcessGroup: Will perform a collective using the ranks and tag of the PG.
        DeviceMesh: Do a SPMD collective over all ranks of the mesh
        (DeviceMesh, int): Do a MPMD collective over one dimension of the DeviceMesh
    :: N.B. If you pass a PG or a 1D list to perform a MPMD collective, the compiler won't be able to recover
    that information and perform collective algebraic optimization. Use other forms of input for that.
    r   zinput dimension 0 (ú" must be a multiple of group_size ú))Ú
narrow_dimÚcat_dim)r"   r-   r.   ÚsizeÚAssertionErrorr   r   r   r   Úreduce_scatter_tensorr)   r$   r%   )r   r&   r?   r   r    r7   r   r8   s           r   Úreduce_scatter_singlerH   ÷   sâ   € õ, ˜5 #Ñ&Ô&€EÝÔ-¨eÑ4Ô4€Jà‡y‚y�ÑÔ 
Ñ*¨aÒ/Ð/ÝØ_ $§)¢)¨A¡,¤,Ð_Ð_ÐR\Ð_Ð_Ð_ñ
ô 
ð 	
ð �aÒÐÝ# D¨*ÀÐVWÐXÑXÔXˆåŒYÔ'×=Ò=ØØ�ŠÑÔØÝ˜UÑ#Ô#ñ	ô €Fõ ˜VÑ
$Ô
$€CØ€Jr   c                 ó(   — t          | ||||¦  «        S )a|  
    Reduces the tensor data across all machines in such a way that all get
    the final result, then scatter the results to corresponding ranks.

    This function is the same as reduce_scatter_single but will propagate the
    backwards gradient across workers.

    Currently only the "sum" reduceOp is supported.

    See reduce_scatter_single for more details on usage.
    )rH   ©r   r&   r?   r   r    s        r   Úreduce_scatter_single_autogradrK   !  s   € õ& !  x°¸eÀSÑIÔIÐIr   c                 óš   — t           j                             ¦   «         st          j        dt
          d¬¦  «         t          | |||¦  «        S )Nzž`torch.distributed._functional_collectives.all_gather_tensor` is deprecated. Please use `torch.distributed._functional_collectives.all_gather_single` instead.r   r   )r   ÚcompilerÚis_compilingÚwarningsÚwarnÚFutureWarningr;   r=   s       r   Úall_gather_tensorrR   =  sU   € õ Œ>×&Ò&Ñ(Ô(ð 
ÝŒð`åØð		
ñ 	
ô 	
ð 	
õ ˜T :¨u°cÑ:Ô:Ð:r   c                 óš   — t           j                             ¦   «         st          j        dt
          d¬¦  «         t          | |||¦  «        S )Nz°`torch.distributed._functional_collectives.all_gather_tensor_autograd` is deprecated. Please use `torch.distributed._functional_collectives.all_gather_single_autograd` instead.r   r   )r   rM   rN   rO   rP   rQ   r>   r=   s       r   Úall_gather_tensor_autogradrT   M  sU   € õ Œ>×&Ò&Ñ(Ô(ð 
ÝŒðiåØð		
ñ 	
ô 	
ð 	
õ & d¨J¸¸sÑCÔCÐCr   c                 óœ   — t           j                             ¦   «         st          j        dt
          d¬¦  «         t          | ||||¦  «        S )Nz¦`torch.distributed._functional_collectives.reduce_scatter_tensor` is deprecated. Please use `torch.distributed._functional_collectives.reduce_scatter_single` instead.r   r   )r   rM   rN   rO   rP   rQ   rH   rJ   s        r   rG   rG   ]  sW   € õ Œ>×&Ò&Ñ(Ô(ð 
ÝŒðdåØð		
ñ 	
ô 	
ð 	
õ !  x°¸eÀSÑIÔIÐIr   c                 óœ   — t           j                             ¦   «         st          j        dt
          d¬¦  «         t          | ||||¦  «        S )Nz¸`torch.distributed._functional_collectives.reduce_scatter_tensor_autograd` is deprecated. Please use `torch.distributed._functional_collectives.reduce_scatter_single_autograd` instead.r   r   )r   rM   rN   rO   rP   rQ   rK   rJ   s        r   Úreduce_scatter_tensor_autogradrW   n  sW   € õ Œ>×&Ò&Ñ(Ô(ð 
ÝŒðmåØð		
ñ 	
ô 	
ð 	
õ *¨$°¸+ÀuÈcÑRÔRÐRr   c                 óð   — t          ||¦  «        }t          j        j                             | |                     ¦   «         t          |¦  «        ¦  «        }t          t          t          |¦  «        ¦  «        S )a  
    Reduces a list of tensors across all machines in such a way that all get
    the final result.

    The all tensors in the input list are left unmodified.

    Group can be one of:
        List[int]: ranks participating in the collective.
        List[List[int]]: 2D mesh of ranks taking part of this collective in MPMD.
        ProcessGroup: Will perform a collective using the ranks and tag of the PG.
        DeviceMesh: Do a SPMD collective over all ranks of the mesh
        (DeviceMesh, int): Do a MPMD collective over one dimension of the DeviceMesh

    :: N.B. If you pass a PG or a 1D list to perform a MPMD collective, the compiler won't be able to recover
    that information and perform collective algebraic optimization. Use other forms of input for that.
    )
r"   r   r   r   Úall_reduce_coalescedr)   r$   r2   Úmapr%   )r   r&   r   r    Útensor_lists        r   rY   rY     sc   € õ& ˜5 #Ñ&Ô&€EÝ”)Ô,×AÒAØØ�ŠÑÔÝ˜UÑ#Ô#ñô €Kõ
 •Õ&¨Ñ4Ô4Ñ5Ô5Ð5r   c                 óô   — t          ||¦  «        }t          j        |¦  «        }t          j        j                             | |t          |¦  «        ¦  «        }t          t          t          |¦  «        ¦  «        S )a  
    Gather a list of tensors across from all machines.

    Note that it currently only supports gather_dim = 0.

    The input tensor is left unmodified.
    Group can be one of:
        List[int]: ranks participating in the collective.
        List[List[int]]: 2D mesh of ranks taking part of this collective in MPMD.
        ProcessGroup: Will perform a collective using the ranks and tag of the PG.
        DeviceMesh: Do a SPMD collective over all ranks of the mesh
        (DeviceMesh, int): Do a MPMD collective over one dimension of the DeviceMesh

    :: N.B. If you pass a PG or a 1D list to perform a MPMD collective, the compiler won't be able to recover
    that information and perform collective algebraic optimization. Use other forms of input for that.
    )r"   r-   r.   r   r   r   Ú all_gather_into_tensor_coalescedr$   r2   rZ   r%   )r   r   r    r7   r[   s        r   Úall_gather_single_coalescedr^   ›  si   € õ& ˜5 #Ñ&Ô&€EÝÔ-¨eÑ4Ô4€JÝ”)Ô,×MÒMØØÝ˜UÑ#Ô#ñô €Kõ
 •Õ&¨Ñ4Ô4Ñ5Ô5Ð5r   Úinputsc                 ó  — t          ||¦  «        }t          j        |¦  «        }t          |¦  «        t          | ¦  «        k    r0t	          dt          |¦  «        › dt          | ¦  «        › d�¦  «        ‚t          t          || ¦  «        ¦  «        D ]†\  }\  }}|                     |¦  «        |z  dk    r.t	          d|› d|                     |¦  «        › d|› d|› �¦  «        ‚|dk    r.t          j	        |||¬	¦  «        }	t          j
        |	¦  «        | |<   Œ‡t          j        j                             | |                     ¦   «         |t          |¦  «        ¦  «        }	t!          t#          t$          |	¦  «        ¦  «        S )
a,  
    Reduces a list of tensors across all machines in such a way that all get
    the final result, then scatter the results to corresponding ranks.

    The input tensors are left unmodified.
    Group can be one of:
        List[int]: ranks participating in the collective.
        List[List[int]]: 2D mesh of ranks taking part of this collective in MPMD.
        ProcessGroup: Will perform a collective using the ranks and tag of the PG.
        DeviceMesh: Do a SPMD collective over all ranks of the mesh
        (DeviceMesh, int): Do a MPMD collective over one dimension of the DeviceMesh

    :: N.B. If you pass a PG or a 1D list to perform a MPMD collective, the compiler won't be able to recover
    that information and perform collective algebraic optimization. Use other forms of input for that.
    zLength of scatter_dim (z) must equal length of inputs (rB   r   zinput dimension z (rA   z for tensor at index )Údim)r"   r-   r.   ÚlenrF   Ú	enumerateÚziprE   r   ÚchunkÚcatr   r   Úreduce_scatter_tensor_coalescedr)   r$   r2   rZ   r%   )
r_   r&   r?   r   r    r7   Úidxra   r   r[   s
             r   Úreduce_scatter_single_coalescedri   ¸  s¨  € õ, ˜5 #Ñ&Ô&€EÝÔ-¨eÑ4Ô4€Jå
ˆ;ÑÔ�3˜v™;œ;Ò&Ð&ÝØe¥c¨+Ñ&6Ô&6ÐeÐeÕWZÐ[aÑWbÔWbÐeÐeÐeñ
ô 
ð 	
õ (­¨K¸Ñ(@Ô(@ÑAÔAð 1ð 1Ñˆ‰]ˆc�6Ø�;Š;�sÑÔ˜jÑ(¨AÒ-Ð-Ý ð E 3ð  Eð  E¨&¯+ª+°cÑ*:Ô*:ð  Eð  EÐ^hð  Eð  Eð  @Cð  Eð  Eñô ð ð �!Š8ˆ8Ýœ+ f¨j¸cÐBÑBÔBˆKÝœ) KÑ0Ô0ˆF�3‰Køå”)Ô,×LÒLØØ�ŠÑÔØÝ˜UÑ#Ô#ñ	ô €Kõ •Õ&¨Ñ4Ô4Ñ5Ô5Ð5r   c                 ó˜   — t           j                             ¦   «         st          j        dt
          d¬¦  «         t          | ||¦  «        S )Nz·`torch.distributed._functional_collectives.all_gather_into_tensor_coalesced` is deprecated. Please use `torch.distributed._functional_collectives.all_gather_single_coalesced` instead.r   r   )r   rM   rN   rO   rP   rQ   r^   )r   r   r    s      r   r]   r]   ë  sS   € õ Œ>×&Ò&Ñ(Ô(ð 
ÝŒðjåØð		
ñ 	
ô 	
ð 	
õ ' t¨U°CÑ8Ô8Ð8r   c                 óœ   — t           j                             ¦   «         st          j        dt
          d¬¦  «         t          | ||||¦  «        S )Nzº`torch.distributed._functional_collectives.reduce_scatter_tensor_coalesced` is deprecated. Please use `torch.distributed._functional_collectives.reduce_scatter_single_coalesced` instead.r   r   )r   rM   rN   rO   rP   rQ   ri   )r_   r&   r?   r   r    s        r   rg   rg   ø  sX   € õ Œ>×&Ò&Ñ(Ô(ð 
ÝŒðnåØð		
ñ 	
ô 	
ð 	
õ +¨6°8¸[È%ÐQTÑUÔUÐUr   c                 óŒ  — t          | t          j        j        ¦  «        st	          dt          | ¦  «        › �¦  «        ‚t          j                             |                      ¦   «         t          j	        j
        ¦  «        rdS | j        }t          |j        ¦  «        dk    r#|j        d         }|j        d uo|j        j         S d S )Nz$Expected torch._ops.OpOverload, got Fr   )r0   r   Ú_opsÚ
OpOverloadrF   ÚtypeÚ_CÚ%_dispatch_has_kernel_for_dispatch_keyÚnameÚDispatchKeyÚCompositeImplicitAutogradÚ_schemarb   Ú	argumentsÚ
alias_infoÚis_write)ÚtgtÚschemaÚ	first_args      r   Ú_is_view_opr|     s»   € Ý�c�5œ:Ô0Ñ1Ô1ð QÝÐOÅDÈÁIÄIÐOÐOÑPÔPÐPõ „x×5Ò5Ø�Š‰
Œ
•EÔ%Ô?ñô ð ð ˆuØŒ[€FÝ
ˆ6ÔÑÔ˜qÒ Ð ØÔ$ QÔ'ˆ	àÔ#¨4Ð/ÐU¸	Ô8LÔ8UÐ4UÐUð !Ð r   Úoutput_split_sizesÚinput_split_sizesc                 óÞ  — |�+t          d„ |D ¦   «         ¦  «        st          d|› �¦  «        ‚|�+t          d„ |D ¦   «         ¦  «        st          d|› �¦  «        ‚t          ||¦  «        }t          j        |¦  «        }|�|€)|€|�t          d¦  «        ‚| j        d         |z  g|z  }|}t          j        j         	                    | ||t          |¦  «        ¦  «        }t          |¦  «        S )aC  
    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.

    Group can be one of:
        List[int]: ranks participating in the collective.
        List[List[int]]: 2D mesh of ranks taking part of this collective in MPMD.
        ProcessGroup: Will perform a collective using the ranks and tag of the PG.
        DeviceMesh: Do a SPMD collective over all ranks of the mesh
        (DeviceMesh, int): Do a MPMD collective over one dimension of the DeviceMesh

    :: N.B. If you pass a PG or a 1D list to perform a MPMD collective, the compiler won't be able to recover
    that information and perform collective algebraic optimization. Use other forms of input for that.
    Nc              3   óX   K  — | ]%}t          |t          t          j        f¦  «        V — Œ&d S ©N©r0   Úintr   ÚSymInt©Ú.0rE   s     r   ú	<genexpr>z$all_to_all_single.<locals>.<genexpr>2  sD   è è € ð 
ð 
Ø6:�J�t�c¥5¤<Ð0Ñ1Ô1ð
ð 
ð 
ð 
ð 
ð 
r   z2All output_split_sizes must be int or SymInt, got c              3   óX   K  — | ]%}t          |t          t          j        f¦  «        V — Œ&d S r�   r‚   r…   s     r   r‡   z$all_to_all_single.<locals>.<genexpr>9  s3   è è € ÐWÐW¸T•:˜d¥S­%¬,Ð$7Ñ8Ô8ÐWÐWÐWÐWÐWÐWr   z1All input_split_sizes must be int or SymInt, got z^output_split_sizes and input_split_sizes must either be specified together or both set to Noner   )ÚallrF   r"   r-   r.   r3   r   r   r   Úall_to_all_singler$   r%   )r   r}   r~   r   r    r7   r   s          r   rŠ   rŠ     sM  € ð, Ð%Ýð 
ð 
Ø>Pð
ñ 
ô 
ñ 
ô 
ð 	õ !ØYÐEWÐYÐYñô ð ð Ð$ÝÐWÐWÐEVÐWÑWÔWÑWÔWð 	Ý ØWÐDUÐWÐWñô ð õ ˜5 #Ñ&Ô&€EÝÔ-¨eÑ4Ô4€JØÐ!Ð%6Ð%>Ø"Ð*Ð/@Ð/HÝ ð9ñô ð ð #œj¨œm¨zÑ9Ð:¸ZÑGÐØ.ÐÝŒYÔ'×9Ò9ØØØÝ˜UÑ#Ô#ñ	ô €Fõ ˜fÑ%Ô%Ð%r   c                 ó(   — t          | ||||¦  «        S )z:
    Same as all_to_all_single but supports autograd.
    )rŠ   )r   r}   r~   r   r    s        r   Úall_to_all_single_autogradrŒ   P  s   € õ ˜TÐ#5Ð7HÈ%ÐQTÑUÔUÐUr   Úgrad_outputc                 ó   — |S )a  
    Backward for wait_tensor: identity (no-op).
    Wait is just a synchronization primitive, so gradient flows through unchanged.

    Args:
        ctx: Context object
        grad_output: Gradient from downstream operations

    Returns:
        Gradient unchanged (identity)
    r   ©Úctxr�   s     r   Úwait_tensor_backwardr‘   c  s
   € ð Ðr   c                 ó   — dS )z¾
    Setup context for wait_tensor backward.
    Args:
        ctx: Context object to save state for backward
        inputs: Tuple of (tensor,)
        output: Output from forward pass
    Nr   ©r�   r_   Úoutputs      r   Úwait_tensor_setup_contextr•   r  s	   € ð €Fr   z_c10d_functional::wait_tensor)Úsetup_contextc                 óä   — | j         }| j        }|dk    rt          d|› d�¦  «        ‚t          j        j                             |                     ¦   «         ||¦  «        }t          |¦  «        ddfS )aw  
    Backward for all_reduce: all_reduce with same reduce_op.
    Forward aggregates tensors, backward aggregates gradients.

    Args:
        ctx: Context object
        grad_output: Gradient from downstream operations

    Returns:
        Tuple of (grad_input, grad_group_name, grad_reduce_op)
        grad_group_name and grad_reduce_op are None (not differentiable)
    Úsumz8all_reduce backward only supports 'sum' reduction, got 'ú'N)	Ú
group_nameÚ	reduce_opÚRuntimeErrorr   r   r   r(   Ú
contiguousr   )r�   r�   rš   r›   r”   s        r   Úall_reduce_backwardrž   „  sƒ   € ð ”€JØ”€Ià�EÒÐÝØSÀyÐSÐSÐSñ
ô 
ð 	
õ
 ŒYÔ'×2Ò2Ø×ÒÑ Ô  )¨Zñô €Fõ �vÑÔ  dÐ*Ð*r   c                 óR   — |\  }}}|| _         |                     ¦   «         | _        dS )zÒ
    Setup context for all_reduce backward.
    Args:
        ctx: Context object to save state for backward
        inputs: Tuple of (input, reduce_op, group_name)
        output: Output from forward pass
    N©rš   r)   r›   )r�   r_   r”   Úinputr›   rš   s         r   Úall_reduce_setup_contextr¢      s,   € ð $*Ñ €Eˆ9�jØ€C„NØ—O’OÑ%Ô%€C„M€M€Mr   z_c10d_functional::all_reducec                 ó´   — | j         }| j        }t          j        j                             |                     ¦   «         d||¦  «        }t          |¦  «        ddfS )aÄ  
    Backward for all_gather_into_tensor: reduce_scatter with sum.

    Forward gathers tensors from all ranks, backward scatters gradients back
    with sum reduction.

    Args:
        ctx: Context object with group_name and group_size
        grad_output: Gradient from downstream operations

    Returns:
        Tuple of (grad_input, grad_group_size, grad_group_name)
        grad_group_size and grad_group_name are None (not differentiable)
    r˜   N)rš   r7   r   r   r   rG   r�   r   )r�   r�   rš   r7   r”   s        r   Úall_gather_into_tensor_backwardr¤   ´  s]   € ð ”€JØ”€Jõ ŒYÔ'×=Ò=Ø×ÒÑ Ô ØØØñ	ô €Fõ �vÑÔ  dÐ*Ð*r   c                 ó.   — |\  }}}|| _         || _        dS )zà
    Setup context for all_gather_into_tensor backward.

    Args:
        ctx: Context object to save state for backward
        inputs: Tuple of (input, group_size, group_name)
        output: Output from forward pass
    N©rš   r7   )r�   r_   r”   r¡   r7   rš   s         r   Ú$all_gather_into_tensor_setup_contextr§   Ð  s"   € ð %+Ñ!€Eˆ:�zØ€C„NØ€C„N€N€Nr   z(_c10d_functional::all_gather_into_tensorc                 óô   — | j         }| j        }| j        }|dk    rt          d|› d�¦  «        ‚t          j        j                             |                     ¦   «         ||¦  «        }t          |¦  «        dddfS )aÜ  
    Backward for reduce_scatter_tensor: all_gather.

    Forward reduces and scatters tensors to ranks, backward gathers gradients
    from all ranks.

    Args:
        ctx: Context object with group_name, group_size, and reduce_op
        grad_output: Gradient from downstream operations

    Returns:
        Tuple of (grad_input, grad_reduce_op, grad_group_size, grad_group_name)
        grad_reduce_op, grad_group_size, grad_group_name are None (not differentiable)
    r˜   zCreduce_scatter_tensor backward only supports 'sum' reduction, got 'r™   N)
rš   r7   r›   rœ   r   r   r   r/   r�   r   )r�   r�   rš   r7   r›   r”   s         r   Úreduce_scatter_tensor_backwardr©   å  s‘   € ð ”€JØ”€JØ”€Ið �EÒÐÝØ^ÐR[Ð^Ð^Ð^ñ
ô 
ð 	
õ
 ŒYÔ'×>Ò>Ø×ÒÑ Ô ØØñô €Fõ
 �vÑÔ  d¨DÐ0Ð0r   c                 ób   — |\  }}}}|| _         || _        |                     ¦   «         | _        dS )zê
    Setup context for reduce_scatter_tensor backward.

    Args:
        ctx: Context object to save state for backward
        inputs: Tuple of (input, reduce_op, group_size, group_name)
        output: Output from forward pass
    N©rš   r7   r)   r›   )r�   r_   r”   r¡   r›   r7   rš   s          r   Ú#reduce_scatter_tensor_setup_contextr¬     s5   € ð 06Ñ,€Eˆ9�j *Ø€C„NØ€C„NØ—O’OÑ%Ô%€C„M€M€Mr   z'_c10d_functional::reduce_scatter_tensorc                 óÄ   — | j         }| j        }| j        }t          j        j                             |                     ¦   «         |||¦  «        }t          |¦  «        dddfS )aå  
    Backward for all_to_all_single: all_to_all with reversed split sizes.

    Forward does all-to-all with specified split sizes, backward reverses them.

    Args:
        ctx: Context object with group_name, output_split_sizes, and input_split_sizes
        grad_output: Gradient from downstream operations

    Returns:
        Tuple of (grad_input, grad_output_split_sizes, grad_input_split_sizes, grad_group_name)
        All except grad_input are None (not differentiable)
    N)	rš   r}   r~   r   r   r   rŠ   r�   r   )r�   r�   rš   r}   r~   r”   s         r   Úall_to_all_single_backwardr®     sj   € ð ”€JØÔ/ÐØÔ-Ðõ ŒYÔ'×9Ò9Ø×ÒÑ Ô ØØØñ	ô €Fõ �vÑÔ  d¨DÐ0Ð0r   c                 ó>   — |\  }}}}|| _         || _        || _        dS )zö
    Setup context for all_to_all_single backward.

    Args:
        ctx: Context object to save state for backward
        inputs: Tuple of (input, output_split_sizes, input_split_sizes, group_name)
        output: Output from forward pass
    N)rš   r}   r~   )r�   r_   r”   r¡   r}   r~   rš   s          r   Úall_to_all_single_setup_contextr°   9  s3   € ð @FÑ<€EÐÐ0°*Ø€C„NØ/€CÔØ-€CÔÐÐr   z#_c10d_functional::all_to_all_singlez1_c10d_functional_autograd::all_gather_into_tensorz0_c10d_functional_autograd::reduce_scatter_tensorz,_c10d_functional_autograd::all_to_all_singleÚgrad_outputsc                 óú   — | j         }| j        }|dk    rt          d|› d�¦  «        ‚t          j        j                             d„ |D ¦   «         ||¦  «        }t          t          t          |¦  «        ¦  «        ddfS )a·  
    Backward for all_reduce_coalesced: all_reduce each gradient.

    Forward aggregates tensors, backward aggregates gradients.

    Args:
        ctx: Context object with group_name and reduce_op
        grad_outputs: Gradients from downstream operations (one per input tensor)

    Returns:
        Tuple of (grad_inputs..., grad_reduce_op, grad_group_name)
        grad_reduce_op and grad_group_name are None (not differentiable)
    r˜   zBall_reduce_coalesced backward only supports 'sum' reduction, got 'r™   c                 ó6   — g | ]}|                      ¦   «         ‘ŒS r   ©r�   ©r†   r�   s     r   ú
<listcomp>z1all_reduce_coalesced_backward.<locals>.<listcomp>{  ó$   € ÐBÐBÐB kˆ×	Ò	Ñ	!Ô	!ÐBÐBÐBr   N)
rš   r›   rœ   r   r   r   rY   r2   rZ   r   )r�   r±   rš   r›   Úgrad_inputss        r   Úall_reduce_coalesced_backwardr¹   c  s’   € ð ”€JØ”€Ià�EÒÐÝØ]ÐQZÐ]Ð]Ð]ñ
ô 
ð 	
õ
 ”)Ô,×AÒAØBÐB°\ÐBÑBÔBØØñô €Kõ
 ••[ +Ñ.Ô.Ñ/Ô/°°tÐ<Ð<r   c                 óR   — |\  }}}|| _         |                     ¦   «         | _        dS )zã
    Setup context for all_reduce_coalesced backward.

    Args:
        ctx: Context object to save state for backward
        inputs: Tuple of (tensor_list, reduce_op, group_name)
        output: Output from forward pass
    Nr    )r�   r_   r”   r[   r›   rš   s         r   Ú"all_reduce_coalesced_setup_contextr»   ‚  s,   € ð *0Ñ&€K�˜JØ€C„NØ—O’OÑ%Ô%€C„M€M€Mr   z&_c10d_functional::all_reduce_coalescedc                 óÊ   — | j         }| j        }t          j        j                             d„ |D ¦   «         d||¦  «        }t          t          t          |¦  «        ¦  «        ddfS )að  
    Backward for all_gather_into_tensor_coalesced: reduce_scatter each gradient.

    Forward gathers tensors from all ranks, backward scatters gradients back
    with sum reduction.

    Args:
        ctx: Context object with group_name and group_size
        grad_outputs: Gradients from downstream operations (one per input tensor)

    Returns:
        Tuple of (grad_inputs..., grad_group_size, grad_group_name)
        grad_group_size and grad_group_name are None (not differentiable)
    c                 ó6   — g | ]}|                      ¦   «         ‘ŒS r   r´   rµ   s     r   r¶   z=all_gather_into_tensor_coalesced_backward.<locals>.<listcomp>«  r·   r   r˜   N)	rš   r7   r   r   r   rg   r2   rZ   r   )r�   r±   rš   r7   r¸   s        r   Ú)all_gather_into_tensor_coalesced_backwardr¾   —  si   € ð ”€JØ”€Jõ ”)Ô,×LÒLØBÐB°\ÐBÑBÔBØØØñ	ô €Kõ ••[ +Ñ.Ô.Ñ/Ô/°°tÐ<Ð<r   c                 ó.   — |\  }}}|| _         || _        dS )zð
    Setup context for all_gather_into_tensor_coalesced backward.

    Args:
        ctx: Context object to save state for backward
        inputs: Tuple of (tensor_list, group_size, group_name)
        output: Output from forward pass
    Nr¦   )r�   r_   r”   r[   r7   rš   s         r   Ú.all_gather_into_tensor_coalesced_setup_contextrÀ   ³  s"   € ð +1Ñ'€K�˜ZØ€C„NØ€C„N€N€Nr   z2_c10d_functional::all_gather_into_tensor_coalescedc                 ó
  — | j         }| j        }| j        }|dk    rt          d|› d�¦  «        ‚t          j        j                             d„ |D ¦   «         ||¦  «        }t          t          t          |¦  «        ¦  «        dddfS )a  
    Backward for reduce_scatter_tensor_coalesced: all_gather each gradient.

    Forward reduces and scatters tensors to ranks, backward gathers gradients
    from all ranks.

    Args:
        ctx: Context object with group_name, group_size, and reduce_op
        grad_outputs: Gradients from downstream operations (one per input tensor)

    Returns:
        Tuple of (grad_inputs..., grad_reduce_op, grad_group_size, grad_group_name)
        grad_reduce_op, grad_group_size, grad_group_name are None (not differentiable)
    r˜   zMreduce_scatter_tensor_coalesced backward only supports 'sum' reduction, got 'r™   c                 ó6   — g | ]}|                      ¦   «         ‘ŒS r   r´   rµ   s     r   r¶   z<reduce_scatter_tensor_coalesced_backward.<locals>.<listcomp>ã  r·   r   N)rš   r7   r›   rœ   r   r   r   r]   r2   rZ   r   )r�   r±   rš   r7   r›   r¸   s         r   Ú(reduce_scatter_tensor_coalesced_backwardrÃ   È  s�   € ð ”€JØ”€JØ”€Ið �EÒÐÝØhÐ\eÐhÐhÐhñ
ô 
ð 	
õ
 ”)Ô,×MÒMØBÐB°\ÐBÑBÔBØØñô €Kõ
 ••[ +Ñ.Ô.Ñ/Ô/°°t¸TÐBÐBr   c                 ób   — |\  }}}}|| _         || _        |                     ¦   «         | _        dS )zú
    Setup context for reduce_scatter_tensor_coalesced backward.

    Args:
        ctx: Context object to save state for backward
        inputs: Tuple of (tensor_list, reduce_op, group_size, group_name)
        output: Output from forward pass
    Nr«   )r�   r_   r”   r[   r›   r7   rš   s          r   Ú-reduce_scatter_tensor_coalesced_setup_contextrÅ   ê  s5   € ð 6<Ñ2€K�˜J¨
Ø€C„NØ€C„NØ—O’OÑ%Ô%€C„M€M€Mr   z1_c10d_functional::reduce_scatter_tensor_coalescedÚsrc_dstc                 óz  — t          ||¦  «        \  }}}t          j        |||¦  «        }dg|z  }dg|z  }	t          |¦  «        D ]c\  }
}|
t	          j        |¦  «        k    r|                      ¦   «         |	|<   |t	          j        |¦  «        k    r|                      ¦   «         ||
<   Œdt          | ||	||¦  «        S )a"  
    Permutes the elements of the tensor according to the given source/destination pairs. `src_dst` should
    be defined such that src_dst[m] == n means m sends to n.

    Group can be one of:
        List[int]: ranks participating in the collective.
        List[List[int]]: 2D mesh of ranks taking part of this collective in MPMD.
        ProcessGroup: Will perform a collective using the ranks and tag of the PG.
        DeviceMesh: Do a SPMD collective over all ranks of the mesh
        (DeviceMesh, int): Do a MPMD collective over one
    r   )Ú_expand_groupr-   Ú#_find_or_create_pg_by_ranks_and_tagrc   ÚdistÚget_rankÚnumelrŠ   )r   rÆ   r   r    ÚtÚranksetr7   Úlocal_pgr}   r~   r   Údsts               r   Úpermute_tensorrÑ      sÍ   € õ" +¨5°#Ñ6Ô6Ñ€A€w�
ÝÔ7¸¸7ÀJÑOÔO€Hà˜˜zÑ)ÐØ˜˜jÑ(ÐÝ˜gÑ&Ô&ð 3ð 3‰ˆˆSØ•$”- Ñ)Ô)Ò)Ð)Ø%)§Z¢Z¡\¤\Ð˜cÑ"Ø•$”- Ñ)Ô)Ò)Ð)Ø&*§j¢j¡l¤lÐ˜sÑ#øå˜TÐ#5Ð7HÈ%ÐQTÑUÔUÐUr   c                   óè   — e Zd ZU dZej        ed<   eed<   ddgZe	dej        fd„¦   «         Z
d„ Zd„ Ze	d„ ¦   «         Z	 dd	ed
edz  fd„Zdefd„Zd„ Zdej        fd„Zd„ Zedd„¦   «         Zd„ ZdS )r1   a¸  
    A Tensor wrapper subclass that is used to trigger a call to wait
    prior to first use of the underlying tensor.
    Use it inside functional collective pytorch wrappers like the following:
    def functional_collective(self, group, tag):
        tag, rankset, group_size = _expand_group(group, tag)
        tensor = torch.ops.c10d_functional.{collective}(self, tag, rankset, group_size)
        return _maybe_wrap_tensor(tensor)
    ÚelemÚ	completedc           
      ó  — t           j                             | |                     ¦   «         |                     ¦   «         |                     ¦   «         |j        |j        |j        |j	        ¬¦  «        }||_
        d|_        |S )N)ÚstridesÚstorage_offsetÚdtypeÚlayoutÚdeviceÚrequires_gradF)r   ÚTensorÚ_make_wrapper_subclassrE   Ústrider×   rØ   rÙ   rÚ   rÛ   rÓ   rÔ   )ÚclsrÓ   Úrs      r   Ú__new__zAsyncCollectiveTensor.__new__/  sp   € åŒL×/Ò/ØØ�IŠI‰KŒKØ—K’K‘M”MØ×.Ò.Ñ0Ô0Ø”*Ø”;Ø”;ØÔ,ð 0ñ 	
ô 	
ˆð ˆŒØˆŒØˆr   c                 ó   — dgd fS )NrÓ   r   ©r   s    r   Ú__tensor_flatten__z(AsyncCollectiveTensor.__tensor_flatten__?  s   € Øˆx˜ˆ~Ðr   c                 óN   — |                       ¦   «                              ¦   «         S r�   )Útrigger_waitÚtolistrã   s    r   rç   zAsyncCollectiveTensor.tolistB  s    € Ø× Ò Ñ"Ô"×)Ò)Ñ+Ô+Ð+r   c                 óR   — |�t          d¦  «        ‚| d         }t          |¦  «        S )Nz5meta must be None for AsyncCollectiveTensor unflattenrÓ   )rF   r1   )Úinner_tensorsÚmetaÚ
outer_sizeÚouter_striderÓ   s        r   Ú__tensor_unflatten__z*AsyncCollectiveTensor.__tensor_unflatten__E  s7   € àÐÝ ØGñô ð ð ˜VÔ$ˆÝ$ TÑ*Ô*Ð*r   NÚexpected_metadataÚexpected_typec                 óJ   — |t           j        urd S |                      ¦   «         S r�   )r   rÜ   ræ   )r   rî   rï   s      r   Ú#__coerce_same_metadata_as_tangent__z9AsyncCollectiveTensor.__coerce_same_metadata_as_tangent__N  s(   € ð ¥¤Ð,Ð,Ø�4à× Ò Ñ"Ô"Ð"r   r+   c                 ó2   — d|                       ¦   «         › d�S )NzAsyncCollectiveTensor(rB   )ræ   rã   s    r   Ú__repr__zAsyncCollectiveTensor.__repr__V  s   € Ø>¨×(9Ò(9Ñ(;Ô(;Ð>Ð>Ð>Ð>r   c                 óX   — | j         st          | j        ¦  «        }d| _         |S | j        S ©NT)rÔ   r   rÓ   )r   Úouts     r   ræ   z"AsyncCollectiveTensor.trigger_waitY  s/   € ØŒ~ð 	Ý˜dœiÑ(Ô(ˆCØ!ˆDŒNØˆJà”9Ðr   c                 ó*   — t          | j        ¦  «        S r�   )r   rÓ   rã   s    r   r6   zAsyncCollectiveTensor.waita  s   € Ý˜4œ9Ñ%Ô%Ð%r   c                 ó   — | j         S )zOThis method enables  _functional_collectives_impl to test if a tensor is an ACS)rÓ   rã   s    r   Ú_get_acs_underlying_tensorz0AsyncCollectiveTensor._get_acs_underlying_tensord  s
   € àŒyÐr   r   c                 ó˜  ‡— |t           j        j        j        j        u r. ||d         j        |d         ¦  «        }t          |¦  «        }|S t          |¦  «        Šdt          fˆfd„}dt           j        fd„}t          t          ||¦  «        }	t          t          ||¦  «        }
 ||	i |
¤Ž}‰rt          t           j        ||¦  «        }|S )Nr   r	   Úec                 ó>   •— ‰s|                       ¦   «         S | j        S r�   )ræ   rÓ   )rû   Ú
is_view_ops    €r   Úunwrapz8AsyncCollectiveTensor.__torch_dispatch__.<locals>.unwrapt  s"   ø€ àð (Ø—~’~Ñ'Ô'Ð'Ø”6ˆMr   c                 ól   — t          | t          ¦  «        rt          d¦  «        ‚t          | ¦  «        }|S )NzICannot wrap an AsyncCollectiveTensor inside another AsyncCollectiveTensor)r0   r1   rF   )rû   r8   s     r   Úwrapz6AsyncCollectiveTensor.__torch_dispatch__.<locals>.wrapz  s>   € å˜!Õ2Ñ3Ô3ð Ý$Ø_ñô ð õ (¨Ñ*Ô*ˆCØˆJr   )
r   r   ÚatenÚviewÚdefaultrÓ   r1   r|   rÜ   r   )rß   ÚfuncÚtypesÚargsÚkwargsr8   Úwrapper_resrþ   r   Úunwrapped_argsÚunwrapped_kwargsrö   rý   s               @r   Ú__torch_dispatch__z(AsyncCollectiveTensor.__torch_dispatch__h  sø   ø€ à•5”9”>Ô&Ô.Ð.Ð.ð �$�t˜A”w”| T¨!¤WÑ-Ô-ˆCÝ/°Ñ4Ô4ˆKØÐå  Ñ&Ô&ˆ
ð	Õ+ð 	ð 	ð 	ð 	ð 	ð 	ð	•E”Lð 	ð 	ð 	ð 	õ 'Õ'<¸fÀdÑKÔKˆÝ(Õ)>ÀÈÑOÔOÐð ˆd�NÐ7Ð&6Ð7Ð7ˆð ð 	9Ý¥¤¨d°CÑ8Ô8ˆCàˆ
r   c                 óN   — |                       ¦   «                              ¦   «         S r�   )r6   Únumpyrã   s    r   r  zAsyncCollectiveTensor.numpy�  s   € Ø�yŠy‰{Œ{× Ò Ñ"Ô"Ð"r   r�   )r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   rÜ   Ú__annotations__ÚboolÚ	__slots__Ústaticmethodrá   rä   rç   rí   r   ro   rñ   Ústrró   ræ   r6   rù   Úclassmethodr  r  r   r   r   r1   r1     s]  € € € € € € ðð ð Œ,ÐÐÑØ€O€O�Oà˜Ð%€Iàð˜5œ<ð ð ð ñ „\ððð ð ð,ð ,ð ,ð ð+ð +ñ „\ð+ð DHð#ð #Ø!$ð#Ø59¸D±[ð#ð #ð #ð #ð?˜#ð ?ð ?ð ?ð ?ðð ð ð&�e”lð &ð &ð &ð &ðð ð ð ð$ð $ð $ñ „[ð$ðL#ð #ð #ð #ð #r   r1   c           	      ó  — t           rd„ }d„ }nd„ }d„ }t          | t          ¦  «        r¬t          | d         t          ¦  «        ru || ¦  «        }g }d}|D ]a}|                     |¦  «         |dk    r5|t	          |¦  «        k    r"t          d|› dt	          |¦  «        › �¦  «        ‚t	          |¦  «        }Œb�nÉ || ¦  «        }t	          |¦  «        }�n­t          | t          j        ¦  «        r;t          j        | ¦  «        }t	          |¦  «        }|pt          j
        | ¦  «        }�nXt          | t          ¦  «        rh| j        d	k    rt          d
¦  «        ‚|                      ¦   «         }t          j        |¦  «        }t	          |¦  «        }|pt          j
        |¦  «        }nÛt          | t          ¦  «        r·t	          | ¦  «        dk    r•t          | d         t          ¦  «        rzt          | d	         t           ¦  «        r_| d         }	| d	         }
|	                     |
¦  «        }t          j        |¦  «        }t	          |¦  «        }|pt          j
        |¦  «        }nt          d¦  «        ‚t          d¦  «        ‚|||fS )a5  
    _expand_group desugars the different RANK_TYPES types into a canonical format that is traceable.

    By having this be part of the explicit eager codepath, we avoid having to specialize behavior inside
    torchdynamo and can still interoperate with processgroup objects or other untraceable forms.
    c                 óX   — t          t          t          t                            | ¦  «        S r�   ©r   r2   rƒ   ©Úxs    r   Úcast_listlistintz'_expand_group.<locals>.cast_listlistint¤  s   € Ý��T¥#œYœ¨Ñ+Ô+Ð+r   c                 óB   — t          t          t                   | ¦  «        S r�   r  r  s    r   Úcast_listintz#_expand_group.<locals>.cast_listint§  s   € Ý��Sœ	 1Ñ%Ô%Ð%r   c                 ó   — | S r�   r   r  s    r   r  z'_expand_group.<locals>.cast_listlistint®  ó   € ØˆHr   c                 ó   — | S r�   r   r  s    r   r  z#_expand_group.<locals>.cast_listint±  r!  r   r   éÿÿÿÿz$group sizes must be identical found z and r	   úJOnly 1D mesh is supported, pass in (DeviceMesh, int) together if mesh > 1Dr   z1Invalid tuple for group must be (DeviceMesh, int)z[Invalid type for group, must be one of List, Processgroup, DeviceMesh or (DeviceMesh, int).)r   r0   r2   Úextendrb   Ú
ValueErrorrÊ   ÚProcessGroupÚget_process_group_ranksr-   Ú_get_group_tagr   ÚndimrF   Ú	get_groupÚtuplerƒ   )r   r    r  r  Únested_listrÎ   r7   ÚrsÚpgÚdmeshra   s              r   rÈ   rÈ   ˜  sÁ  € õ ð ð	,ð 	,ð 	,ð	&ð 	&ð 	&ð 	&ð	ð 	ð 	ð	ð 	ð 	õ �%�ÑÔð -
Ý�e˜A”h¥Ñ%Ô%ð 	&Ø*Ð*¨5Ñ1Ô1ˆKØˆGØˆJØ!ð %ð %�Ø—’˜rÑ"Ô"Ð"Ø Ò#Ð#¨
µc¸"±g´gÒ(=Ð(=Ý$ØY¸zÐYÐYÕPSÐTVÑPWÔPWÐYÐYñô ð õ ! ™WœW�
�
ñ%ð #�l 5Ñ)Ô)ˆGÝ˜W™œˆJ‰JÝ	�E�4Ô,Ñ	-Ô	-ð 
ÝÔ.¨uÑ5Ô5ˆÝ˜‘\”\ˆ
ØÐ/•TÔ(¨Ñ/Ô/ˆ‰Ý	�E�:Ñ	&Ô	&ð 
ØŒ:˜Š?ˆ?Ý Ø\ñô ð ð �_Š_ÑÔˆÝÔ.¨rÑ2Ô2ˆÝ˜‘\”\ˆ
ØÐ,•TÔ(¨Ñ,Ô,ˆˆÝ	�E�5Ñ	!Ô	!ð 
å�‰JŒJ˜!ŠOˆOÝ˜5 œ8¥ZÑ0Ô0ð å˜5 œ8¥SÑ)Ô)ð ð ˜!”HˆEØ˜”(ˆCØ—’ Ñ%Ô%ˆBÝÔ2°2Ñ6Ô6ˆGÝ˜W™œˆJØÐ0�Ô,¨RÑ0Ô0ˆCˆCåÐPÑQÔQÐQåØiñ
ô 
ð 	
ð �˜*Ð%Ð%r   c                 ó~  — t          | t          j        ¦  «        r| S t          | t          ¦  «        rt	          t
          j        | ¦  «        }|S t          | t          ¦  «        r]| j        dk    rt          d¦  «        ‚t          j
        j        r%t          j        j                             | d¦  «        S | j        d         S t          | t"          ¦  «        rÖt%          | ¦  «        dk    r‰t          | d         t          ¦  «        rnt          | d         t&          ¦  «        rS| d         }| d         }t          j
        j        r%t          j        j                             ||¦  «        S |j        |         S t)          dt+          | d         ¦  «        t+          | d         ¦  «        f› �¦  «        ‚t          | t,          ¦  «        r]t/          ¦   «         st1          j        dt4          d¬¦  «         t          j        t	          t,          t&                   | ¦  «        |¦  «        S t)          d	t+          | ¦  «        › d
| › �¦  «        ‚)zI
    Given group in RANK_TYPES, return a ProcessGroup or group name.
    r	   r$  r   r   z?Invalid tuple for group must be (DeviceMesh, int). Instead got z—The combination of ranks + tag as process group identifier has been deprecated. Please switch to using ProcessGroup, DeviceMesh, or group name instead.é   r   zUnsupported group type: z, )r0   rÊ   r'  r  r   r-   Ú	GroupNamer   r*  rF   ÚconfigÚcompile_on_one_rankr   r   Ú_dtensorÚmesh_get_process_groupÚ_dim_group_namesr,  rb   rƒ   r&  ro   r2   r   rO   rP   rQ   Ú$_resolve_group_name_by_ranks_and_tag)r   r    rš   r0  ra   s        r   r"   r"   ç  s.  € õ �%�Ô*Ñ+Ô+ð 0LØˆÝ	�E�3Ñ	Ô	ð .Lõ �$œ.¨%Ñ0Ô0ˆ
ØÐÝ	�E�:Ñ	&Ô	&ð &LØŒ:˜Š?ˆ?Ý Ø\ñô ð õ Œ;Ô*ð 	GÝ”9Ô%×<Ò<¸UÀAÑFÔFÐFØÔ% aÔ(Ð(Ý	�E�5Ñ	!Ô	!ð Lå�‰JŒJ˜!ŠOˆOÝ˜5 œ8¥ZÑ0Ô0ð å˜5 œ8¥SÑ)Ô)ð ð ˜!”HˆEØ˜”(ˆCÝŒ{Ô.ð MÝ”yÔ)×@Ò@ÀÈÑLÔLÐLØÔ)¨#Ô.Ð.åØtÕSWÐX]Ð^_ÔX`ÑSaÔSaÕcgÐhmÐnoÔhpÑcqÔcqÐRrÐtÐtñô ð õ 
�E�4Ñ	 Ô	 ð LÝ'Ñ)Ô)ð 	ÝŒMðIõ Øðñ ô ð õ Ô8å••c”˜EÑ"Ô"Øñ
ô 
ð 	
õ ÐJµD¸±K´KÐJÐJÀ5ÐJÐJÑKÔKÐKr   c                 ó‚   — t          | |¦  «        } t          | t          ¦  «        rt          j        | ¦  «        S | j        S )z;
    Given group in RANK_TYPES, return the group name.
    )r"   r0   r  r-   r3  rš   )r   r    s     r   Ú_resolve_group_namer;  "  s>   € õ ˜5 #Ñ&Ô&€EÝ�%�ÑÔð  ÝŒ~˜eÑ$Ô$Ð$àÔÐr   z'_c10d_functional::_wrap_tensor_autogradr   z(Tensor input) -> Tensor)Úmutates_argsrz   r¡   c                 ó    — t          | ¦  «        S )ao  
    Custom op that allows autograd to propagate
    from a normal Tensor to an AsyncCollectiveTensor.

    This is the low-level implementation. Users should call _maybe_wrap_tensor directly.

    Args:
        input: Input tensor to wrap in AsyncCollectiveTensor

    Returns:
        AsyncCollectiveTensor wrapping the input (or wait_tensor result if tracing)
    )r1   ©r¡   s    r   Ú_wrap_tensor_autogradr?  -  s   € õ$ ! Ñ'Ô'Ð'r   c                 ó*   — t          j        | ¦  «        S )z0
    Meta kernel for _wrap_tensor_autograd.
    ©r   Ú
empty_liker>  s    r   Ú_rC  B  s   € õ
 Ô˜EÑ"Ô"Ð"r   c                 ó   — |S )a0  
    Backward for _wrap_tensor_autograd: identity (no-op).

    The wrapping is just for async optimization, gradients flow through unchanged.

    Args:
        ctx: Context object (unused)
        grad_output: Gradient from downstream operations

    Returns:
        Gradient unchanged (identity)
    r   r�   s     r   Ú_wrap_tensor_autograd_backwardrE  J  s
   € ð Ðr   c                 ó   — dS )zÚ
    Setup context for _wrap_tensor_autograd backward.

    Args:
        ctx: Context object to save state for backward (nothing to save)
        inputs: Tuple of (input,)
        output: Output from forward pass
    Nr   r“   s      r   Ú#_wrap_tensor_autograd_setup_contextrG  Z  s	   € ð €Fr   c                  ó  — t          ¦   «         rdS t          j                             t          j        j        j        ¦  «        �dS t          j                             t          j        j        j        ¦  «        rdS t          ¦   «         d uS rõ   )
r   r   rp   Ú_get_dispatch_modeÚ_TorchDispatchModeKeyÚFAKEÚ&_dispatch_tls_is_dispatch_key_includedrs   ÚPythonDispatcherr   r   r   r   Ú_are_we_tracingrN  l  su   € ÝÑ!Ô!ð Øˆtå„x×"Ò"¥5¤8Ô#AÔ#FÑGÔGÐSØˆtå„x×6Ò6ÝŒÔÔ-ñô ð ð ˆtÝÑÔ 4Ð'Ð'r   c                 óZ   — t          ¦   «         rt          | ¦  «        S t          | ¦  «        S r�   )rN  r   r?  rã   s    r   r%   r%   z  s,   € ÝÑÔð !Ý˜4Ñ Ô Ð Ý  Ñ&Ô&Ð&r   TÚvaluec              #   ó<  K  — t           j        j                             ¦   «         }	 t           j        j                             | ¦  «         dV — t           j        j                             |¦  «         dS # t           j        j                             |¦  «         w xY w)aC  
    Context manager to temporarily set whether inflight collectives are allowed as torch.compile graph inputs.
    Common use case is when the collective is issued in eager (with `async_op=True`) but waited in compiled region:
    ```
    def all_reduce_eager(x):
        y = x * x
        req = dist.all_reduce(y, op=dist.ReduceOp.SUM, async_op=True)
        return y


    @torch.compile(fullgraph=True)
    def all_reduce_wait_compiled(y):
        torch.ops.c10d_functional.wait_tensor(y)
        return y * y


    x = torch.ones(1280, 1280, device="cuda") + self.rank
    # the context manager ensures that `wait_tensor(y)` will wait on the correct work object
    with allow_inflight_collective_as_graph_input_ctx():
        y = all_reduce_eager(x)
        z = all_reduce_wait_compiled(y)
    ```
    With this context manager, when a collective is called, under the hood the work object of the collective
    will be registered in the work registry, and the wait_tensor() in compiled region called on
    the output tensor of the collective will wait on the correct work object.
    N)r   rp   Ú_distributed_c10dÚ)_allow_inflight_collective_as_graph_inputÚ-_set_allow_inflight_collective_as_graph_input)rP  Úpreviouss     r   Ú,allow_inflight_collective_as_graph_input_ctxrV  €  s˜   è è € õ8 ŒxÔ)×SÒSÑUÔU€Hð
ÝŒÔ"×PÒPÐQVÑWÔWÐWØˆˆˆåŒÔ"×PÒPØñ	
ô 	
ð 	
ð 	
ð 	
ø�ŒÔ"×PÒPØñ	
ô 	
ð 	
ð 	
øøøs   §(A5 Á5&Bc                 óä   — t          |                      ¦   «         ¦  «        }t          |¦  «        dk    r|                     |¦  «         n|dxx         |z  cc<   |                      |¦  «        }|S ©Nr   )r2   rE   rb   ÚappendÚ	new_empty)r¡   r7   Úout_sizeÚ
out_tensors       r   Ú_make_all_gather_out_tensorr]  §  sj   € Ý�E—J’J‘L”LÑ!Ô!€HÝ
ˆ8�}„}˜ÒÐØ�Š˜
Ñ#Ô#Ð#Ð#à�ˆˆŒ�zÑ!ˆˆ‰Ø—’ Ñ*Ô*€JØÐr   c                 ó    ‡— ˆfd„| D ¦   «         S )Nc                 ó0   •— g | ]}t          |‰¦  «        ‘ŒS r   ©r]  )r†   rÍ   r7   s     €r   r¶   z:_all_gather_into_tensor_coalesced_meta.<locals>.<listcomp>²  s$   ø€ ÐEÐEÐE¸1Õ'¨¨:Ñ6Ô6ÐEÐEÐEr   r   )r   r    rÎ   r7   s      `r   Ú&_all_gather_into_tensor_coalesced_metara  ±  s   ø€ ØEÐEÐEÐEÀÐEÑEÔEÐEr   c                 ó*   — t          j        | ¦  «        S r�   rA  ©r   r  s     r   Ú_broadcast_metard  ¶  ó   € ÝÔ˜DÑ!Ô!Ð!r   c                 óB   — t          j        | t           j        ¬¦  «        S )N)Úmemory_format)r   rB  Úcontiguous_formatrc  s     r   Ú_all_reduce_metari  º  s   € ÝÔ˜DµÔ0GÐHÑHÔHÐHr   c                 ó*   — t          j        | ¦  «        S r�   rA  rc  s     r   Ú_wait_tensor_metark  ¾  re  r   c                 óD   — t          j        d| j        | j        ¬¦  «        S )Nr   ©rØ   rÚ   ©r   ÚemptyrØ   rÚ   rc  s     r   Ú_isend_metarp  Â  s   € ÝŒ;�q ¤
°4´;Ð?Ñ?Ô?Ð?r   c                 ó*   — t          j        | ¦  «        S r�   rA  rc  s     r   Ú_irecv_metarr  Æ  re  r   c                 ó6   — d„ t          | |¦  «        D ¦   «         S )Nc                 óf   — g | ].\  }}|d k    r|n t          j        d|j        |j        ¬¦  «        ‘Œ/S )Úirecvr   rm  rn  ©r†   ÚoprÍ   s      r   r¶   z'_batch_p2p_ops_meta.<locals>.<listcomp>Ë  sM   € ð ð ð áˆB�ð �7Š]ˆ]ˆˆ¥¤¨A°Q´WÀQÄXÐ NÑ NÔ Nðð ð r   )rd   )Úop_listÚ	peer_listÚtag_listÚtensorsrš   s        r   Ú_batch_p2p_ops_metar|  Ê  s-   € ðð å˜ 'Ñ*Ô*ðñ ô ð r   c                 ó"   — t          | |¦  «        S r�   r`  )Úshardr    rÎ   r7   s       r   Ú_all_gather_into_tensor_metar  Ñ  ó   € Ý& u¨jÑ9Ô9Ð9r   c                 óŽ   — t          |                      ¦   «         ¦  «        }|dxx         |z  cc<   |                      |¦  «        S rX  ©r2   rE   rZ  )r¡   r›   r    rÎ   r7   r[  s         r   Ú_reduce_scatter_tensor_metarƒ  Õ  s?   € Ý�E—J’J‘L”LÑ!Ô!€HØˆQ€K€K„K�JÑ€K€K�KØ�?Š?˜8Ñ$Ô$Ð$r   c                 ó   — d„ | D ¦   «         S )Nc                 ó6   — g | ]}t          j        |¦  «        ‘ŒS r   rA  )r†   rÍ   s     r   r¶   z._all_reduce_coalesced_meta.<locals>.<listcomp>Ü  s#   € Ð.Ð.Ð. A�EÔ˜QÑÔÐ.Ð.Ð.r   r   rc  s     r   Ú_all_reduce_coalesced_metar†  Û  s   € Ø.Ð.¨Ð.Ñ.Ô.Ð.r   c                 ó   — | S r�   r   ©Úinpr  s     r   Ú_all_reduce__metarŠ  ß  ó   € Ø€Jr   c                 ó   — | S r�   r   rˆ  s     r   Ú_broadcast__metar�  ã  r‹  r   c                 ó   — | S r�   r   )r_   r  s     r   Ú_all_reduce_coalesced__metar�  ç  s   € Ø€Mr   c                 ó,   ‡‡— ˆfd„Šˆfd„| D ¦   «         S )Nc                 ó”   •— t          |                      ¦   «         ¦  «        }|dxx         ‰z  cc<   |                      |¦  «        }|S rX  r‚  )r¡   r[  r\  r7   s      €r   Úmk_out_tensorz<_reduce_scatter_tensor_coalesced_meta.<locals>.mk_out_tensorì  sE   ø€ Ý˜Ÿ
š
™œÑ%Ô%ˆØ�ˆˆŒ˜
Ñ"ˆˆ‰Ø—_’_ XÑ.Ô.ˆ
ØÐr   c                 ó&   •— g | ]} ‰|¦  «        ‘ŒS r   r   )r†   rÍ   r’  s     €r   r¶   z9_reduce_scatter_tensor_coalesced_meta.<locals>.<listcomp>ò  s#   ø€ Ð-Ð-Ð- ˆMˆM˜!ÑÔÐ-Ð-Ð-r   r   )r_   r&   r    rÎ   r7   r’  s       `@r   Ú%_reduce_scatter_tensor_coalesced_metar”  ë  s9   øø€ ðð ð ð ð ð .Ð-Ð-Ð- fÐ-Ñ-Ô-Ð-r   c                 ó  — |€'|                       |                      ¦   «         ¦  «        S |D ]}t          j        |dk    ¦  «         Œt	          |                      ¦   «         ¦  «        }t          |¦  «        |d<   |                       |¦  «        S rX  )rZ  rE   r   Ú_checkr2   r˜   )r¡   r}   r~   r  r  Úsr[  s          r   Ú_all_to_all_single_metar˜  ú  sƒ   € ð Ð!Ø�Š˜uŸzšz™|œ|Ñ,Ô,Ð,à#ð 	!ð 	!ˆAÝŒL˜˜ašÑ Ô Ð Ð Ý˜Ÿ
š
™œÑ%Ô%ˆÝÐ,Ñ-Ô-ˆ�‰Ø�Š˜xÑ(Ô(Ð(r   c                ó"   — t          | |¦  «        S r�   r`  )r¡   r7   rš   rö   s       r   Ú'_all_gather_into_tensor_out_native_metarš    r€  r   c                 ó"   — t          | |¦  «        S r�   r`  )r¡   r7   rš   s      r   Ú#_all_gather_into_tensor_native_metarœ    r€  r   c                 ó$   ‡‡— ˆˆfd„| D ¦   «         S )Nc                 ó2   •— g | ]}t          |‰‰¦  «        ‘ŒS r   )rœ  )r†   r¡   rš   r7   s     €€r   r¶   zA_all_gather_into_tensor_coalesced_native_meta.<locals>.<listcomp>  s5   ø€ ð ð ð àõ 	,¨E°:¸zÑJÔJðð ð r   r   )r_   r7   rš   s    ``r   Ú-_all_gather_into_tensor_coalesced_native_metarŸ    s4   øø€ ðð ð ð ð àðñ ô ð r   c                 óŽ   — t          |                      ¦   «         ¦  «        }|dxx         |z  cc<   |                      |¦  «        S rX  r‚  )r‰  r›   r7   rš   r3   s        r   Ú"_reduce_scatter_tensor_native_metar¡    s?   € Ý�—’‘”ÑÔ€EØ	ˆ!€H€H„H�Ñ€H€H�HØ�=Š=˜ÑÔÐr   c                óŽ   — t          |                      ¦   «         ¦  «        }|dxx         |z  cc<   |                      |¦  «        S rX  r‚  )r‰  r›   r7   rš   rö   r3   s         r   Ú&_reduce_scatter_tensor_out_native_metar£    sA   € õ �—’‘”ÑÔ€EØ	ˆ!€H€H„H�Ñ€H€H�HØ�=Š=˜ÑÔÐr   c                 ó(   ‡‡‡— ˆˆˆfd„| D ¦   «         S )Nc                 ó4   •— g | ]}t          |‰‰‰¦  «        ‘ŒS r   )r¡  )r†   r‰  rš   r7   r›   s     €€€r   r¶   z@_reduce_scatter_tensor_coalesced_native_meta.<locals>.<listcomp>'  s7   ø€ ð ð ð àõ 	+¨3°	¸:ÀzÑRÔRðð ð r   r   )r_   r›   r7   rš   s    ```r   Ú,_reduce_scatter_tensor_coalesced_native_metar¦  $  s:   øøø€ ðð ð ð ð ð àðñ ô ð r   r   ÚIMPLr(   ÚMetaÚall_reduce_rY   Úall_reduce_coalesced_r   Úisendru  Úbatch_p2p_opsÚall_gather_into_tensor_outr/   r]   rG   Úreduce_scatter_tensor_outrg   rŠ   r#   Ú
broadcast_Ú_c10d_functional_autogradÚc10d_functionalÚDEF)zObroadcast(Tensor self, int src, str tag, int[] ranks, int group_size) -> TensorzUall_reduce(Tensor self, str reduceOp, str tag, int[] ranks, int group_size) -> Tensorzcall_reduce_coalesced(Tensor[] self, str reduceOp, str tag, int[] ranks, int group_size) -> Tensor[]z"wait_tensor(Tensor self) -> Tensorz>isend(Tensor self, int dst, int tag, str group_name) -> Tensorz>irecv(Tensor self, int src, int tag, str group_name) -> Tensorzkbatch_p2p_ops(str[] op_list, int[] peer_list, int[] tag_list, Tensor[] tensors, str group_name) -> Tensor[]zTall_gather_into_tensor(Tensor shard, str tag, int[] ranks, int group_size) -> Tensorzball_gather_into_tensor_coalesced(Tensor[] input, str tag, int[] ranks, int group_size) -> Tensor[]zareduce_scatter_tensor(Tensor input, str reduceOp, str tag, int[] ranks, int group_size) -> Tensorzpreduce_scatter_tensor_coalesced(Tensor[] inputs, str reduceOp, str tag, int[] ranks, int group_size) -> Tensor[]zŠall_to_all_single(Tensor input, SymInt[]? output_split_sizes, SymInt[]? input_split_sizes, str tag, int[] ranks, int group_size) -> Tensorú(rC  )Útagsrt   FÚoutput_tensorÚinput_tensorÚasync_opc                 ó¶   — |rt          d¦  «        ‚|pt          j        j        }|€t          d¦  «        ‚|                      t          ||||¦  «        ¦  «        S ©Nú@Can't remap async version of inplace op to functional collectiveúgroup cannot be None)rF   rÊ   r   ÚWORLDÚcopy_r;   )rµ  r¶  r   r·  r    r*   s         r   Úall_gather_tensor_inplacer¾  Œ  sj   € ð ð 
ÝØNñ
ô 
ð 	
ð Ð%•T”ZÔ%€EØ€}ÝÐ3Ñ4Ô4Ð4à×ÒÕ0°¸zÈ5ÐRUÑVÔVÑWÔWÐWr   r˜   r”   rw  c           	      ó¸   — |rt          d¦  «        ‚|pt          j        j        }|€t          d¦  «        ‚|                      t          |||||¦  «        ¦  «        S r¹  )rF   rÊ   r   r¼  r½  rH   )r”   r¡   rw  r   r·  r?   r    s          r   Úreduce_scatter_tensor_inplacerÀ     si   € ð ð 
ÝØNñ
ô 
ð 	
ð Ð%•T”ZÔ%€EØ€}ÝÐ3Ñ4Ô4Ð4à�<Š<Õ-¨e°R¸ÀeÈSÑQÔQÑRÔRÐRr   ÚavgÚproductÚminÚmaxÚbandÚborÚbxorr   c                 ó¶   — |rt          d¦  «        ‚|pt          j        j        }|€t          d¦  «        ‚|                      t          | |||¦  «        ¦  «        S r¹  )rF   rÊ   r   r¼  r½  r(   )r   rw  r   r·  r    s        r   Úall_reduce_inplacerÉ  Á  sf   € ð ð 
ÝØNñ
ô 
ð 	
ð Ð%•T”ZÔ%€EØ€}ÝÐ3Ñ4Ô4Ð4à�<Š<�
 6¨2¨u°cÑ:Ô:Ñ;Ô;Ð;r   c           	      ó¸   — |rt          d¦  «        ‚|pt          j        j        }|€t          d¦  «        ‚|                      t          |||||¦  «        ¦  «        S r¹  )rF   rÊ   r   r¼  r½  rŠ   )r”   r¡   r}   r~   r   r·  r    s          r   Úall_to_all_inplacerË  Ô  sx   € ð ð 
ÝØNñ
ô 
ð 	
ð Ð%•T”ZÔ%€EØ€}ÝÐ3Ñ4Ô4Ð4à�<Š<ÝØØØØØñ	
ô 	
ñô ð r   r[   c                 óF  ‡— |rt          d¦  «        ‚‰                     ¦   «         dk    r*t          ˆfd„| D ¦   «         ¦  «        st          d¦  «        ‚|pt          j        j        }|€t          d¦  «        ‚t          ‰d||¦  «        }g }d}| D ]d}|                     ¦   «         dk    }	|	rdn|                     d¦  «        }
|	r||         n||||
z   …         }|                     |¦  «         ||
z  }Œet          | |¦  «        D ]\  }}| 
                    |¦  «         Œ| S )Nrº  r   c              3   óp   •K  — | ]0}|                      d ¦  «        ‰                      d ¦  «        k    V — Œ1dS )r   N)rE   )r†   rÍ   r   s     €r   r‡   z%all_gather_inplace.<locals>.<genexpr>ü  s<   øè è € Ð$VÐ$VÀQ Q§V¢V¨A¡Y¤Y°&·+²+¸a±.´.Ò%@Ð$VÐ$VÐ$VÐ$VÐ$VÐ$Vr   z7Remapping variable size all_gather is not yet supportedr»  r	   )rF   ra   r‰   rÊ   r   r¼  r;   rE   rY  rd   r½  )r[   r   r   r·  r    r”   Úoutput_splitsÚoffsetrÍ   Ú	is_scalarÚt_offsetrö   rÐ   r   s    `            r   Úall_gather_inplacerÒ  ñ  sW  ø€ ð ð 
ÝØNñ
ô 
ð 	
ð ‡z‚z�|„|�qÒÐ¥Ð$VÐ$VÐ$VÐ$VÈ+Ð$VÑ$VÔ$VÑ!VÔ!VÐÝÐVÑWÔWÐWàÐ%•T”ZÔ%€EØ€}ÝÐ3Ñ4Ô4Ð4å˜v q¨%°Ñ5Ô5€Fð €MØ€FØð ð ˆØ—E’E‘G”G˜q’Lˆ	Ø!Ð0�1�1 q§v¢v¨a¡y¤yˆà )ÐQˆf�VŒnˆn¨v°f¸vÈÑ?PÐ6PÔ/QˆØ×Ò˜SÑ!Ô!Ð!à�(ÑˆˆÝ˜ ]Ñ3Ô3ð ð ‰ˆˆSØ�	Š	�#‰ŒˆˆØÐr   r#  rÐ   Ú	group_dstc                 óR  — |€t           j        j        }|€t          d¦  «        ‚|dk    r'|�t	          d¦  «        ‚t          j        ||¦  «        }n|}t          |¦  «        }t          j	        j
                             | |||¦  «        } t          ¦   «         r| S t          | ¦  «        S )Nr»  r#  z@Cannot specify both 'dst' and 'group_dst' args as per eager impl)rÊ   r   r¼  rF   r&  r-   Úget_global_rankr;  r   r   r   r«  rN  r%   )r   rÐ   r    r   rÓ  Ú
global_dstrš   s          r   Úisend_inplacer×    s±   € ð €}Ý”
Ô ˆØ€}ÝÐ3Ñ4Ô4Ð4Ø�B‚€Øˆ?ÝØRñô ð õ Ô)¨%°Ñ;Ô;ˆ
ˆ
àˆ
å$ UÑ+Ô+€JÝŒYÔ'×-Ò-¨f°jÀ#ÀzÑRÔR€FÝÑÔð ØˆÝ˜fÑ%Ô%Ð%r   Ú	group_srcc                 ó2  — |€t           j        j        }|€t          d¦  «        ‚|dk    r'|�t	          d¦  «        ‚t          j        ||¦  «        }n|}t          |¦  «        }t          j	        j
                             | |||¦  «        } t          | ¦  «        S )Nr»  r#  z@Cannot specify both 'src' and 'group_src' args as per eager impl)rÊ   r   r¼  rF   r&  r-   rÕ  r;  r   r   r   ru  r%   )r   r   r    r   rØ  Ú
global_srcrš   s          r   Úirecv_inplacerÛ  1  sž   € ð €}Ý”
Ô ˆØ€}ÝÐ3Ñ4Ô4Ð4Ø�B‚€Øˆ?ÝØRñô ð õ Ô)¨%°Ñ;Ô;ˆ
ˆ
àˆ
Ý$ UÑ+Ô+€JÝŒYÔ'×-Ò-¨f°jÀ#ÀzÑRÔR€FÝ˜fÑ%Ô%Ð%r   rx  ry  rz  r{  rš   c                 óº  — t          j        ¦   «         st          d¦  «        ‚|�|dk    rt          j        ¦   «         }t          |¦  «        }t          |t          ¦  «        r|n|j        }t          j
        j                             | ||||¦  «        }t          ¦   «         rd„ t          | |¦  «        D ¦   «         S t          t!          t"          |¦  «        ¦  «        S )Nz%torch.distributed must be initializedr   c                 óB   — g | ]\  }}|d k    rt          |¦  «        n|‘ŒS )ru  )r%   rv  s      r   r¶   z)batch_p2p_ops_inplace.<locals>.<listcomp>Z  sB   € ð 
ð 
ð 
á��Að &(¨7¢] ]Õ˜qÑ!Ô!Ð!¸ð
ð 
ð 
r   )rÊ   Úis_initializedrF   r-   Ú_get_default_groupr"   r0   r  rš   r   r   r   r¬  rN  rd   r2   rZ   r%   )rx  ry  rz  r{  rš   Úresolveds         r   Úbatch_p2p_ops_inplacerá  I  sæ   € õ ÔÑ Ô ð FÝÐDÑEÔEÐEØÐ˜Z¨2Ò-Ð-ÝÔ,Ñ.Ô.ˆ
Ý˜jÑ)Ô)€HÝ'¨µ#Ñ6Ô6ÐO��¸HÔ<O€JÝŒiÔ(×6Ò6Ø�˜H g¨zñô €Gõ ÑÔð 
ð
ð 
å˜W gÑ.Ô.ð
ñ 
ô 
ð 	
õ •Õ&¨Ñ0Ô0Ñ1Ô1Ð1r   c                 ód   — t          | t          ¦  «        r| S t          j        j        r| S | j        S r�   )r0   r  rÊ   r4  r5  rš   )r   s    r   r$   r$   a  s6   € õ �%�ÑÔð  ØˆÝ	ŒÔ	(ð  ØˆàÔÐr   )Ú_all_gather_baseÚ_reduce_scatter_baseÚ
all_gatherr/   r;   r(   rŠ   Úbatch_isend_irecvru  r«  rH   rG   c                  óX   — t          ¦   «         st          d¦  «        ‚t          | i |¤Ž d S )Nz8_remapped_allgather should only be called during tracing)rN  rF   r¾  ©r  r  s     r   Ú_remapped_allgatherré  „  s9   € ÝÑÔð YÝÐWÑXÔXÐXÝ˜tÐ. vÐ.Ð.Ð.Ð.Ð.r   c                  óX   — t          ¦   «         st          d¦  «        ‚t          | i |¤Ž d S )Nz<_remapped_reducescatter should only be called during tracing)rN  rF   rÀ  rè  s     r   Ú_remapped_reducescatterrë  Š  s@   € ÝÑÔð 
ÝØJñ
ô 
ð 	
õ " 4Ð2¨6Ð2Ð2Ð2Ð2Ð2r   c                  óX   — t          ¦   «         st          d¦  «        ‚t          | i |¤Ž d S )Nz8_remapped_allreduce should only be called during tracing)rN  rF   rÉ  rè  s     r   Ú_remapped_allreducerí  ’  s9   € ÝÑÔð YÝÐWÑXÔXÐXÝ˜Ð' Ð'Ð'Ð'Ð'Ð'r   c                  óX   — t          ¦   «         st          d¦  «        ‚t          | i |¤Ž d S )Nz@_remapped_all_to_all_single should only be called during tracing)rN  rF   rË  rè  s     r   Ú_remapped_all_to_all_singlerï  ˜  s@   € ÝÑÔð 
ÝØNñ
ô 
ð 	
õ ˜Ð' Ð'Ð'Ð'Ð'Ð'r   c                  óX   — t          ¦   «         st          d¦  «        ‚t          | i |¤Ž d S )Nz9_remapped_all_gather should only be called during tracing)rN  rF   rÒ  rè  s     r   Ú_remapped_all_gatherrñ     s@   € ÝÑÔð 
ÝØGñ
ô 
ð 	
õ ˜Ð' Ð'Ð'Ð'Ð'Ð'r   c                  óT   — t          ¦   «         st          d¦  «        ‚t          | i |¤ŽS )Nz4_remapped_isend should only be called during tracing)rN  rF   r×  rè  s     r   Ú_remapped_isendró  ¨  ó3   € ÝÑÔð UÝÐSÑTÔTÐTÝ˜$Ð) &Ð)Ð)Ð)r   c                  óT   — t          ¦   «         st          d¦  «        ‚t          | i |¤ŽS )Nz4_remapped_irecv should only be called during tracing)rN  rF   rÛ  rè  s     r   Ú_remapped_irecvrö  ®  rô  r   c                  óT   — t          ¦   «         st          d¦  «        ‚t          | i |¤ŽS )Nz<_remapped_batch_p2p_ops should only be called during tracing)rN  rF   rá  rè  s     r   Ú_remapped_batch_p2p_opsrø  ´  s:   € ÝÑÔð 
ÝØJñ
ô 
ð 	
õ ! $Ð1¨&Ð1Ð1Ð1r   )r   )T)NFr   r   )r˜   NFr   r   )r˜   NFr   )NNNFr   )NFr   )r   Nr#  )½Ú
contextlibr4   ÚsysrO   Útypingr   r   r   r   Útorch.distributedÚdistributedrÊ   Ú"torch.distributed.distributed_c10dÚdistributed_c10dr-   Útorch._utilsr   Útorch.distributed.device_meshr   Ú"torch.fx.experimental.proxy_tensorr   r   r
   Úfun_col_implÚtorch.utils._cxx_pytreer   ÚImportErrorÚtorch.utils._pytreeÚtorch.compilerr   r   Ú	ExceptionrP   r2   rƒ   r'  r,  r3  Ú
RANK_TYPESr   r   rÜ   r  r#   r(   r;   r>   rH   rK   rR   rT   rG   rW   rY   r^   ri   r]   rg   r|   rŠ   rŒ   r‘   r•   ÚlibraryÚregister_autogradrž   r¢   r¤   r§   r©   r¬   r®   r°   r¹   r»   r¾   rÀ   rÃ   rÅ   rÑ   r1   rÈ   r"   r;  Ú	custom_opr?  Úregister_fakerC  rE  rG  r  rN  r%   ÚcontextmanagerrV  r]  ra  rd  ri  rk  rp  rr  r|  r  rƒ  r†  rŠ  r�  r�  r”  r˜  rš  rœ  rŸ  r¡  r£  r¦  ÚLibraryÚlib_implÚimplÚlib_impl_autogradÚfxÚnodeÚhas_side_effectr   r   r  r«  ru  r¬  Ú
legacy_libÚlegacy_lib_implÚops_defsÚmodulesr  Ú	my_moduleÚop_defÚindexÚop_nameÚgetattrÚbackend_implÚdefineÚTagÚpt2_compliant_tagr¾  rÀ  ÚReduceOpÚSUMÚAVGÚPRODUCTÚMINÚMAXÚBANDÚBORÚBXORÚREDUCE_OP_TO_STRrÉ  rË  rÒ  r×  rÛ  rá  r$   rã  Úlegacy_all_gather_baserä  Úlegacy_reduce_scatter_baserå  Úlegacy_all_gatherr/   Úlegacy_allgatherÚlegacy_allgather_singleÚlegacy_allreduceÚlegacy_all_to_all_singleræ  Úlegacy_batch_p2p_opsÚlegacy_irecvÚlegacy_isendÚlegacy_reducescatter_singleÚlegacy_reducescatterré  rë  rí  rï  rñ  ró  rö  rø  Útraceable_collective_remapsr   r   r   ú<module>r:     sË  ðà Ð Ð Ð Ø €€€Ø 
€
€
€
Ø €€€Ø +Ð +Ð +Ð +Ð +Ð +Ð +Ð +Ð +Ð +à €€€Ø  Ð  Ð  Ð  Ð  Ð  Ø 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø .Ð .Ð .Ð .Ð .Ð .Ø 4Ð 4Ð 4Ð 4Ð 4Ð 4Ø =Ð =Ð =Ð =Ð =Ð =à :Ð :Ð :Ð :Ð :Ð :ð2Ø5Ð5Ð5Ð5Ð5Ð5Ð5øØð 2ð 2ð 2Ø1Ð1Ð1Ð1Ð1Ð1Ð1Ð1ð2øøøðØNÐNÐNÐNÐNÐNÐNøØð 	ð 	ð 	Ø€H„MØnØðñ ô ð ð
ð ð ð ð ð	øøøðð#ðJð 	ˆ„IØ
ˆ4�Œ9„oñà
Ôñð ñð Ð$ cÐ)Ô*ñ	+ð
 „nñð ð .Ð -Ð -Ð -Ð -Ð -ðð::ð :ð :ð&ð &�E”Lð & sð &°:ð &ÀCð &ð &ð &ð &ð &ð &�U”\ð &¨Sð &¸ð &È#ð &ð &ð &ð &ð8 ð	'ð 'Ø
Œ,ð'àð'ð ð'ð 
ð	'ð
 „\ð'ð 'ð 'ð 'ð\ ð	;ð ;Ø
Œ,ð;àð;ð ð;ð 
ð	;ð ;ð ;ð ;ð2 ð'ð 'Ø
Œ,ð'àð'ð ð'ð ð	'ð
 
ð'ð 'ð 'ð 'ð^ ðJð JØ
Œ,ðJàðJð ðJð ð	Jð
 
ðJð Jð Jð Jð@ ð	;ð ;Ø
Œ,ð;àð;ð ð;ð 
ð	;ð
 „\ð;ð ;ð ;ð ;ð( ð	Dð DØ
Œ,ðDàðDð ðDð 
ð	Dð Dð Dð Dð* ðJð JØ
Œ,ðJàðJð ðJð ð	Jð
 
ðJð Jð Jð Jð, ðSð SØ
Œ,ðSàðSð ðSð ð	Sð
 
ðSð Sð Sð Sð$ LNð6ð 6Ø
ˆuŒ|Ô
ð6Ø(+ð6Ø4>ð6ØEHð6à	ˆ%Œ,Ôð6ð 6ð 6ð 6ð: =?ð6ð 6Ø
ˆuŒ|Ô
ð6Ø%/ð6Ø69ð6à	ˆ%Œ,Ôð6ð 6ð 6ð 6ðD ð-6ð -6Ø�”Ôð-6àð-6ð �c”ð-6ð ð	-6ð
 
ð-6ð 
ˆ%Œ,Ôð-6ð -6ð -6ð -6ðh =?ð
9ð 
9Ø
ˆuŒ|Ô
ð
9Ø%/ð
9Ø69ð
9à	ˆ%Œ,Ôð
9ð 
9ð 
9ð 
9ð$ ðVð VØ�”ÔðVàðVð �c”ðVð ð	Vð
 
ðVð 
ˆ%Œ,ÔðVð Vð Vð Vð&Vð Vð Vð* ð2&ð 2&Ø
Œ,ð2&à˜Sœ	 DÑ(ð2&ð ˜C”y 4Ñ'ð2&ð ð	2&ð
 
ð2&ð „\ð2&ð 2&ð 2&ð 2&ðt ðVð VØ
Œ,ðVà˜Sœ	 DÑ(ðVð ˜C”y 4Ñ'ðVð ð	Vð
 
ðVð „\ðVð Vð Vð Vð&¨5¬<ð ð ð ð ðð ð ð „× Ò Ø#ØØ+ð  ñ ô ð ð+¨%¬,ð +ð +ð +ð +ð8
&ð 
&ð 
&ð „× Ò Ø"ØØ*ð  ñ ô ð ð+°e´lð +ð +ð +ð +ð8 ð  ð  ð „× Ò Ø.Ø#Ø6ð  ñ ô ð ð1°U´\ð 1ð 1ð 1ð 1ðD&ð &ð &ð „× Ò Ø-Ø"Ø5ð  ñ ô ð ð1°´ð 1ð 1ð 1ð 1ð8.ð .ð .ð „× Ò Ø)ØØ1ð  ñ ô ð ð „× Ò Ø7Ø#Ø6ð  ñ ô ð ð „× Ò Ø6Ø"Ø5ð  ñ ô ð ð „× Ò Ø2ØØ1ð  ñ ô ð ð=°T¸%¼,Ô5Gð =ð =ð =ð =ð>&ð &ð &ð „× Ò Ø,Ø!Ø4ð  ñ ô ð ð=ÀÀeÄlÔASð =ð =ð =ð =ð8 ð  ð  ð „× Ò Ø8Ø-Ø@ð  ñ ô ð ðCÀÀUÄ\Ô@Rð Cð Cð Cð CðD&ð &ð &ð „× Ò Ø7Ø,Ø?ð  ñ ô ð ð ð	Vð VØ
Œ,ðVà�#ŒYðVð ðVð 
ð	Vð
 „\ðVð Vð Vð Vð>q#ð q#ð q#ð q#ð q#˜EœLñ q#ô q#ð q#ðhð
L&ð L&˜ð L&¨#ð L&°u¸SÀ$ÀsÄ)ÈSÐ=PÔ7Qð L&ð L&ð L&ð L&ð` #%ð8Lð 8LØð8LØð8Là	Ô˜œÑ'ð8Lð 8Lð 8Lð 8Lðv ð  ˜zð  °ð  ¸T¼^ð  ð  ð  ð  ð „×ÒØ-ØØ%ð ñ ô ð
( ¤ð (°%´,ð (ð (ð (ñô ð
(ð  Ô$ð#ˆUŒ\ð #˜eœlð #ð #ð #ñ %Ô$ð#ð°U´\ð ð ð ð ð 	ð 	ð 	ð × 'Ò 'Ø"Ø5ð (ñ ô ð ð(˜ð (ð (ð (ð (ð' ¤ð 'ð 'ð 'ð 'ð Ôð#
ð #
¸ð #
ð #
ð #
ñ Ôð#
ðLð ð ðFð Fð Fð
"ð "ð "ðIð Ið Ið"ð "ð "ð@ð @ð @ð"ð "ð "ðð ð ð:ð :ð :ð%ð %ð %ð/ð /ð /ðð ð ðð ð ðð ð ð.ð .ð .ð
)ð 
)ð 
)ð:ð :ð :ð:ð :ð :ðð ð ð ð  ð  ð ð  ð  ðð ð ð Œ=× Ò Ð!3°VÑ<Ô<€Ø ‡‚ˆlÐ,¨fÑ 5Ô 5Ð 5Ø ‡‚ˆmÐ.°Ñ 7Ô 7Ð 7Ø ‡‚Ð$Ð&@À&Ñ IÔ IÐ IØ ‡‚Ð%Ð'BÀFÑ KÔ KÐ KØ ‡‚ˆmÐ.°Ñ 7Ô 7Ð 7Ø ‡‚ˆg�{ FÑ +Ô +Ð +Ø ‡‚ˆg�{ FÑ +Ô +Ð +Ø ‡‚ˆoÐ2°FÑ ;Ô ;Ð ;à ‡‚Ø Ð"IÈ6ñô ð ð 	‡‚Ð&Ð(KÈVÑ TÔ TÐ TØ ‡‚Ø&Ø1Ø
ñô ð ð
 	‡‚Ð%Ð'IÈ6Ñ RÔ RÐ RØ ‡‚ØÐ!GÈñô ð ð 	‡‚Ø%Ø0Ø
ñô ð ð
 	‡‚Ð!Ð#:¸FÑ CÔ CÐ CØ ‡‚ˆk˜?¨FÑ 3Ô 3Ð 3Ø ‡‚ˆlÐ,¨fÑ 5Ô 5Ð 5ð
 ”M×)Ò)Ð*EÀvÑNÔNÐ Ø × Ò ØÐAÀ6ñô ð ð × Ò ØÐ?Àñô ð ð × Ò Ð*Ð,CÀVÑ LÔ LÐ Lð „„× Ò ˜eœiÔ8ÔDÔLÑ MÔ MÐ MØ „„× Ò ˜eœiÔ8ÔDÑ EÔ EÐ EØ „„× Ò ˜eœiÔ8Ô>ÔFÑ GÔ GÐ GØ „„× Ò ˜eœiÔ8Ô>Ñ ?Ô ?Ð ?Ø „„× Ò ˜eœiÔ8Ô>ÔFÑ GÔ GÐ GØ „„× Ò ˜eœiÔ8Ô>Ñ ?Ô ?Ð ?Ø „„× Ò ˜eœiÔ8ÔFÔNÑ OÔ OÐ OØ „„× Ò ˜eœiÔ8ÔFÑ GÔ GÐ Gð
 Œ]×"Ò"Ð#4°eÑ<Ô<€
Ø”-×'Ò'Ð(9¸6ÑBÔB€ðð ð €ð ŒK˜Ô!€	Øð Mð M€FØ�Q˜Ÿš cÑ*Ô*Ð*Ô+€GØ�7˜<¨¨W¨¨Ñ7Ô7€LØ×Ò�f 5¤9Ô#>ÐÑ?Ô?Ð?Ø×Ò˜ ,Ð0KÑLÔLÐLÐLðð ØØØðXð XØ”<ðXà”,ðXð ð	Xð
 
ðXð ðXð Xð Xð Xð. Ø
ØØØðSð SØŒLðSàŒ<ðSð 	ðSð
 ðSð ðSð 
ðSð Sð Sð Sð, 	„MÔ�uØ„MÔ�uØ„MÔ˜9Ø„MÔ�uØ„MÔ�uØ„MÔ˜Ø„MÔ�uØ„MÔ˜ð	Ð ð Ø
ØØð<ð <ØŒLð<àð<ð ð	<ð
 
ð<ð <ð <ð <ð, ØØ
ØØðð ØŒLðàŒ<ðð 
ðð ð ð ð@ ØØð"ð "Ø�e”lÔ#ð"àŒLð"ð
 
ð"ð "ð "ð "ðP Ø&*Øð&ð &ØŒLð&à	ð&ð 
ð&ð Ô˜tÑ#ð	&ð
 ð&ð &ð &ð &ð< Ø&*Øð&ð &ØŒLð&à	ð&ð 
ð&ð Ô˜tÑ#ð	&ð
 ð&ð &ð &ð &ð02Ø�#ŒYð2à�CŒyð2ð �3Œið2ð �%”,Ôð	2ð
 ð2ð 2ð 2ð 2ð0 ØÔ˜tœ~Ñ-ð à	Ô˜œÑ'ð ð  ð  ð  ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð0/ð /ð /ð3ð 3ð 3ð(ð (ð (ð(ð (ð (ð(ð (ð (ð*ð *ð *ð*ð *ð *ð2ð 2ð 2ð Ð)ØÐ0ØÐ1ØÐ!8ØÐ)ØÐ9ØÐ+ØÐ 7ØÐ/Ø�/Ø�/ØÐ1ðÐ Ð Ð s$   ÁA ÁAÁAÁ A' Á'BÂB