ó
    Eñi°í  ã                   ó¾  • S SK r S SKrS SKrS SKJrJrJrJr  S SKrS SK	J
r  S SKJ
s  Jr  S SKJr  S SKJr  S SKJr  SSKJr   S SKJr   S S	KJr     \\!\"   \!\!\"      \RF                  \\$S\"4   \RJ                  4   r& S r'S—S\RP                  S\"S\&S\)4S jjr*S—S\RP                  S\)S\&S\)4S jjr+ S—S\RP                  S\"S\&S\)S\RP                  4
S jjr, S—S\RP                  S\"S\&S\)4S jjr- S—S\RP                  S\)S\"S\&S\)4
S jjr. S—S\RP                  S\)S\"S\&S\)4
S jjr/ S—S\!\RP                     S\)S\&S\)S\!\RP                     4
S jjr0 S—S\!\RP                     S\&S\)S\!\RP                     4S jjr1 S—S \!\RP                     S\)S\!\"   S\&S\)S\!\RP                     4S! jjr2S" r3 S—S\RP                  S#\!\"   S-  S$\!\"   S-  S\&S\)S\RP                  4S% jjr4 S—S\RP                  S#\!\"   S-  S$\!\"   S-  S\&S\)S\RP                  4S& jjr5S'\RP                  4S( jr6S) r7\Rp                  Rs                  S*\6\7S+9  S'\RP                  4S, jr:S- r;\Rp                  Rs                  S.\:\;S+9  S'\RP                  4S/ jr<S0 r=\Rp                  Rs                  S1\<\=S+9  S'\RP                  4S2 jr>S3 r?\Rp                  Rs                  S4\>\?S+9  S'\RP                  4S5 jr@S6 rA\Rp                  Rs                  S7\@\AS+9  S8\!\RP                     4S9 jrBS: rC\Rp                  Rs                  S;\B\CS+9  S8\!\RP                     4S< jrDS= rE\Rp                  Rs                  S>\D\ES+9  S8\!\RP                     4S? jrFS@ rG\Rp                  Rs                  SA\F\GS+9   S—S\RP                  SB\!\"   S\&S\)S\RP                  4
SC jjrH " SD SE\RP                  5      rI S—S\&S\)S\$\)\!\"   \"4   4SF jjrJS—S\&S\)S\RJ                  4SG jjrK " SH SI\R˜                  Rš                  5      rN\Rp                  RŸ                  SJSKSLSM9SN\RP                  S\RP                  4SO j5       rP\PR¢                  SN\RP                  S\RP                  4SP j5       rRS'\RP                  4SQ jrSSR rT\PRs                  \S\TS+9  S\U4SS jrVS\RP                  4ST jrW\ R°                  S˜SU\U4SV jj5       rYSW rZSX r[SY r\SZ r]S[ r^S\ r_S] r`S^ raS_ rbS` rcSa rdSb reSc rfSd rgSe rhSf riSg rjSh rkSi rl\Rp                  RÛ                  SjSk5      rn\nRß                  Sl\]Sm5        \nRß                  Sn\bSm5        \nRß                  So\aSm5        \nRß                  Sp\dSm5        \nRß                  Sq\^Sm5        \nRß                  Sr\gSm5        \nRß                  Ss\hSm5        \nRß                  St\iSm5        \nRß                  Su\jSm5        \nRß                  Sv\kSm5        \nRß                  Sw\lSm5        \nRß                  Sx\fSm5        \nRß                  Sy\\Sm5        \nRß                  Sz\cSm5        \Rà                  Râ                  Rå                  \Ræ                  Rè                  RN                  Rê                  5        \Rà                  Râ                  Rå                  \Ræ                  Rè                  RN                  5        \Rp                  RÛ                  S{S|5      rv\Rp                  RÛ                  S{Sk5      rw/ S}Qrx\Rò                  \z   r{\x H]  r|\|S \|Rû                  S~5       r~\" \S\~ 35      r€\vGR                  \|\GR                  GR                  S€9  \wRß                  \~\€S�5        M_          S™S‚\RP                  Sƒ\RP                  S„\US\)S\"4
S… jjr„     SšS‡\RP                  SN\RP                  Sˆ\)S„\US\"S\)4S‰ jjr…\GR                  GR                  S†\GR                  GR                  SŠ\GR                  GR                  S‹\GR                  GR                  SŒ\GR                  GR                  S�\GR                  GR                  SŽ\GR                  GR                  S�\GR                  GR                  S�0r�    S›S‘\RP                  Sˆ\)S„\US\)4S’ jjr�     SœS‡\RP                  SN\RP                  S\)4S“ jjr‘   S�S”\!\RP                     S‘\RP                  S\)4S• jjr’S S–KJ“r”J•r–J—r˜J™ršJ+r›J4rœJ.r�  \š\„\�\…\›\�\œ\‘\˜\’\–\…\”\„0ržg! \ a
    S SKJr   GNïf = f! \ a    \R@                  " S
SS9  S r G	N	f = f)žé    N)ÚAnyÚcastÚTYPE_CHECKINGÚUnion)Ú_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                  ó   • g)NF© r   ó    Úf/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torch/distributed/_functional_collectives.pyÚis_torchdynamo_compilingr      s   € Ør   zdist.tensor.DeviceMeshc                 óT   • [         R                  R                  R                  U 5      $ )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‰9×%Ñ%×1Ñ1°&Ó9Ð9r   ÚselfÚsrcÚgroupÚtagc                 ó‚   • [        X#5      n[        R                  R                  R	                  XU5      n[        U5      $ )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_group_namer   r   r   Ú	broadcastÚ_maybe_wrap_tensor)r   r   r   r   Ú
group_namer   s         r   r"   r"   �   s5   € ô % UÓ0€JÜ�Y‰Y×'Ñ'×1Ñ1°$¸ZÓH€FÜ˜fÓ%Ð%r   ÚreduceOpc                 óž   • [        X#5      n[        R                  R                  R	                  XR                  5       U5      n[        U5      $ )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'   ›   s<   € ô" % UÓ0€JÜ�Y‰Y×'Ñ'×2Ñ2°4¿¹Ó9IÈ:ÓV€FÜ˜fÓ%Ð%r   Ú
gather_dimÚreturnc                 ó`  • U R                  5       (       d  [        S5      e[        X#5      n[        R                  " U5      n[
        R                  R                  R                  XU5      n[        U5      nUS:w  a1  [        U[        5      (       a  UR                  5       n[        XuU5      nU$ )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.
z/Tensor must be contiguous for all_gather_tensorr   )Úis_contiguousÚAssertionErrorr!   Úc10dÚ_get_group_size_by_namer   r   r   Úall_gather_into_tensorr#   Ú
isinstanceÚAsyncCollectiveTensorÚwaitr   ©r   r)   r   r   r$   Ú
group_sizer   Úress           r   Úall_gather_tensorr7   ±   s—   € ð, ×Ñ×ÑÜÐNÓOÐOÜ$ UÓ0€JÜ×-Ò-¨jÓ9€JÜ�Y‰Y×'Ñ'×>Ñ>Ø˜*ó€Fô ˜VÓ
$€Cà�Qƒô �cÔ0×1Ñ1Ø—(‘(“*ˆCä# C°ZÓ@ˆØ€Jr   c                 ól  • [        X#5      n[        R                  " U5      n[        R                  R
                  R                  XU5      n[        R                  U5      nUS:w  aM  [        U[        5      (       a  UR                  5       n[        R                  " [        R                  " XuSS9US9nU$ )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_tensor but will propagate the
backwards gradient across workers.

See all_gather_tensor for more details on usage.
r   ©Údim)r!   r.   r/   r   r   Ú_c10d_functional_autogradr0   Ú_FromTorchTensorÚapplyr1   r2   r3   ÚcatÚchunkr4   s           r   Úall_gather_tensor_autogradr@   Ú   s‘   € ô  % UÓ0€JÜ×-Ò-¨jÓ9€Jä�Y‰Y×0Ñ0×GÑGØ˜*ó€Fô ×
 Ñ
  Ó
(€Cà�Qƒô �cÔ0×1Ñ1Ø—(‘(“*ˆCÜ�iŠiœŸš C¸Ñ;ÀÑLˆØ€Jr   Úscatter_dimc                 ó¦  • [        X45      n[        R                  " U5      nU R                  U5      U-  S:w  a!  [	        SU R                  S5       SU S35      eUS:w  a+  [
        R                  " XUS9n[
        R                  " U5      n [
        R                  R                  R                  U UR                  5       UU5      n[        U5      n	U	$ )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   úinput dimension 0 (ú" must be a multiple of group_size Ú)r9   )r!   r.   r/   Úsizer-   r   r?   r>   r   r   Úreduce_scatter_tensorr(   r#   ©
r   r%   rA   r   r   r$   r5   Útensor_listr   r6   s
             r   rG   rG   û   sÅ   € ô, % UÓ0€JÜ×-Ò-¨jÓ9€Jà‡y�y�Ó 
Ñ*¨aÓ/ÜØ! $§)¡)¨A£, Ð/QÐR\ÐQ]Ð]^Ð_ó
ð 	
ð �aÓÜ—k’k $¸ÑDˆÜ�yŠy˜Ó%ˆä�Y‰Y×'Ñ'×=Ñ=ØØ�‰ÓØØó	€Fô ˜VÓ
$€CØ€Jr   c                 ó¸  • [        X45      n[        R                  " U5      nU R                  U5      U-  S:w  a   [	        SU R                  S5       SU 35      eUS:w  a+  [
        R                  " XUS9n[
        R                  " U5      n [
        R                  R                  R                  U UR                  5       UU5      n[        R                  U5      n	U	$ )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_tensor but will propagate the
backwards gradient across workers.

Currently only the "sum" reduceOp is supported.

See reduce_scatter_tensor for more details on usage.
r   rC   rD   r9   )r!   r.   r/   rF   r-   r   r?   r>   r   r;   rG   r(   r<   r=   rH   s
             r   Úreduce_scatter_tensor_autogradrK   &  sÈ   € ô& % UÓ0€JÜ×-Ò-¨jÓ9€Jà‡y�y�Ó 
Ñ*¨aÓ/ÜØ! $§)¡)¨A£, Ð/QÐR\ÐQ]Ð^ó
ð 	
ð �aÓÜ—k’k $¸ÑDˆÜ�yŠy˜Ó%ˆä�Y‰Y×0Ñ0×FÑFØØ�‰ÓØØó	€Fô ×
 Ñ
  Ó
(€CØ€Jr   c                 ó¼   • [        X#5      n[        R                  R                  R	                  U UR                  5       U5      n[        [        [        U5      5      $ )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(   ÚlistÚmapr#   )r   r%   r   r   r$   rI   s         r   rM   rM   N  sM   € ô& % UÓ0€JÜ—)‘)×,Ñ,×AÑAØØ�‰ÓØó€Kô
 ”Ô&¨Ó4Ó5Ð5r   c                 óÌ   • [        X5      n[        R                  " U5      n[        R                  R
                  R                  U UU5      n[        [        [        U5      5      $ )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_coalescedrN   rO   r#   )r   r   r   r$   r5   rI   s         r   rQ   rQ   j  sV   € ô& % UÓ0€JÜ×-Ò-¨jÓ9€JÜ—)‘)×,Ñ,×MÑMØØØó€Kô
 ”Ô&¨Ó4Ó5Ð5r   Úinputsc                 óˆ  • [        X45      n[        R                  " U5      n[        U5      [        U 5      :w  a$  [	        S[        U5       S[        U 5       S35      e[        [        X 5      5       H{  u  nu  p‰U	R                  U5      U-  S:w  a&  [	        SU SU	R                  U5       SU SU 35      eUS:w  d  MN  [        R                  " X–US	9n
[        R                  " U
5      X'   M}     [        R                  R                  R                  U UR                  5       UU5      n
[        [!        ["        U
5      5      $ )
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 (rE   r   zinput dimension z (rD   z for tensor at index r9   )r!   r.   r/   Úlenr-   Ú	enumerateÚziprF   r   r?   r>   r   r   Úreduce_scatter_tensor_coalescedr(   rN   rO   r#   )rR   r%   rA   r   r   r$   r5   Úidxr:   r   rI   s              r   rW   rW   ‡  sC  € ô, % UÓ0€JÜ×-Ò-¨jÓ9€Jä
ˆ;Óœ3˜v›;Ó&ÜØ%¤c¨+Ó&6Ð%7Ð7VÔWZÐ[aÓWbÐVcÐcdÐeó
ð 	
ô (¬¨KÓ(@ÖAÑˆ‰]ˆcØ�;‰;�sÓ˜jÑ(¨AÓ-Ü Ø" 3 % r¨&¯+©+°cÓ*:Ð);Ð;]Ð^hÐ]iÐi~ð  @Cð  Dð  Eóð ð �!�8ÜŸ+š+ f¸cÑBˆKÜŸ)š) KÓ0ˆF‹Kñ Bô —)‘)×,Ñ,×LÑLØØ�‰ÓØØó	€Kô ”Ô&¨Ó4Ó5Ð5r   c                 óä  • [        U [        R                  R                  5      (       d  [	        S[        U 5       35      e[        R                  R                  U R                  5       [        R                  R                  5      (       a  gU R                  n[        UR                  5      S:”  a?  UR                  S   nUR                  S L=(       a    UR                  R                  (       + $ g )Nz$Expected torch._ops.OpOverload, got Fr   )r1   r   Ú_opsÚ
OpOverloadr-   ÚtypeÚ_CÚ%_dispatch_has_kernel_for_dispatch_keyÚnameÚDispatchKeyÚCompositeImplicitAutogradÚ_schemarT   Ú	argumentsÚ
alias_infoÚis_write)ÚtgtÚschemaÚ	first_args      r   Ú_is_view_opri   ¹  s»   € Ü�cœ5Ÿ:™:×0Ñ0×1Ñ1ÜÐCÄDÈÃIÀ;ÐOÓPÐPô ‡x�x×5Ñ5Ø�‰‹
”E×%Ñ%×?Ñ?÷ñ ð Ø�[‰[€FÜ
ˆ6×ÑÓ˜qÓ Ø×$Ñ$ QÑ'ˆ	à×#Ñ#¨4Ð/×U¸	×8LÑ8L×8UÑ8UÔ4UÐUð !r   Úoutput_split_sizesÚinput_split_sizesc                 ó°  • Ub%  [        S U 5       5      (       d  [        SU 35      eUb%  [        S U 5       5      (       d  [        SU 35      e[        X45      n[        R                  " U5      nUb  Uc)  Uc  Ub  [        S5      eU R
                  S   U-  /U-  nUn[        R                  R                  R                  U UUU5      n[        U5      $ )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.

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.
c              3   ób   #   • U  H%  n[        U[        [        R                  45      v •  M'     g 7f©N©r1   Úintr   ÚSymInt©Ú.0rF   s     r   Ú	<genexpr>Ú$all_to_all_single.<locals>.<genexpr>à  ó'   é € ð 
Ú>P°dŒJ�tœc¤5§<¡<Ð0×1Ð1Ò>Pùó   ‚-/ú2All output_split_sizes must be int or SymInt, got c              3   ób   #   • U  H%  n[        U[        [        R                  45      v •  M'     g 7frn   ro   rr   s     r   rt   ru   ç  ó%   é € ÐWÒEV¸T”:˜d¤S¬%¯,©,Ð$7×8Ð8ÒEVùrw   ú1All input_split_sizes must be int or SymInt, got ú^output_split_sizes and input_split_sizes must either be specified together or both set to Noner   )Úallr-   r!   r.   r/   Úshaper   r   r   Úall_to_all_singler#   ©r   rj   rk   r   r   r$   r5   r   s           r   r   r   É  s  € ð, Ñ%Üñ 
Ù>Pó
÷ 
ñ 
ô !ØDÐEWÐDXÐYóð ð Ñ$ÜÑWÑEVÓW×WÑWÜ ØCÐDUÐCVÐWóð ô % UÓ0€JÜ×-Ò-¨jÓ9€JØÑ!Ð%6Ñ%>Ø"Ñ*Ð/@Ñ/HÜ ð9óð ð #Ÿj™j¨™m¨zÑ9Ð:¸ZÑGÐØ.ÐÜ�Y‰Y×'Ñ'×9Ñ9ØØØØó	€Fô ˜fÓ%Ð%r   c                 óÄ  • Ub%  [        S U 5       5      (       d  [        SU 35      eUb%  [        S U 5       5      (       d  [        SU 35      e[        X45      n[        R                  " U5      nUb  Uc)  Uc  Ub  [        S5      eU R
                  S   U-  /U-  nUn[        R                  R                  R                  U UUU5      n[        R                  U5      $ )z2
Same as all_to_all_single but supports autograd.
c              3   ób   #   • U  H%  n[        U[        [        R                  45      v •  M'     g 7frn   ro   rr   s     r   rt   Ú-all_to_all_single_autograd.<locals>.<genexpr>	  rv   rw   rx   c              3   ób   #   • U  H%  n[        U[        [        R                  45      v •  M'     g 7frn   ro   rr   s     r   rt   rƒ     rz   rw   r{   r|   r   )r}   r-   r!   r.   r/   r~   r   r   r;   r   r<   r=   r€   s           r   Úall_to_all_single_autogradr…   þ  s  € ð Ñ%Üñ 
Ù>Pó
÷ 
ñ 
ô !ØDÐEWÐDXÐYóð ð Ñ$ÜÑWÑEVÓW×WÑWÜ ØCÐDUÐCVÐWóð ô % UÓ0€JÜ×-Ò-¨jÓ9€JØÑ!Ð%6Ñ%>Ø"Ñ*Ð/@Ñ/HÜ ð9óð ð #Ÿj™j¨™m¨zÑ9Ð:¸ZÑGÐØ.ÐÜ�Y‰Y×0Ñ0×BÑBØØØØó	€Fô ×!Ñ! &Ó)Ð)r   Úgrad_outputc                 ó   • U$ )zü
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Š   -  s
   € ð Ðr   c                 ó   • g)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‰   rR   Úoutputs      r   Úwait_tensor_setup_contextrŽ   <  s   € ð r   z_c10d_functional::wait_tensor)Úsetup_contextc                 óè   • U R                   nU R                  nUS:w  a  [        SU S35      e[        R                  R
                  R                  UR                  5       X25      n[        U5      SS4$ )aS  
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)	r$   Ú	reduce_opÚRuntimeErrorr   r   r   r'   Ú
contiguousr   )r‰   r†   r$   r“   r�   s        r   Úall_reduce_backwardr–   N  sv   € ð —‘€JØ—‘€Ià�EÓÜØFÀyÀkÐQRÐSó
ð 	
ô
 �Y‰Y×'Ñ'×2Ñ2Ø×ÑÓ  )ó€Fô �vÓ  dÐ*Ð*r   c                 óD   • Uu  p4nXPl         UR                  5       U l        g)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‰   rR   r�   Úinputr“   r$   s         r   Úall_reduce_setup_contextrš   j  s!   € ð $*Ñ €E�jØ„NØ—O‘OÓ%€C…Mr   z_c10d_functional::all_reducec                 óÂ   • U R                   nU R                  n[        R                  R                  R                  UR                  5       SUU5      n[        U5      SS4$ )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$   r5   r   r   r   rG   r•   r   )r‰   r†   r$   r5   r�   s        r   Úall_gather_into_tensor_backwardrœ   ~  s[   € ð —‘€JØ—‘€Jô �Y‰Y×'Ñ'×=Ñ=Ø×ÑÓ ØØØó	€Fô �vÓ  dÐ*Ð*r   c                 ó&   • Uu  p4nXPl         X@l        g)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$   r5   )r‰   rR   r�   r™   r5   r$   s         r   Ú$all_gather_into_tensor_setup_contextrŸ   š  s   € ð %+Ñ!€E�zØ„NØ…Nr   z(_c10d_functional::all_gather_into_tensorc                 ó  • U R                   nU R                  nU R                  nUS:w  a  [        SU S35      e[        R
                  R                  R                  UR                  5       UU5      n[        U5      SSS4$ )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$   r5   r“   r”   r   r   r   r0   r•   r   )r‰   r†   r$   r5   r“   r�   s         r   Úreduce_scatter_tensor_backwardr¡   ¯  s‰   € ð —‘€JØ—‘€JØ—‘€Ið �EÓÜØQÐR[ÐQ\Ð\]Ð^ó
ð 	
ô
 �Y‰Y×'Ñ'×>Ñ>Ø×ÑÓ ØØó€Fô
 �vÓ  d¨DÐ0Ð0r   c                 óP   • Uu  p4pVX`l         XPl        UR                  5       U l        g)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$   r5   r(   r“   )r‰   rR   r�   r™   r“   r5   r$   s          r   Ú#reduce_scatter_tensor_setup_contextr¤   Ñ  s&   € ð 06Ñ,€E�jØ„NØ„NØ—O‘OÓ%€C…Mr   z'_c10d_functional::reduce_scatter_tensorc                 óÜ   • U R                   nU R                  nU R                  n[        R                  R
                  R                  UR                  5       UUU5      n[        U5      SSS4$ )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$   rj   rk   r   r   r   r   r•   r   )r‰   r†   r$   rj   rk   r�   s         r   Úall_to_all_single_backwardr¦   ç  sl   € ð —‘€JØ×/Ñ/ÐØ×-Ñ-Ðô �Y‰Y×'Ñ'×9Ñ9Ø×ÑÓ ØØØó	€Fô �vÓ  d¨DÐ0Ð0r   c                 ó2   • Uu  p4pVX`l         X@l        XPl        g)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$   rj   rk   )r‰   rR   r�   r™   rj   rk   r$   s          r   Úall_to_all_single_setup_contextr¨     s"   € ð @FÑ<€EÐ0Ø„NØ/ÔØ-Õr   z#_c10d_functional::all_to_all_singleÚgrad_outputsc                 ó0  • U R                   nU R                  nUS:w  a  [        SU S35      e[        R                  R
                  R                  U Vs/ s H  oDR                  5       PM     snUU5      n[        [        [        U5      5      SS4$ s  snf )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’   N)r$   r“   r”   r   r   r   rM   r•   rN   rO   r   )r‰   r©   r$   r“   r†   Úgrad_inputss         r   Úall_reduce_coalesced_backwardr¬     s–   € ð —‘€JØ—‘€Ià�EÓÜØPÐQZÐP[Ð[\Ð]ó
ð 	
ô
 —)‘)×,Ñ,×AÑAÙ5AÓB²\ k×	Ñ	Ö	!±\ÑBØØó€Kô
 ””[ +Ó.Ó/°°tÐ<Ð<ùò	 	Cs   ÁBc                 óD   • Uu  p4nXPl         UR                  5       U l        g)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‰   rR   r�   rI   r“   r$   s         r   Ú"all_reduce_coalesced_setup_contextr®   8  s!   € ð *0Ñ&€K˜JØ„NØ—O‘OÓ%€C…Mr   z&_c10d_functional::all_reduce_coalescedc                 ó  • U R                   nU R                  n[        R                  R                  R                  U Vs/ s H  oDR                  5       PM     snSUU5      n[        [        [        U5      5      SS4$ s  snf )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)
r‘   N)
r$   r5   r   r   r   rW   r•   rN   rO   r   )r‰   r©   r$   r5   r†   r«   s         r   Ú)all_gather_into_tensor_coalesced_backwardr°   M  su   € ð —‘€JØ—‘€Jô —)‘)×,Ñ,×LÑLÙ5AÓB²\ k×	Ñ	Ö	!±\ÑBØØØó	€Kô ””[ +Ó.Ó/°°tÐ<Ð<ùò 	Cs   Á A?c                 ó&   • Uu  p4nXPl         X@l        g)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‰   rR   r�   rI   r5   r$   s         r   Ú.all_gather_into_tensor_coalesced_setup_contextr²   i  s   € ð +1Ñ'€K˜ZØ„NØ…Nr   z2_c10d_functional::all_gather_into_tensor_coalescedc                 óJ  • U R                   nU R                  nU R                  nUS:w  a  [        SU S35      e[        R
                  R                  R                  U Vs/ s H  oUR                  5       PM     snUU5      n[        [        [        U5      5      SSS4$ s  snf )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’   N)r$   r5   r“   r”   r   r   r   rQ   r•   rN   rO   r   )r‰   r©   r$   r5   r“   r†   r«   s          r   Ú(reduce_scatter_tensor_coalesced_backwardr´   ~  s£   € ð —‘€JØ—‘€JØ—‘€Ið �EÓÜØ[Ð\eÐ[fÐfgÐhó
ð 	
ô
 —)‘)×,Ñ,×MÑMÙ5AÓB²\ k×	Ñ	Ö	!±\ÑBØØó€Kô
 ””[ +Ó.Ó/°°t¸TÐBÐBùò	 	Cs   Á!B c                 óP   • Uu  p4pVX`l         XPl        UR                  5       U l        g)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‰   rR   r�   rI   r“   r5   r$   s          r   Ú-reduce_scatter_tensor_coalesced_setup_contextr¶      s&   € ð 6<Ñ2€K˜JØ„NØ„NØ—O‘OÓ%€C…Mr   z1_c10d_functional::reduce_scatter_tensor_coalescedÚsrc_dstc                 óZ  • [        X#5      u  pEn[        R                  " XEU5      nS/U-  nS/U-  n	[        U5       H_  u  p«U
[        R
                  " U5      :X  a  U R                  5       X›'   U[        R
                  " U5      :X  d  MM  U R                  5       XŠ'   Ma     [        XX’U5      $ )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_tagrU   ÚdistÚget_rankÚnumelr   )r   r·   r   r   ÚtÚranksetr5   Úlocal_pgrj   rk   r   Údsts               r   Úpermute_tensorrÂ   ¶  s£   € ô" +¨5Ó6Ñ€A�
Ü×7Ò7¸ÀJÓO€Hà˜˜zÑ)ÐØ˜˜jÑ(ÐÜ˜gÖ&‰ˆØ”$—-’- Ó)Ó)Ø%)§Z¡Z£\ÐÑ"Ø”$—-’- Ó)Õ)Ø&*§j¡j£lÐÓ#ñ	 'ô ˜TÐ7HÐQTÓUÐUr   c                   ó  • \ rS rSr% Sr\R                  \S'   \\S'   SS/r	\
S\R                  4S j5       rS rS r\
S 5       r SS
\S\S	-  4S jjrS\4S jrS rS\R                  4S jrS r\SS j5       rS rSrg	)r2   iÕ  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                 ó  • [         R                  R                  U UR                  5       UR	                  5       UR                  5       UR                  UR                  UR                  UR                  S9nXl
        SUl        U$ )N)ÚstridesÚstorage_offsetÚdtypeÚlayoutÚdeviceÚrequires_gradF)r   ÚTensorÚ_make_wrapper_subclassrF   ÚstriderÈ   rÉ   rÊ   rË   rÌ   rÄ   rÅ   )ÚclsrÄ   Úrs      r   Ú__new__ÚAsyncCollectiveTensor.__new__å  sm   € ä�L‰L×/Ñ/ØØ�I‰I‹KØ—K‘K“MØ×.Ñ.Ó0Ø—*‘*Ø—;‘;Ø—;‘;Ø×,Ñ,ð 0ð 	
ˆð ŒØˆŒØˆr   c                 ó   • S/S 4$ )NrÄ   r   ©r   s    r   Ú__tensor_flatten__Ú(AsyncCollectiveTensor.__tensor_flatten__õ  s   € Øˆx˜ˆ~Ðr   c                 ó>   • U R                  5       R                  5       $ rn   )Útrigger_waitÚtolistrÕ   s    r   rÚ   ÚAsyncCollectiveTensor.tolistø  s   € Ø× Ñ Ó"×)Ñ)Ó+Ð+r   c                 ó>   • Ub  [        S5      eU S   n[        U5      $ )Nz5meta must be None for AsyncCollectiveTensor unflattenrÄ   )r-   r2   )Úinner_tensorsÚmetaÚ
outer_sizeÚouter_striderÄ   s        r   Ú__tensor_unflatten__Ú*AsyncCollectiveTensor.__tensor_unflatten__û  s/   € àÑÜ ØGóð ð ˜VÑ$ˆÜ$ TÓ*Ð*r   NÚexpected_metadataÚexpected_typec                 óJ   • U[         R                  La  g U R                  5       $ rn   )r   rÍ   rÙ   )r   rã   rä   s      r   Ú#__coerce_same_metadata_as_tangent__Ú9AsyncCollectiveTensor.__coerce_same_metadata_as_tangent__  s"   € ð ¤§¡Ò,Øà× Ñ Ó"Ð"r   r*   c                 ó*   • SU R                  5        S3$ )NzAsyncCollectiveTensor(rE   )rÙ   rÕ   s    r   Ú__repr__ÚAsyncCollectiveTensor.__repr__  s   € Ø'¨×(9Ñ(9Ó(;Ð'<¸AÐ>Ð>r   c                 óx   • U R                   (       d  [        U R                  5      nSU l         U$ U R                  $ ©NT)rÅ   r   rÄ   )r   Úouts     r   rÙ   Ú"AsyncCollectiveTensor.trigger_wait  s-   € Ø�~�~Ü˜dŸi™iÓ(ˆCØ!ˆDŒNØˆJà—9‘9Ðr   c                 ó,   • [        U R                  5      $ rn   )r   rÄ   rÕ   s    r   r3   ÚAsyncCollectiveTensor.wait  s   € Ü˜4Ÿ9™9Ó%Ð%r   c                 ó   • U R                   $ )zOThis method enables  _functional_collectives_impl to test if a tensor is an ACS)rÄ   rÕ   s    r   Ú_get_acs_underlying_tensorÚ0AsyncCollectiveTensor._get_acs_underlying_tensor  s   € à�y‰yÐr   c                 ó¤  ^• U[         R                  R                  R                  R                  L a&  U" US   R
                  US   5      n[        U5      nU$ [        U5      mS[        4U4S jjnS[         R                  4S jn[        [        Xs5      n	[        [        Xt5      n
U" U	0 U
D6nT(       a  [        [         R                  X‹5      nU$ )Nr   r
   Úec                 óJ   >• T(       d  U R                  5       $ U R                  $ rn   )rÙ   rÄ   )rõ   Ú
is_view_ops    €r   ÚunwrapÚ8AsyncCollectiveTensor.__torch_dispatch__.<locals>.unwrap*  s   ø€ æØ—~‘~Ó'Ð'Ø—6‘6ˆMr   c                 ó\   • [        U [        5      (       a  [        S5      e[        U 5      nU$ )NzICannot wrap an AsyncCollectiveTensor inside another AsyncCollectiveTensor)r1   r2   r-   )rõ   r6   s     r   ÚwrapÚ6AsyncCollectiveTensor.__torch_dispatch__.<locals>.wrap0  s1   € ä˜!Ô2×3Ñ3Ü$Ø_óð ô (¨Ó*ˆCØˆJr   )
r   r   ÚatenÚviewÚdefaultrÄ   r2   ri   rÍ   r   )rÐ   ÚfuncÚtypesÚargsÚkwargsr6   Úwrapper_resrø   rû   Úunwrapped_argsÚunwrapped_kwargsrí   r÷   s               @r   Ú__torch_dispatch__Ú(AsyncCollectiveTensor.__torch_dispatch__  s¹   ø€ à”5—9‘9—>‘>×&Ñ&×.Ñ.Ò.ñ �t˜A‘w—|‘| T¨!¡WÓ-ˆCÜ/°Ó4ˆKØÐä  Ó&ˆ
ð	Ô+÷ 	ð	”E—L‘Lô 	ô 'Ô'<¸fÓKˆÜ(Ô)>ÀÓOÐñ �NÐ7Ð&6Ñ7ˆö Ü¤§¡¨dÓ8ˆCàˆ
r   c                 ó>   • U R                  5       R                  5       $ rn   )r3   ÚnumpyrÕ   s    r   r
  ÚAsyncCollectiveTensor.numpyE  s   € Ø�y‰y‹{× Ñ Ó"Ð"r   )rÅ   rn   )r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   rÍ   Ú__annotations__ÚboolÚ	__slots__ÚstaticmethodrÒ   rÖ   rÚ   rá   r   r\   ræ   Ústrré   rÙ   r3   rò   Úclassmethodr  r
  Ú__static_attributes__r   r   r   r2   r2   Õ  s½   ‡ ñð �,‰,ÓØƒOà˜Ð%€Iàð˜5Ÿ<™<ó ó ðòò,ð ñ+ó ð+ð DHñ#Ø!$ð#Ø59¸D±[õ#ð?˜#ô ?òð&�e—l‘lô &òð ó$ó ð$õL#r   r2   c           	      óÒ  • [         (       a  S nS nOS nS n[        U [        5      (       a�  [        U S   [        5      (       ab  U" U 5      n/ nSnU HN  nUR                  U5        US:w  a)  U[	        U5      :w  a  [        SU S[	        U5       35      e[	        U5      nMP     GO½U" U 5      n[	        U5      nGO¨[        U [        R                  5      (       aB  [        R                  " U 5      n[	        U5      nU=(       d    [        R                  " U 5      nGOG[        U [        5      (       al  U R                  S	:w  a  [        S
5      eU R                  5       n[        R                  " U5      n[	        U5      nU=(       d    [        R                  " U5      nOÆ[        U [        5      (       a¦  [	        U 5      S:X  aŒ  [        U S   [        5      (       at  [        U S	   [         5      (       a\  U S   n	U S	   n
U	R                  U
5      n[        R                  " U5      n[	        U5      nU=(       d    [        R                  " U5      nO[        S5      e[        S5      eXU4$ )a%  
_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                 ó>   • [        [        [        [              U 5      $ rn   ©r   rN   rp   ©Úxs    r   Úcast_listlistintÚ'_expand_group.<locals>.cast_listlistintZ  s   € ÜœœT¤#™Y™¨Ó+Ð+r   c                 ó0   • [        [        [           U 5      $ rn   r  r  s    r   Úcast_listintÚ#_expand_group.<locals>.cast_listint]  s   € ÜœœS™	 1Ó%Ð%r   c                 ó   • U $ rn   r   r  s    r   r  r  d  ó   € ØˆHr   c                 ó   • U $ rn   r   r  s    r   r   r!  g  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   ú1Invalid tuple for group must be (DeviceMesh, int)z[Invalid type for group, must be one of List, Processgroup, DeviceMesh or (DeviceMesh, int).)r   r1   rN   ÚextendrT   Ú
ValueErrorr»   ÚProcessGroupÚget_process_group_ranksr.   Ú_get_group_tagr   Úndimr-   Ú	get_groupÚtuplerp   )r   r   r  r   Únested_listr¿   r5   ÚrsÚpgÚdmeshr:   s              r   r¹   r¹   N  s  € ÷ ‚}ò	,ó	&ò	ò	ô �%œ×ÑÜ�e˜A‘h¤×%Ñ%Ù*¨5Ó1ˆKØˆGØˆJÛ!�Ø—‘˜rÔ"Ø Ó#¨
´c¸"³gÓ(=Ü$Ø>¸z¸lÈ%ÔPSÐTVÓPWÈyÐYóð ô ! ›W’
ó "ñ # 5Ó)ˆGÜ˜W›ŠJÜ	�Eœ4×,Ñ,×	-Ñ	-Ü×.Ò.¨uÓ5ˆÜ˜“\ˆ
Ø×/”T×(Ò(¨Ó/ŠÜ	�Eœ:×	&Ñ	&Ø�:‰:˜‹?Ü Ø\óð ð �_‰_ÓˆÜ×.Ò.¨rÓ2ˆÜ˜“\ˆ
Ø×,”T×(Ò(¨Ó,‰Ü	�Eœ5×	!Ñ	!ä�‹J˜!‹OÜ˜5 ™8¤Z×0Ñ0Ü˜5 ™8¤S×)Ñ)à˜!‘HˆEØ˜‘(ˆCØ—‘ Ó%ˆBÜ×2Ò2°2Ó6ˆGÜ˜W›ˆJØ×0œ×,Ò,¨RÓ0‰CäÐPÓQÐQäØió
ð 	
ð ˜*Ð%Ð%r   c                 ó,  • [        U [        R                  5      (       a  U R                  $ [        U [        5      (       a  [        [        R                  U 5      $ [        U [        5      (       a*  U R                  S:w  a  [        S5      eU R                  S   $ [        U [        5      (       ac  [        U 5      S:X  aI  [        U S   [        5      (       a1  [        U S   [        5      (       a  U S   nU S   nUR                  U   $ [        S5      e[        U [         5      (       aU  [#        5       (       d  [$        R&                  " S[(        SS9  [        R*                  " [        [         [           U 5      U5      $ [        S	[-        U 5       S
U  35      e)z3
Given group in RANK_TYPES, return the group name.
r
   r&  r   r   r'  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, )r1   r»   r*  r$   r  r   r.   Ú	GroupNamer   r-  r-   Ú_dim_group_namesr/  rT   rp   r)  rN   r   ÚwarningsÚwarnÚFutureWarningÚ$_resolve_group_name_by_ranks_and_tagr\   )r   r   r3  r:   s       r   r!   r!   �  sU  € ô �%œ×*Ñ*×+Ñ+Ø×ÑÐÜ	�Eœ3×	Ñ	ô ”D—N‘N EÓ*Ð*Ü	�Eœ:×	&Ñ	&Ø�:‰:˜‹?Ü Ø\óð ð ×%Ñ% aÑ(Ð(Ü	�Eœ5×	!Ñ	!ä�‹J˜!‹OÜ˜5 ™8¤Z×0Ñ0Ü˜5 ™8¤S×)Ñ)à˜!‘HˆEØ˜‘(ˆCØ×)Ñ)¨#Ñ.Ð.äÐPÓQÐQÜ	�Eœ4×	 Ñ	 Ü'×)Ñ)Ü�MŠMðIô Øòô ×8Ò8¼¼dÄ3¹iÈÓ9OÐQTÓUÐUäÐ3´D¸³K°=ÀÀ5À'ÐJÓKÐKr   c                   ó    • \ rS rSrSr\S\R                  S\R                  4S j5       r\S\R                  S\R                  4S j5       r	Sr
g	)
r<   iÌ  za
_FromTorchTensor allows autograd to propagate from a normal Tensor to an
AsyncCollectiveTensor.
r™   r*   c                 ó   • [        U5      $ rn   )r#   )r‰   r™   s     r   ÚforwardÚ_FromTorchTensor.forwardÒ  s   € ô
 " %Ó(Ð(r   r†   c                 ó   • U$ rn   r   rˆ   s     r   ÚbackwardÚ_FromTorchTensor.backwardÙ  s   € àÐr   r   N)r  r  r  r  r  r  r   rÍ   r>  rA  r  r   r   r   r<   r<   Ì  s_   † ñð
 ð)à�|‰|ð)ð 
�‰ó)ó ð)ð ð 5§<¡<ð °E·L±Ló ó ór   r<   z'_c10d_functional::_wrap_tensor_autogradr   z(Tensor input) -> Tensor)Úmutates_argsrg   r™   c                 ó   • [        U 5      $ )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)
)r2   ©r™   s    r   Ú_wrap_tensor_autogradrF  Þ  s   € ô$ ! Ó'Ð'r   c                 ó.   • [         R                  " U 5      $ )z(
Meta kernel for _wrap_tensor_autograd.
©r   Ú
empty_likerE  s    r   Ú_rJ  ó  s   € ô
 ×Ò˜EÓ"Ð"r   c                 ó   • U$ )a  
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_backwardrL  û  s
   € ð Ðr   c                 ó   • g)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_contextrN    s   € ð r   c                  óN  • [        5       (       a  g[        R                  R                  [        R                  R                  R
                  5      b  g[        R                  R                  [        R                  R                  R                  5      (       a  g[        5       S L$ rì   )
r   r   r]   Ú_get_dispatch_modeÚ_TorchDispatchModeKeyÚFAKEÚ&_dispatch_tls_is_dispatch_key_includedr`   ÚPythonDispatcherr	   r   r   r   Ú_are_we_tracingrU    ss   € Ü×!Ñ!Øä‡x�x×"Ñ"¤5§8¡8×#AÑ#A×#FÑ#FÓGÑSØä‡x�x×6Ñ6Ü�‰×Ñ×-Ñ-÷ñ ð ÜÓ 4Ð'Ð'r   c                 óL   • [        5       (       a  [        U 5      $ [        U 5      $ rn   )rU  r   rF  rÕ   s    r   r#   r#   +  s!   € Ü×ÑÜ˜4Ó Ð Ü  Ó&Ð&r   Úvaluec              #   óf  #   • [         R                  R                  R                  5       n [         R                  R                  R	                  U 5        Sv •  [         R                  R                  R	                  U5        g! [         R                  R                  R	                  U5        f = f7f)aï  
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   r]   Ú_distributed_c10dÚ)_allow_inflight_collective_as_graph_inputÚ-_set_allow_inflight_collective_as_graph_input)rW  Úpreviouss     r   Ú,allow_inflight_collective_as_graph_input_ctxr]  1  sv   é € ô8 �x‰x×)Ñ)×SÑSÓU€Hð
Ü�‰×"Ñ"×PÑPÐQVÔWÛä�‰×"Ñ"×PÑPØõ	
øŒ�‰×"Ñ"×PÑPØõ	
üs   ‚)B1¬-B Á*B1Â+B.Â.B1c                 ó¶   • [        U R                  5       5      n[        U5      S:X  a  UR                  U5        OUS==   U-  ss'   U R	                  U5      nU$ ©Nr   )rN   rF   rT   ÚappendÚ	new_empty)r™   r5   Úout_sizeÚ
out_tensors       r   Ú_make_all_gather_out_tensorrd  X  sL   € Ü�E—J‘J“LÓ!€HÜ
ˆ8ƒ}˜ÓØ�‰˜
Õ#à�‹�zÑ!‹Ø—‘ Ó*€JØÐr   c                 óD   • U  Vs/ s H  n[        XC5      PM     sn$ s  snf rn   ©rd  )r   r   r¿   r5   r¾   s        r   Ú&_all_gather_into_tensor_coalesced_metarg  b  s    € Ù@DÓEÂ¸1Ô'¨Ö6ÁÑEÐEùÒEs   …c                 ó.   • [         R                  " U 5      $ rn   rH  ©r   r  s     r   Ú_broadcast_metarj  g  ó   € Ü×Ò˜DÓ!Ð!r   c                 óH   • [         R                  " U [         R                  S9$ )N)Úmemory_format)r   rI  Úcontiguous_formatri  s     r   Ú_all_reduce_metaro  k  s   € Ü×Ò˜D´×0GÑ0GÑHÐHr   c                 ó.   • [         R                  " U 5      $ rn   rH  ri  s     r   Ú_wait_tensor_metarq  o  rk  r   c                 ó   • [        X5      $ rn   rf  )Úshardr   r¿   r5   s       r   Ú_all_gather_into_tensor_metart  s  ó   € Ü& uÓ9Ð9r   c                 óp   • [        U R                  5       5      nUS==   U-  ss'   U R                  U5      $ r_  ©rN   rF   ra  )r™   r“   r   r¿   r5   rb  s         r   Ú_reduce_scatter_tensor_metarx  w  s/   € Ü�E—J‘J“LÓ!€HØˆQƒK�JÑƒKØ�?‰?˜8Ó$Ð$r   c                 óZ   • U  Vs/ s H  n[         R                  " U5      PM     sn$ s  snf rn   rH  )r   r  r¾   s      r   Ú_all_reduce_coalesced_metarz  }  s%   € Ù)-Ó.ª AŒE×Ò˜QÖ©Ñ.Ð.ùÒ.s   … (c                 ó   • U $ rn   r   ©Úinpr  s     r   Ú_all_reduce__metar~  �  ó   € Ø€Jr   c                 ó   • U $ rn   r   r|  s     r   Ú_broadcast__metar�  …  r  r   c                 ó   • U $ rn   r   )rR   r  s     r   Ú_all_reduce_coalesced__metarƒ  ‰  s   € Ø€Mr   c                 óJ   ^• U4S jnU  Vs/ s H
  oe" U5      PM     sn$ s  snf )Nc                 óv   >• [        U R                  5       5      nUS==   T-  ss'   U R                  U5      nU$ r_  rw  )r™   rb  rc  r5   s      €r   Úmk_out_tensorÚ<_reduce_scatter_tensor_coalesced_meta.<locals>.mk_out_tensorŽ  s5   ø€ Ü˜Ÿ
™
›Ó%ˆØ�‹˜
Ñ"‹Ø—_‘_ XÓ.ˆ
ØÐr   r   )rR   r%   r   r¿   r5   r†  r¾   s       `  r   Ú%_reduce_scatter_tensor_coalesced_metarˆ  �  s'   ø€ õñ '-Ó-¢f ˆM˜!Ö¡fÑ-Ð-ùÒ-s   Œ c                 óú   • Uc  U R                  U R                  5       5      $ U H  n[        R                  " US:¬  5        M     [	        U R                  5       5      n[        U5      US'   U R                  U5      $ r_  )ra  rF   r   Ú_checkrN   r‘   )r™   rj   rk   r  r  Úsrb  s          r   Ú_all_to_all_single_metarŒ  œ  sg   € ð Ñ!Ø�‰˜uŸz™z›|Ó,Ð,ã#ˆAÜ�LŠL˜˜a™Ö ñ $ä˜Ÿ
™
›Ó%ˆÜÐ,Ó-ˆ�‰Ø�‰˜xÓ(Ð(r   c                ó   • [        X5      $ rn   rf  )r™   r5   r$   rí   s       r   Ú'_all_gather_into_tensor_out_native_metarŽ  ©  ru  r   c                 ó   • [        X5      $ rn   rf  )r™   r5   r$   s      r   Ú#_all_gather_into_tensor_native_metar�  ­  ru  r   c                 óF   • U  Vs/ s H  n[        X1U5      PM     sn$ s  snf rn   )r�  )rR   r5   r$   r™   s       r   Ú-_all_gather_into_tensor_coalesced_native_metar’  ±  s0   € ñ óâˆEô 	,¨E¸zÖJÙñð ùò ó   …c                 óp   • [        U R                  5       5      nUS==   U-  ss'   U R                  U5      $ r_  rw  )r}  r“   r5   r$   r~   s        r   Ú"_reduce_scatter_tensor_native_metar•  ¸  s/   € Ü�—‘“Ó€EØ	ˆ!ƒH�ÑƒHØ�=‰=˜ÓÐr   c                óp   • [        U R                  5       5      nUS==   U-  ss'   U R                  U5      $ r_  rw  )r}  r“   r5   r$   rí   r~   s         r   Ú&_reduce_scatter_tensor_out_native_metar—  ¾  s1   € ô �—‘“Ó€EØ	ˆ!ƒH�ÑƒHØ�=‰=˜ÓÐr   c           	      óF   • U  Vs/ s H  n[        XAX#5      PM     sn$ s  snf rn   )r•  )rR   r“   r5   r$   r}  s        r   Ú,_reduce_scatter_tensor_coalesced_native_metar™  Æ  s0   € ñ
 óâˆCô 	+¨3¸:ÖRÙñð ùò r“  r   ÚIMPLr'   ÚMetaÚall_reduce_rM   Úall_reduce_coalesced_r   Úall_gather_into_tensor_outr0   rQ   rG   Úreduce_scatter_tensor_outrW   r   r"   Ú
broadcast_Ú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) -> TensorzTall_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Ú(rJ  )Útagsra   Úoutput_tensorÚinput_tensorÚasync_opc                 ó¾   • U(       a  [        S5      eU=(       d    [        R                  R                  nUc  [        S5      eU R	                  [        XX$5      5      $ ©Nú@Can't remap async version of inplace op to functional collectiveúgroup cannot be None)r-   r»   r   ÚWORLDÚcopy_r7   )r¥  r¦  r   r§  r   r)   s         r   Úall_gather_tensor_inplacer®    sW   € ö ÜØNó
ð 	
ð ×%”T—Z‘Z×%Ñ%€EØ�}ÜÐ3Ó4Ð4à×ÑÔ0°È5ÓVÓWÐWr   r‘   r�   Úopc           	      óÀ   • U(       a  [        S5      eU=(       d    [        R                  R                  nUc  [        S5      eU R	                  [        XXSU5      5      $ r©  )r-   r»   r   r¬  r­  rG   )r�   r™   r¯  r   r§  rA   r   s          r   Úreduce_scatter_tensor_inplacer±  '  sW   € ö ÜØNó
ð 	
ð ×%”T—Z‘Z×%Ñ%€EØ�}ÜÐ3Ó4Ð4à�<‰<Ô-¨e¸ÈSÓQÓRÐRr   ÚavgÚproductÚminÚmaxÚbandÚborÚbxorr   c                 ó¾   • U(       a  [        S5      eU=(       d    [        R                  R                  nUc  [        S5      eU R	                  [        XX$5      5      $ r©  )r-   r»   r   r¬  r­  r'   )r   r¯  r   r§  r   s        r   Úall_reduce_inplacerº  H  sT   € ö ÜØNó
ð 	
ð ×%”T—Z‘Z×%Ñ%€EØ�}ÜÐ3Ó4Ð4à�<‰<œ
 6¨uÓ:Ó;Ð;r   c           	      óÄ   • U(       a  [        S5      eU=(       d    [        R                  R                  nUc  [        S5      eU R	                  [        UUUUU5      5      $ r©  )r-   r»   r   r¬  r­  r   )r�   r™   rj   rk   r   r§  r   s          r   Úall_to_all_inplacer¼  [  sf   € ö ÜØNó
ð 	
ð ×%”T—Z‘Z×%Ñ%€EØ�}ÜÐ3Ó4Ð4à�<‰<ÜØØØØØó	
óð r   rI   c                 ó$  ^• U(       a  [        S5      eTR                  5       S:w  a%  [        U4S jU  5       5      (       d  [        S5      eU=(       d    [        R                  R
                  nUc  [        S5      e[        TSX$5      n/ nSnU  HV  nUR                  5       S:H  n	U	(       a  SOUR                  S5      n
U	(       a  XW   OXWXz-    nUR                  U5        Xz-  nMX     [        X5       H  u  pÍUR                  U5        M     U $ )Nrª  r   c              3   óh   >#   • U  H'  oR                  S 5      TR                  S 5      :H  v •  M)     g7f)r   N)rF   )rs   r¾   r   s     €r   rt   Ú%all_gather_inplace.<locals>.<genexpr>ƒ  s$   øé € Ð$VÊ+ÀQ§V¡V¨A£Y°&·+±+¸a³.Ö%@Ê+ùs   ƒ/2z7Remapping variable size all_gather is not yet supportedr«  r
   )r-   r:   r}   r»   r   r¬  r7   rF   r`  rV   r­  )rI   r   r   r§  r   r�   Úoutput_splitsÚoffsetr¾   Ú	is_scalarÚt_offsetrí   rÁ   r   s    `            r   Úall_gather_inplacerÄ  x  sú   ø€ ö ÜØNó
ð 	
ð ‡z�zƒ|�qÓ¤Ô$VÉ+Ó$V×!VÑ!VÜÐVÓWÐWà×%”T—Z‘Z×%Ñ%€EØ�}ÜÐ3Ó4Ð4ä˜v q¨%Ó5€Fð €MØ€FÛˆØ—E‘E“G˜q‘Lˆ	Þ!‘1 q§v¡v¨a£yˆæ )ˆfŠn¨v¸vÑ?PÐ/QˆØ×Ñ˜SÔ!àÑŠñ ô ˜Ö3‰ˆØ�	‰	�#Žñ 4àÐr   )Ú_all_gather_baseÚ_reduce_scatter_baseÚ
all_gatherr0   r'   r   rG   )Ú )T)NFrÈ  r   )r‘   NFr   rÈ  )r‘   NFrÈ  )NNNFrÈ  )NFrÈ  )ŸÚ
contextlibÚsysr8  Útypingr   r   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   Ú	Exceptionr9  rN   rp   r*  r/  r6  Ú
RANK_TYPESr   rÍ   r  r"   r'   r7   r@   rG   rK   rM   rQ   rW   ri   r   r…   rŠ   rŽ   ÚlibraryÚregister_autogradr–   rš   rœ   rŸ   r¡   r¤   r¦   r¨   r¬   r®   r°   r²   r´   r¶   rÂ   r2   r¹   r!   ÚautogradÚFunctionr<   Ú	custom_oprF  Úregister_fakerJ  rL  rN  r  rU  r#   Úcontextmanagerr]  rd  rg  rj  ro  rq  rt  rx  rz  r~  r�  rƒ  rˆ  rŒ  rŽ  r�  r’  r•  r—  r™  ÚLibraryÚlib_implÚimplÚfxÚnodeÚhas_side_effectr   r   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Å  Úlegacy_all_gather_baserÆ  Úlegacy_reduce_scatter_baserÇ  Úlegacy_all_gatherr0   Úlegacy_allgatherÚlegacy_allreduceÚlegacy_all_to_all_singleÚlegacy_reducescatterÚtraceable_collective_remapsr   r   r   Ú<module>r     sÇ  ðã Û 
Û ß 2Ó 2ã Ý  ß 1Ð 1Ý .Ý 4Ý =å :ð2Ý5ð
ÝNðð#ðJð
 Øˆ�IØˆˆc‰�OØ×ÑØØ	Ð
" CÐ
'Ñ(Ø‡N�Nðñ€
ðò::ñ&�E—L‘Lð & sð &°:ð &ÀCõ &ñ&�U—\‘\ð &¨Sð &¸ð &È#õ &ð4 ñ	&Ø
�,‰,ð&àð&ð ð&ð 
ð	&ð
 ‡\�\õ&ðZ ñ	Ø
�,‰,ðàðð ðð 
õ	ðL ñ(Ø
�,‰,ð(àð(ð ð(ð ð	(ð
 
õ(ð` ñ%Ø
�,‰,ð%àð%ð ð%ð ð	%ð
 
õ%ðR LNñ6Ø
ˆu�|‰|Ñ
ð6Ø(+ð6Ø4>ð6ØEHð6à	ˆ%�,‰,Ñõ6ð: =?ñ6Ø
ˆu�|‰|Ñ
ð6Ø%/ð6Ø69ð6à	ˆ%�,‰,Ñõ6ðD ñ-6Ø�—‘Ñð-6àð-6ð �c‘ð-6ð ð	-6ð
 
ð-6ð 
ˆ%�,‰,Ñõ-6òdVð* ñ2&Ø
�,‰,ð2&à˜S™	 DÑ(ð2&ð ˜C‘y 4Ñ'ð2&ð ð	2&ð
 
ð2&ð ‡\�\õ2&ðt ñ'*Ø
�,‰,ð'*à˜S™	 DÑ(ð'*ð ˜C‘y 4Ñ'ð'*ð ð	'*ð
 
ð'*ð ‡\�\õ'*ð^¨5¯<©<ô òð ‡�× Ñ Ø#ØØ+ð  ñ ð+¨%¯,©,ô +ò8
&ð ‡�× Ñ Ø"ØØ*ð  ñ ð+°e·l±lô +ò8 ð ‡�× Ñ Ø.Ø#Ø6ð  ñ ð1°U·\±\ô 1òD&ð ‡�× Ñ Ø-Ø"Ø5ð  ñ ð1°·±ô 1ò8.ð ‡�× Ñ Ø)ØØ1ð  ñ ð=°T¸%¿,¹,Ñ5Gô =ò>&ð ‡�× Ñ Ø,Ø!Ø4ð  ñ ð=ÀÀeÇlÁlÑASô =ò8 ð ‡�× Ñ Ø8Ø-Ø@ð  ñ ðCÀÀUÇ\Á\Ñ@Rô CòD&ð ‡�× Ñ Ø7Ø,Ø?ð  ñ ð ñ	VØ
�,‰,ðVà�#‰YðVð ðVð 
ð	Vð
 ‡\�\õVô>q#˜EŸL™Lô q#ðhñ
L&˜ð L&¨#ð L&°u¸SÀ$ÀsÁ)ÈSÐ=PÑ7Qõ L&ñ^,L˜zð ,L°ð ,L¸T¿^¹^õ ,Lô^�u—~‘~×.Ñ.ô ð$ ‡�×ÑØ-ØØ%ð ð ð
( §¡ð (°%·,±,ó (óð
(ð  ×$Ñ$ð#ˆU�\‰\ð #˜eŸl™ló #ó %ð#ð°U·\±\ô ò 	ð × 'Ñ 'Ø"Ø5ð (ñ ð(˜ô (ð' §¡ô 'ð ×Ññ#
¸ô #
ó ð#
òLòFò
"òIò"ò:ò%ò/òòòò.ò
)ò:ò:òò ò òð �=‰=× Ñ Ð!3°VÓ<€Ø ‡�ˆlÐ,¨fÔ 5Ø ‡�ˆmÐ.°Ô 7Ø ‡�Ð$Ð&@À&Ô IØ ‡�Ð%Ð'BÀFÔ KØ ‡�ˆmÐ.°Ô 7Ø ‡�Ø Ð"IÈ6ôð 	‡�Ð&Ð(KÈVÔ TØ ‡�Ø&Ø1Ø
ôð
 	‡�Ð%Ð'IÈ6Ô RØ ‡�ØÐ!GÈôð 	‡�Ø%Ø0Ø
ôð
 	‡�Ð!Ð#:¸FÔ CØ ‡�ˆk˜?¨FÔ 3Ø ‡�ˆlÐ,¨fÔ 5ð ‡�‡�× Ñ ˜eŸi™i×8Ñ8×DÑD×LÑLÔ MØ ‡�‡�× Ñ ˜eŸi™i×8Ñ8×DÑDÔ Eð �]‰]×"Ñ"Ð#4°eÓ<€
Ø—-‘-×'Ñ'Ð(9¸6ÓB€ò
€ð �K‰K˜Ñ!€	Û€FØ�Q˜Ÿ™ cÓ*Ð+€GÙ˜<¨1¨W¨I¨Ó7€LØ×Ò�f 5§9¢9×#>Ò#>ÐÑ?Ø×Ñ˜ ,Ð0KÖLñ	 ðð ØØØñXØ—<‘<ðXà—,‘,ðXð ð	Xð
 
ðXð õXð. Ø
ØØØñSØ�L‰LðSà�<‰<ðSð 	ðSð
 ðSð ðSð 
õSð, 	‡M‚M×Ò�uØ‡M‚M×Ò�uØ‡M‚M×Ò˜9Ø‡M‚M×Ò�uØ‡M‚M×Ò�uØ‡M‚M×Ò˜Ø‡M‚M×Ò�uØ‡M‚M×Ò˜ð	Ð ð Ø
ØØñ<Ø�L‰Lð<àð<ð ð	<ð
 
õ<ð, ØØ
ØØñØ�L‰Lðà�<‰<ðð 
õð@ ØØñ"Ø�e—l‘lÑ#ð"à�L‰Lð"ð
 
õ"÷J÷ ñ ð Ð/ØÐ7ØÐ(ØÐ0ØÐ)ØÐ =ØÐ5ðÑ øðo4 ó 2ß1Ð1ð2ûð ó 	Ø‡M‚MØnØòõ
ð	ús$   Ád+ Ád> ä+d;ä:d;ä>eåe