ó
    EñiÕ@  ã                  óH  • % S SK Jr  S SKrS SKrS SKrS SKrS SKrS SKJr  S SK	J
r
  S SKJrJr  S SKJrJr  S SKrS SKrS SKJ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!J"r"J#r#  S
SK$J%r%  S
SK&J'r'J(r(J)r)  \(       a  S SK*J+r+J,r,J-r-  S SK.J/r/  S SK0J1r1  \" S5      r2\" S5      r3\Rh                  " \55      r6S&S jr7\S'S j5       r8\#S(S j5       r9 S)         S*S jjr:    S+S jr;\#S,S j5       r< " S S\Rz                  5      r>\#      S-S j5       r?\#S.S j5       r@S/S jrA\R„                  R†                  rC\CRˆ                  \CRŠ                  \CRŒ                  \CRŽ                  \CR�                  \CR’                  \CR”                  \CR–                  \CR˜                  \CRš                  \CRœ                  \CRž                  \CR                   \CR¢                  R¤                  \CR¢                  R¦                  \CR¨                  \CRª                  \CR¬                  \CR®                  \CR°                  \CR²                  \CR´                  1r[\" \[5      r[\#S,S j5       r\      S0S jr]      S1S  jr^S q_S!\`S"'   S2S# jra            S3S$ jrb S4       S5S% jjrcg)6é    )ÚannotationsN)Úcontextmanager)Úpartial)ÚAnyÚTYPE_CHECKING)Ú	ParamSpecÚTypeVar)ÚSymInt)Úget_decompositions)Úbind_symbolsé   )Úaot_functionÚ
aot_moduleÚmake_boxed_compiler)Ústrip_overloads)Údefault_partitionÚ
draw_graphÚ#min_cut_rematerialization_partition)ÚCallableÚ	GeneratorÚSequence)ÚNode)ÚIntLikeTypeÚ_PÚ_Rc                óþ   • U R                   R                  S[        R                  R                  R
                  S9 H,  n[        R                  R                  R                  Ul        M.     U R                  5         U $ )NÚcall_function©ÚopÚtarget)	ÚgraphÚ
find_nodesÚtorchÚopsÚatenÚ_to_copyÚtor    Ú	recompile)Úfx_gÚnodes     ÚW/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torch/_functorch/compilers.pyÚ_canonicalizer,   /   s[   € Ø—
‘
×%Ñ%Ø¤5§9¡9§>¡>×#:Ñ#:ð &ó ˆô —i‘i—n‘n×'Ñ'ˆŽñð 	‡N�NÔØ€Kó    c               #  óÚ   #   • [         R                  R                  S5      n  S v •  [         R                  R                  U 5        g ! [         R                  R                  U 5        f = f7f)NF)r#   Ú_CÚ_jit_set_autocast_mode)Úold_jit_autocast_flags    r+   Ú_disable_jit_autocastr2   8   sL   é € ô "ŸH™H×;Ñ;¸EÓBÐð?Ûô 	�‰×'Ñ'Ð(=Õ>øŒ�‰×'Ñ'Ð(=Õ>üs   ‚ A+£A § A+Á!A(Á(A+c                óp  • [        5          [        U 5        U R                  R                  S[        R
                  R                  R                  S9 Ht  n[        UR                  5      S:X  d  M  [        UR                  5      S:X  d  M9  SUR                  ;   d  MK  [        R
                  R                  R                  Ul        Mv     U R                  R                   H]  n0 nUR                  R                  5        H4  u  pE[        U[        R                   5      (       a  UR"                  nXSU'   M6     X2l
        M_     U R                  R%                  5         U R'                  5         [        R(                  R+                  U 5      n[        R,                  R/                  UR                  5        [        R(                  R1                  UR3                  5       5      n[        R(                  R5                  U5      n[7        S U 5       5      (       d  U" U6   SSS5        U$ ! , (       d  f       W$ = f)zæ
Compiles the :attr:`fx_g` with Torchscript compiler.

.. warning::
    This API is experimental and likely to change.

Args:
    fx_g(fx.GraphModule): The input Fx graph module to be compiled.

Returns:
    Torch scripted model.
r   r   r   Údtypec              3  ój   #   • U  H)  n[        U[        R                  R                  5      v •  M+     g 7f©N)Ú
isinstancer#   Ú_subclassesÚ
FakeTensor)Ú.0Úts     r+   Ú	<genexpr>Úts_compile.<locals>.<genexpr>n   s&   é € ÐMÊÀ1”:˜a¤×!2Ñ!2×!=Ñ!=×>Ð>Êùs   ‚13N)r2   r   r!   r"   r#   r$   r%   r&   ÚlenÚargsÚkwargsr'   r    ÚnodesÚitemsr7   ÚdeviceÚtypeÚlintr(   ÚjitÚscriptr/   Ú_jit_pass_remove_mutationÚfreezeÚevalÚoptimize_for_inferenceÚany)r)   Úinpsr*   Ú
new_kwargsÚkÚvÚfs          r+   Ú
ts_compilerR   C   s‰  € ô 
Õ	 Ü˜Ôà—J‘J×)Ñ)Ø¤u§y¡y§~¡~×'>Ñ'>ð *ó 
ˆDô �4—9‘9‹~ Õ"¤s¨4¯;©;Ó'7¸1Õ'<ÀÈDÏKÉKÕAWÜ#Ÿi™iŸn™n×/Ñ/�–ñ	
ð —J‘J×$Ô$ˆDØˆJØŸ™×)Ñ)Ö+‘�Ü˜a¤§¡×.Ñ.ØŸ™�AØ !˜1“ñ ,ð %ŽKñ %ð 	�
‰
�‰Ôà�‰Ôä�I‰I×Ñ˜TÓ"ˆô 	�‰×*Ñ*¨1¯7©7Ô3ä�I‰I×Ñ˜QŸV™V›XÓ&ˆÜ�I‰I×,Ñ,¨QÓ/ˆÜÑMÉÓM×MÑMÙˆt‰H÷; 
!ð< €H÷= 
!Ô	 ð< €Hús   ‹A"H&Á1H&ÂH&ÂE>H&È&
H5c                óD   • [        U R                  5        [        XUS9  U $ )N)Ú
clear_meta)ÚprintÚcoder   )r)   Ú_ÚnamerT   s       r+   Ú_draw_graph_compilerY   s   s   € ô 
ˆ$�)‰)ÔÜˆt jÒ1Ø€Kr-   c                ó0   • [        [        [        U S95      $ )N©rX   )r   r   rY   r[   s    r+   Údraw_graph_compiler\   {   s   € ô œwÔ':ÀÑFÓGÐGr-   c                ó   • U $ )z²
Returns the :attr:`fx_g` Fx graph module as it is. This is a no-op compiler
and can be used to check accuracy.

.. warning::
    This API is experimental and likely to change.

© ©r)   rW   s     r+   Únopr`   �   s	   € ð €Kr-   c                  óT   ^ • \ rS rSrSSS.       SU 4S jjjrS	U 4S jjrSrU =r$ )
ÚDebugInterpreteréŽ   NT©Úinitial_envÚenable_io_processingc               óZ   >• [        U R                  /UQ76 U l        [        TU ]  " X1US.6$ )Nrd   )r   ÚmoduleÚsymbol_mappingÚsuperÚrun)Úselfre   rf   r?   Ú	__class__s       €r+   rk   ÚDebugInterpreter.run�   s<   ø€ ô +à�K‰Kð
ð ò
ˆÔô
 ‰wŠ{ØÐAUò
ð 	
r-   c                ó.  >^ ^
^^^• SU 4S jjmS	U4S jjmS
U4S jjm
SU
U4S jjn[         TT ]  U5      nSUR                  ;   aÎ  [        R                  " UR                  S   5      u  pE[        R                  " U5      u  pg[        U5      [        U5      :w  a"  [        [        U5       S[        U5       35      e[        [        [        U5      5      XF5       H5  u  mp‰[        U	[        R                  5      (       d  M'  U" X‰UU 4S j5        M7     U$ )Nc                ó  >• [        U [        5      (       d  U $ [        R                  " U R                  R
                  R                  TR                  5      5      nUR                  (       d  [        SU 35      e[        U5      $ )Nzexpected r to be a number, got )r7   r
   ÚsympyÚexpandr*   ÚexprÚxreplaceri   Ú	is_numberÚAssertionErrorÚint)ÚniÚrrl   s     €r+   Úsubst_symintÚ/DebugInterpreter.run_node.<locals>.subst_symintŸ   s_   ø€ Ü˜b¤&×)Ñ)Ø�	Ü—’˜RŸW™WŸ\™\×2Ñ2°4×3FÑ3FÓGÓHˆAØ—;—;Ü$Ð'FÀqÀcÐ%JÓKÐKÜ�q“6ˆMr-   c                ó.   >• [        U4S jU  5       5      $ )Nc              3  ó4   >#   • U  H  nT" U5      v •  M     g 7fr6   r^   )r:   rx   rz   s     €r+   r<   ÚHDebugInterpreter.run_node.<locals>.subst_symint_tuple.<locals>.<genexpr>¨   s   øé € Ð8²C¨b™ b×)Ð)²Cùs   ƒ)Útuple)Únisrz   s    €r+   Úsubst_symint_tupleÚ5DebugInterpreter.run_node.<locals>.subst_symint_tuple§   s   ø€ ÜÔ8±CÓ8Ó8Ð8r-   c                ó  >• T" U R                  5       5      S:”  ae  [        U R                  5       HL  nT" U R                  U5      5      UR                  U5      :w  d  M/  T" U R	                  U5      5      S:”  d  ML    g   g)Nr   r   FT)ÚnumelÚrangeÚndimÚstrideÚsize)ÚaÚbÚidxrz   s      €r+   Úcheck_significant_stridesÚ<DebugInterpreter.run_node.<locals>.check_significant_stridesª   sb   ø€ Ù˜AŸG™G›IÓ&¨Ó*Ü  §¡ž=�Cá$ Q§X¡X¨c£]Ó3°q·x±xÀ³}ÕDÙ(¨¯©°«Ó5¸Õ9á$ñ )ð r-   c           
     óz  >• [        U5      (       d  [        S[        U5       35      eU R                  UR                  :w  a,  [        U" 5        SU R                   SUR                   35      eT" U R	                  5       5      UR	                  5       :w  aK  [        U" 5        SU R	                  5        ST" U R	                  5       5       SUR	                  5        35      eT" X5      nU(       dK  [        U" 5        SU R                  5        ST" U R                  5       5       SUR                  5        35      eg )Nz"expected desc to be callable, got z: ú != z aka )Úcallablerv   rD   r4   rˆ   r‡   )ÚnvÚrvÚdescÚsame_stridesrŒ   r�   s       €€r+   ÚcheckÚ(DebugInterpreter.run_node.<locals>.check´   s  ø€ Ü˜D—>‘>Ü$Ð'IÌ$ÈtË*ÈÐ%VÓWÐWØ�x‰x˜2Ÿ8™8Ó#Ü$©« x¨r°"·(±(°¸4ÀÇÁ¸zÐ%JÓKÐKÙ! "§'¡'£)Ó,°·±³	Ó9Ü$Ù“v�h˜b §¡£ ¨5Ñ1CÀBÇGÁGÃIÓ1NÐ0OÈtÐTV×T[ÑT[ÓT]ÐS^Ð_óð ñ 5°RÓ<ˆLÞÜ$Ù“v�h˜b §¡£ ¨UÑ3EÀbÇiÁiÃkÓ3RÐ2SÐSWÐXZ×XaÑXaÓXcÐWdÐeóð ð  r-   Úvalr�   c                 ó(   >• ST  STR                    3$ )Nzoutput z where ©ri   )Úirl   s   €€r+   Ú<lambda>Ú+DebugInterpreter.run_node.<locals>.<lambda>Ò   s   ø€ ¨°¨s°'¸$×:MÑ:MÐ9NÑ&Or-   )rx   r   Úreturnrw   )r€   ztuple[IntLikeType, ...]r�   ztuple[int, ...])r‰   útorch.TensorrŠ   rž   r�   Úbool)r‘   rž   r’   rž   r“   zCallable[[], str]r�   ÚNone)rj   Úrun_nodeÚmetaÚpytreeÚtree_flattenr>   rv   Úzipr…   r7   r#   ÚTensor)rl   Únr•   ry   Ún_valsÚ_n_specÚr_valsÚ_r_specr‘   r’   rŒ   rš   rz   r�   rm   s   `         @@@@€r+   r¡   ÚDebugInterpreter.run_nodež   sÙ   ý€ ÷	÷	9÷	÷	ð 	ô ‰GÑ˜QÓˆØ�A—F‘F‹?Ü$×1Ò1°!·&±&¸±-Ó@‰OˆFÜ$×1Ò1°!Ó4‰OˆFô �6‹{œc &›kÓ)Ü$¬¨F« }°D¼¸V»¸Ð%FÓGÐGÜ ¤¤s¨6£{Ó!3°VÖD‘	��2Ü! "¤e§l¡l×3Ñ3ÙÙ�bÕOÖPñ Eð ˆr-   r™   )r?   r   re   zdict[Node, Any] | Nonerf   rŸ   r�   r   )r§   r   r�   r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__rk   r¡   Ú__static_attributes__Ú__classcell__)rm   s   @r+   rb   rb   Ž   sE   ø† ð /3Ø%)ñ	
àð
ð ,ð
ð #ð	
ð
 
÷
ð 
÷5õ 5r-   rb   c                ó,   • [        U 5      R                  $ )z˜
Returns a (slow) interpreter over the FX graph module that also checks
various debugging properties (e.g., that tracing strides matched real
strides.)
)rb   rk   r_   s     r+   Ú	debug_nopr´   Ö   s   € ô ˜DÓ!×%Ñ%Ð%r-   c                ó´   • [        U 5        [        R                  R                  U 5      n[        R                  R	                  UR                  5       5      nU$ r6   )r   r#   rF   rG   rI   rJ   )r)   rW   rQ   s      r+   Úsimple_ts_compiler¶   â   s=   € ä�DÔÜ�	‰	×Ñ˜Ó€AÜ�	‰	×Ñ˜Ÿ™›Ó"€AØ€Hr-   c                ó"   • [        U [        5      $ r6   )r   r¶   )rQ   s    r+   Únnc_jitr¸   ê   s   € Ü˜Ô,Ó-Ð-r-   c                ó0   • [        U R                  5        U $ r6   )rU   rV   r_   s     r+   Úprint_compilerº     s   € ä	ˆ$�)‰)ÔØ€Kr-   c                óÔ   • [         [         [        [        S.nUR                  U5        [	        U [
        R                  R                  5      (       a  [        U 40 UD6$ [        U 40 UD6$ )a:  
Wrapper function over :func:`aot_function` and :func:`aot_module` to perform
memory efficient fusion. It uses the
:func:`min_cut_rematerialization_partition` partitioner to perform efficient
recomputation. It uses NVFuser to compile the generated forward and backward
graphs.

.. warning::
    This API is experimental and likely to change.

Args:
    fn (Union[Callable, nn.Module]): A Python function or a ``nn.Module``
        that takes one or more arguments. Must return one or more Tensors.
    **kwargs: Any other overrides you want to make to the settings

Returns:
    Returns a ``Callable``  or ``nn.Module`` that retains the eager behavior
    of the original :attr:`fn`, but whose forward and backward graphs have
    gone through recomputation optimizations, and the graphs have been
    compiled with nvfuser.

©Úfw_compilerÚbw_compilerÚpartition_fnÚdecompositions)
rR   r   Údefault_decompositionsÚupdater7   r#   ÚnnÚModuler   r   )Úfnr@   Úconfigs      r+   Úmemory_efficient_fusionrÇ     sZ   € ô6 "Ü!Ü;Ü0ñ	€Fð ‡M�M�&ÔÜ�"”e—h‘h—o‘o×&Ñ&Ü˜"Ñ' Ñ'Ð'ä˜BÑ) &Ñ)Ð)r-   c                óê   • U R                  S5        [        SU Vs/ s H  o"R                  UR                  4PM     sn S35        SSKJn  U" 5       R                  5       " U6   [        X5      $ s  snf )NÚfooaQ  
##############################################################
# To minimize FX graph, copy and paste the below and run it  #
##############################################################

import torch
import torch.fx as fx
from functorch.compile import minifier, check_nvfuser_subprocess, check_nvfuser_correctness_subprocess

inps = a?  
inps = [torch.ones(shape, dtype=dtype, device='cuda') for (shape, dtype) in inps]
from foo import FxModule
mod = FxModule().cuda()

with torch.jit.fuser("fuser2"):
  # check_nvfuser_subprocess can be replaced with check_nvfuser_correctness_subprocess
  minifier(fx.symbolic_trace(mod), inps, check_nvfuser_subprocess)
r   )ÚFxModule)Ú	to_folderrU   Úshaper4   rÉ   rÊ   ÚcudarR   )r)   rM   rš   rÊ   s       r+   Údebug_compilerÎ   9  so   € ð 	‡N�N�5ÔÜ	ð	ñ &*Ó*¢T �'‰'�1—7‘7Ó	¡TÑ*Ð+ð ,ð	ôõ( áƒJ‡O�OÔ�tÑä�dÓ!Ð!ùò 	+s   œ!A0
rw   Úgraph_indexc                óP  • / n[        U S5       n[        R                  " U5      n/ nU HÞ  n[        U5      S:X  a  UnU" [        R                  " 5       5      nO�Uu  pWp‰n
U	[
        R                  [
        R                  [
        R                  [
        R                  [
        R                  [
        R                  [        [        1;   a  [
        R                  " SSXyU
S9nO[
        R                  " XyU
S9nUR                  U5        Mà     SSS5        U$ ! , (       d  f       U$ = f)zR
Return a random input for the given inputs meta generated from _save_fx_default.
Úrbr   r   )r4   rC   N)ÚopenÚpickleÚloadr>   Úrandomr#   rw   Úint32Úint64rŸ   Úuint8ÚfloatÚrandintÚrandÚappend)Úinput_data_pathÚinputsrQ   Úinputs_metar¢   rD   Úinput_rÌ   Ú_strider4   rC   s              r+   Ú
get_inputsrâ   [  sè   € ð "$€FÜ	ˆo˜tÔ	$¨Ü—k’k !“nˆØˆÛˆDÜ�4‹y˜A‹~Ø�ÙœfŸmšm›oÓ.‘à6:Ñ3�˜W¨VØÜ—I‘IÜ—K‘KÜ—K‘KÜ—J‘JÜ—I‘IÜ—K‘KÜÜð	ó 	ô #Ÿ]š]¨1¨a°ÈFÑS‘Fä"ŸZšZ¨À6ÑJ�FØ�M‰M˜&Ö!ñ'  ÷ 
%ð. €M÷/ 
%Ô	$ð. €Mús   �C=DÄ
D%c           	     óÀ   ^ ^^^	^
• SSK Jn  S	U	4S jjm	        S
U UUU	4S jjm
      SU
4S jjn      SU
4S jjn      SU
4S jjnU" UUUUU[        S9$ )a  
The forward, backward, and joint computation graph will be stored in
{folder_name}/{current_name}/{current_name}_forward_{graph_index},
{folder_name}/{current_name}/{current_name}_backward_{graph_index}, and
{folder_name}/{current_name}/{current_name}_joint_{graph_index} respectively.
The input shape of the graphs will be stored in the .input files.
These files can be loaded with pickle,
and is a list of format (type, shape, stride, dtype, device).
In the case of type = int or float, it is just (type,).
For joint graph input, it is a nested list [[],[]]
where the two inner lists have the same format.
If dump_example_input is True, example_inputs will be stored in .pt file.
Since each function might produce multiple graphs,
the graph_index is used to distinguish difference graphs
r   )Úaot_module_simplifiedc                óÀ  >• / n[        U 5      S:”  a6  [        U S   [        5      (       a  UT" U S   5      -  nUT" U S   5      -  nU$ U  H�  n[        U5      [        L d  [        U5      [
        L a  UR                  [        U5      45        MD  UR                  [        U5      UR                  UR                  5       UR                  UR                  45        M‘     U$ )Nr   r   )r>   r7   r   rD   rw   rÙ   rÜ   rÌ   r‡   r4   rC   )r?   Ú
input_metaÚargÚget_input_metas      €r+   rè   Ú(_save_fx_default.<locals>.get_input_meta’  s¾   ø€ Øˆ
Üˆt‹9�q‹=œZ¨¨Q©´×7Ñ7Ø™.¨¨a©Ó1Ñ1ˆJØ™.¨¨a©Ó1Ñ1ˆJØÐÛˆCÜ�C‹yœCÒ¤4¨£9´Ò#5Ø×!Ñ!¤4¨£9 ,Ö/à×!Ñ!Ü˜#“Y §	¡	¨3¯:©:«<¸¿¹ÀCÇJÁJÐOöñ	 ð Ðr-   c                ó2  >• [        U R                  R                  5      S:X  a,  [        R                  [        R
                  STU[        5        g [        R                  " U 5      nUR                  R                  [        R                  R                  R                  5       5        UR                  5         T	" U5      n[        R                  " T ST 3SS9  UR!                  T ST ST SU S[         3	5        [#        T ST ST SU S[         ST SU S[         S3S5       n[$        R&                  " XE5        S S S 5        T(       a8  [        R(                  " UT ST ST SU S[         ST SU S[         S	35        g g ! , (       d  f       NN= f)
Nr   z!No nodes in graph {%s}_{%s}_{%s}.Ú/T)Úexist_okrW   z.inputÚwbz.pt)r>   r!   rA   ÚlogÚloggingÚWARNINGrÏ   ÚcopyÚdeepcopyÚset_codegenr#   ÚfxÚCodeGenr(   ÚosÚmakedirsrË   rÒ   rÓ   ÚdumpÚsave)
Ú
gm_to_saver?   Ú	type_nameÚgmræ   rQ   Úcurrent_nameÚdump_example_inputÚfolder_namerè   s
         €€€€r+   Úgraph_saver_helperÚ,_save_fx_default.<locals>.graph_saver_helper¡  s   ø€ ô ˆz×Ñ×%Ñ%Ó&¨!Ó+Ü�G‰GÜ—‘Ø3ØØÜôð ä�]Š]˜:Ó&ˆØ
�‰×ÑœUŸX™XŸ^™^×3Ñ3Ó5Ô6Ø
�‰Œá# DÓ)ˆ
ä
�Š�{�m 1 \ NÐ3¸dÒCØ
�‰Øˆm˜1˜\˜N¨!¨L¨>¸¸9¸+ÀQÄ{ÀmÐTô	
ô Øˆm˜1˜\˜N¨!¨L¨>¸¸9¸+ÀQÄ{ÀmÐSTÐUaÐTbÐbcÐdmÐcnÐnoÔp{Ðo|ð  }Cð  DØô
ð Ü�KŠK˜
Ô&÷	
ö
 Ü�JŠJØØ�-˜q  ¨a°¨~¸Q¸y¸kÈÌ;È-ÐWXÐYeÐXfÐfgÐhqÐgrÐrsÔtð  tAð  ADð  Eõð ÷
õ 
ús   Ä)FÆ
Fc                ó   >• T" XS5        U $ )NÚforwardr^   ©rü   Úexample_inputsr   s     €r+   Úgraph_saver_forwardÚ-_save_fx_default.<locals>.graph_saver_forwardÄ  s   ø€ ñ 	˜2¨yÔ9Øˆ	r-   c                ó,   >• T" XS5        [         S-  q U $ )NÚbackwardr   )rÏ   r  s     €r+   Úgraph_saver_backwardÚ._save_fx_default.<locals>.graph_saver_backwardÊ  s   ø€ ñ 	˜2¨zÔ:ä�qÑˆØˆ	r-   c                ó,   >• T" XS5        [        X5      $ )NÚjoint)r   )rü   Ú
joint_argsr   s     €r+   Úgraph_saver_jointÚ+_save_fx_default.<locals>.graph_saver_jointÒ  s   ø€ ñ 	˜2¨7Ô3Ü  Ó0Ð0r-   r¼   )r?   r   r�   z	list[Any])rú   úfx.GraphModuler?   r   rû   Ústrr�   r    )rü   r  r  úlist[torch.Tensor]r�   r  )rü   r  r  r  r�   z%tuple[fx.GraphModule, fx.GraphModule])Úfunctorch.compilerä   rÁ   )rý   rÿ   rþ   rü   r  rä   r  r
  r  rè   r   s   ```      @@r+   Ú_save_fx_defaultr  z  s°   ü€ õ, 8÷ð!Ø"ð!Ø*-ð!Ø:=ð!à	÷!ò !ðFØðØ,>ðà	÷ðØðØ,>ðà	÷ð1Øð1Ø(:ð1à	.÷1ñ !Ø
ØØ'Ø(Ø&Ü-ñð r-   c                ó(   • Sq [        [        XU5      $ )aK  
Dump the forward, backward, and joint computation graph.
Example Usage:
save_fx_func = graph_dumper_aot(current_name, folder_name, dump_example_input = False)
optimize_ctx = torchdynamo.optimize(
    save_fx_func
)
with torch.enable_grad():
    with optimize_ctx:
        result = forward_and_backward_pass(model, example_inputs)
r   )rÏ   r   r  )rý   rÿ   rþ   s      r+   Úgraph_dumper_aotr  ä  s   € ð €KÜÔ# \Ð@RÓSÐSr-   )r)   r  r�   r  )r�   zGenerator[None, None, None])r)   r  rM   zSequence[Any]r�   útorch.jit.ScriptModule)T)
r)   r  rW   r   rX   r  rT   rŸ   r�   r  )rX   r  r�   z5Callable[[fx.GraphModule, list[Any]], fx.GraphModule])r)   r  rW   r   r�   r  )r)   r  rW   r   r�   zDCallable[[DebugInterpreter, Any, dict[Node, Any] | None, bool], Any])r)   r  rW   r   r�   r  )rQ   úCallable[..., Any]r�   r  )rÅ   úCallable[_P, _R] | nn.Moduler@   r   r�   r  )r)   r  rM   zSequence[torch.Tensor]r�   r  )rÝ   r  r�   r  )rý   r  rÿ   r  rþ   rŸ   rü   ztorch.fx.GraphModuler  r  r�   z	nn.Module)F)rý   r  rÿ   r  rþ   rŸ   r�   z Callable[[bool, nn.Module], Any])dÚ
__future__r   rñ   rï   rö   rÓ   rÕ   Ú
contextlibr   Ú	functoolsr   Útypingr   r   Útyping_extensionsr   r	   rq   r#   Útorch.fxrô   Útorch.nnrÃ   Útorch.utils._pytreeÚutilsÚ_pytreer£   r
   Útorch._decompr   Ú%torch.fx.experimental.symbolic_shapesr   Úaot_autogradr   r   r   Úcompile_utilsr   Úpartitionersr   r   r   Úcollections.abcr   r   r   Útorch.fx.noder   Útorch.typesr   r   r   Ú	getLoggerr­   rî   r,   r2   rR   rY   r\   r`   ÚInterpreterrb   r´   r¶   r¸   r$   r%   ÚdetachÚgelu_backwardÚleaky_relu_backwardÚsigmoid_backwardÚthreshold_backwardÚhardtanh_backwardÚhardsigmoid_backwardÚhardswish_backwardÚtanh_backwardÚsilu_backwardÚelu_backwardÚcudnn_batch_normÚcudnn_batch_norm_backwardÚmasked_fillÚScalarr¦   ÚeluÚ
leaky_reluÚhardtanhÚ	hardswishÚhardsigmoidÚconj_physicalÚis_same_sizerÁ   rº   rÇ   rÎ   rÏ   Ú__annotations__râ   r  r  r^   r-   r+   Ú<module>rF     s1  ðÞ "ã Û Û 	Û Û Ý %Ý ß %ß 0ã ã Ý Ý ß $Ð $Ý Ý ,Ý >ç GÑ GÝ *÷ñ ö ß=Ñ=å"Ý'ñ ˆtƒ_€ÙˆTƒ]€à×Ò˜Ó!€ô
ð ó?ó ð?ð ó,ó ð,ð` AEðØ
ðØ ðØ(+ðØ9=ðàõðHØ
ðHà:ôHð ó	ó ð	ôE�r—~‘~ô EðP ð&Ø
ð&Ø ð&àIó&ó ð&ð óó ðô.ð ‡y�y‡~�~€à‡K�KØ×ÑØ×ÑØ×ÑØ×ÑØ×ÑØ×ÑØ×ÑØ×ÑØ×ÑØ×ÑØ×ÑØ×"Ñ"Ø×Ñ×ÑØ×Ñ×ÑØ‡H�HØ‡O�OØ‡M�MØ‡N�NØ×ÑØ×ÑØ×Ñð-Ð ñ4 ,Ð,BÓCÐ ð óó ðð
$*Ø$ð$*àð$*ð "ô$*ðN"Ø
ð"Ø 6ð"àô"ð> €ˆSÓ ôð>fØðfàðfð ðfð 	ð	fð
 'ðfð ôfðV EJðTØðTØ$'ðTØ=AðTà%öTr-   