
    3j                        S 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JrJ	r	  SSKJ
r
Jr  SSKJrJr  SSKrSSKJr  SSKJr  SSKJr  S	S
KJrJ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$J%r%J&r&  SSK'J(r(  SSK)J*r*J+r+J,r,J-r-J.r.J/r/J0r0J1r1  SSK2J3r3  \(       a  SSK4J5r5  SSK6J7r7  \Rp                  " \95      r: " S S\(5      r; " S S\35      r< " S S\<5      r= " S S\;5      r> " S S\;5      r? " S  S!\;5      r@ " S" S#\;5      rA " S$ S%\;5      rB " S& S'\;5      rC " S( S)\;5      rD " S* S+\;5      rE " S, S-\;5      rF " S. S/\;5      rG " S0 S1\;5      rH " S2 S3\;5      rI " S4 S5\;5      rJ " S6 S7\;5      rK " S8 S9\;5      rL " S: S;\;5      rM " S< S=\;5      rN " S> S?\;5      rO " S@ SA\;5      rP " SB SC\;5      rQ " SD SE\;5      rR " SF SG\;5      rS " SH SI\;5      rT " SJ SK\;5      rU " SL SM\(5      rV " SN SO\(5      rWg)Pa)  
This file contains a collection of context manager classes used by Dynamo for tracking
and managing various PyTorch runtime states during graph compilation. These context
managers handle different aspects of PyTorch's execution environment, including:

- Autograd states (grad mode, inference mode)
- CUDA streams and events
- Profiling contexts
- Deterministic algorithms
- Forward/backward AD modes
- SDPA (Scaled Dot Product Attention) kernels
- FSDP (Fully Sharded Data Parallel) states
- AMP (Automatic Mixed Precision) autocast states

The context managers ensure proper state transitions during graph compilation by
tracking enter/exit points and managing cleanup operations. They help maintain
consistency between eager execution and compiled graph behavior by capturing and
restoring state changes.
    N)CallableSequenceSized)AbstractContextManager	ExitStack)AnyTYPE_CHECKING)config)Guard)warning_once   )graph_break_hints	variables)create_call_function)unimplemented)GuardBuilderinstall_guard)
AttrSourceGlobalStateSource)_get_error_on_graph_break_set_error_on_graph_break   )VariableTracker)NestedUserFunctionVariableSkipFunctionVariableUserFunctionVariableUserMethodVariable!WrappedNestedUserFunctionVariableWrappedSkipFunctionVariableWrappedUserFunctionVariableWrappedUserMethodVariable)UserDefinedObjectVariable)	PyCodegen)InstructionTranslatorc            	       J  ^  \ rS rSrSSSS1\R
                  kr SS\S\S-  S\SS4U 4S	 jjjrS
SS\4S jr SS
SS\	S\4   S-  SS4S jjr
S
SS\S\4S jrSS jrSS jrS\4S jrS\4S jrS
SS\\   S\\\4   S\4S jrS\4S jrS\4S jrSS jrSS jrSrU =r$ )ContextWrappingVariable>   cm_objtarget_valuesinitial_valuesstateNkwargsreturnc                 >   > [         TU ]  " S0 UD6  Xl        X l        g N )super__init__r)   r*   selfr)   r*   r,   	__class__s       ]/home/wildlama/miniconda3/lib/python3.13/site-packages/torch/_dynamo/variables/ctx_manager.pyr2    ContextWrappingVariable.__init__G   s!     	"6"*,    txr$   c                     [        U S5      (       a  U R                  XR                  5        U R                  U5        [        R
                  R                  S 5      $ N
_call_func)hasattrr<   r)   set_cleanup_hookr   ConstantVariablecreater4   r9   s     r6   enterContextWrappingVariable.enterN   sF    4&&OOB 2 23b!))0066r8   fn.c                 x   ^ ^ Uc	  SU U4S jjnUT l         TR                  R                  T R                  5        g )Nc                  b   > [        T S5      (       a  T R                  TT R                  5        g g r;   )r=   r<   r*   rA   s   r6   rD   4ContextWrappingVariable.set_cleanup_hook.<locals>.fnY   s)    4..OOB(;(;< /r8   r-   N
cleanup_fnoutputadd_cleanup_hookcleanupr4   r9   rD   s   `` r6   r>   (ContextWrappingVariable.set_cleanup_hookT   s3     := = 68
		""4<<0r8   argsc                 `    U R                  5         [        R                  R                  S 5      $ N)cleanup_assertr   r?   r@   r4   r9   rP   s      r6   exitContextWrappingVariable.exit`   s'     	))0066r8   c                     U" [        UR                  R                  U R                  5       5      U R	                  5       5      5        g rR   )r   r9   import_sourcemodule_namefn_namer4   codegens     r6   reconstruct_type(ContextWrappingVariable.reconstruct_typef   s2    wzz//0@0@0BCT\\^T	
r8   c                   ^ ^ TR                  UU 4S j5        T R                  nU(       d  SnTR                  U Vs/ s H  nTR                  U5      PM     sn5        TR                  [	        [        U5      S5      5        g s  snf )Nc                  &   > TR                  T 5      $ rR   )r]   )r\   r4   s   r6   <lambda>5ContextWrappingVariable.reconstruct.<locals>.<lambda>l   s    d&;&;G&Dr8   r0   F)add_push_nullr)   extend_outputcreate_load_constr   len)r4   r\   r)   vals   ``  r6   reconstruct#ContextWrappingVariable.reconstructk   sn    DE**MW#w88=WX23}3EuMN Xs   Bc                     [        S5      e)Nzmodule_name called on baseNotImplementedErrorr4   s    r6   rY   #ContextWrappingVariable.module_names   s    !">??r8   c                     [        S5      e)Nzfn_name called on baserk   rm   s    r6   rZ   ContextWrappingVariable.fn_namev   s    !":;;r8   c                    [        U5      S:X  d   e[        US   [        [        [        [
        45      (       d   e[        US   [        5      (       a  [        US   U 5      $ [        US   [        5      (       a  [        US   U 5      $ [        US   [        5      (       a  [        US   U 5      $ [        US   [
        5      (       a  [        US   U 5      $ [        S5      e)Nr   r   zUnexpected arg type)rf   
isinstancer   r   r   r   r   r   r!   r    AssertionErrorr4   r9   rP   r,   s       r6   call_function%ContextWrappingVariable.call_functiony   s     4yA~~G*$"$	
 
 	
 
 d1g9::4T!WdCCQ!566.tAw==Q!344,T!Wd;;Q!566.tAw== !677r8   c                     gNTr0   rm   s    r6   supports_graph_breaks-ContextWrappingVariable.supports_graph_breaks       r8   c                     grx   r0   rm   s    r6   exit_on_graph_break+ContextWrappingVariable.exit_on_graph_break   r{   r8   c                 N    U R                   b  U R                  5         S U l         g g rR   )rJ   rm   s    r6   rM   ContextWrappingVariable.cleanup   s"    ??&OO"DO 'r8   c                 T    U R                   (       d   S5       eU R                  5         g )Nzmultiple exits?)rJ   rM   rm   s    r6   rS   &ContextWrappingVariable.cleanup_assert   s    1 11r8   )rJ   r*   r)   rR   r\   r#   r-   NrH   )__name__
__module____qualname____firstlineno__r   _nonvar_fieldsr   r2   rB   r   r>   rU   r]   rh   strrY   rZ   r   dictru   boolry   r}   rM   rS   __static_attributes____classcell__r5   s   @r6   r&   r&   >   sD   	
 
	'	'N @D- -25*-OR-	- -7/ 7O 7 LP
1)
1/7S/AD/H
1	
17)72A7	7

O@S @< <8#8 '8 S/)*	8
 
88t T #
 r8   r&   c                      ^  \ rS rSrS\\   S\SS4U 4S jjrS\4S jrS\4S jr	S	S
S\
4S jrS	S
S\
S\
4S jrS\4S jrS\4S jrSrU =r$ )GenericContextWrappingVariable   r(   r,   r-   Nc                 V   > Uc   e[         TU ]  " SUUR                  S.UD6  Xl        g )N)value
value_typer0   )r1   r2   r5   r(   )r4   r(   r,   r5   s      r6   r2   'GenericContextWrappingVariable.__init__   s>    !!! 	
''	
 	

 r8   c                 .    U R                   R                  $ rR   )r(   r   rm   s    r6   rY   *GenericContextWrappingVariable.module_name   s    {{%%%r8   c                 @    [        U R                  5      R                  $ rR   )typer(   r   rm   s    r6   rZ   &GenericContextWrappingVariable.fn_name   s    DKK )))r8   r9   r$   c                     U R                   c  S O[        U R                   S5      n[        R                  " U R                  R
                  R                  U US9R                  U/ 0 5      $ )N	__enter__source)r   r   r   r   r(   r   __func__ru   )r4   r9   r   s      r6   rB   $GenericContextWrappingVariable.enter   sY    ,*T[[+2V++KK!!**
 -B
#		$r8   rP   c                     U R                   c  S O[        U R                   S5      n[        R                  " U R                  R
                  R                  U US9R                  U[        U5      0 5      nUR                  R                  5         U$ )N__exit__r   )r   r   r   r   r(   r   r   ru   listactive_generic_context_managerspop)r4   r9   rP   r   xs        r6   rU   #GenericContextWrappingVariable.exit   sx     ,*T[[*2U((KK  ))
 -DJ
+	 	

 	**..0r8   c                     gNFr0   rm   s    r6   ry   4GenericContextWrappingVariable.supports_graph_breaks   s    r8   c                     grx   r0   rm   s    r6   r}   2GenericContextWrappingVariable.exit_on_graph_break   r{   r8   )r(   )r   r   r   r   r   r   r2   r   rY   rZ   r   rB   rU   r   ry   r}   r   r   r   s   @r6   r   r      s    5c: c d &S &* *$/ $O $
)
2A
	
t T  r8   r   c                   d    \ rS rSrS\S\SS4S jrSSS\4S	 jrSSS
\S\4S jr	S\
S\4S jrSrg)$RepararametrizeModuleContextVariable   ctx_manager_vtmodr-   Nc                     Xl         X l        g rR   )cm_vtr   )r4   r   r   s      r6   r2   -RepararametrizeModuleContextVariable.__init__   s    #
r8   r9   r$   c                 L   [         R                  R                  R                  R	                  U5         U R
                  R                  US5      R                  5       U l        U R
                  R                  US5      R                  5       U l	        UR                  R                  R                  U R                  5        UR                  R                  R                  U R                  5        U R                  R                  U5      sS S S 5        $ ! , (       d  f       g = f)N_parameters_buffers)torch_dynamor   higher_order_ops dynamo_allow_side_effects_in_hopr   var_getattrrealizeold_parameters_varold_buffer_varrK   side_effectsignore_mutations_onr   rB   rA   s     r6   rB   *RepararametrizeModuleContextVariable.enter   s     ]]$$55VV
 '+hh&:&:2}&M&U&U&WD#"&(("6"6r:"F"N"N"PDII""66t7N7NOII""66t7J7JK::##B'
 
 
s   CD
D#rP   c                    [         R                  R                  R                  R	                  U5         U R
                  R                  " U/UQ76 nUR                  R                  R                  U R                  5        UR                  R                  R                  U R                  5        UsS S S 5        $ ! , (       d  f       g = frR   )r   r   r   r   r   r   rU   rK   r   stop_ignoring_mutations_onr   r   )r4   r9   rP   r   s       r6   rU   )RepararametrizeModuleContextVariable.exit   s    
 ]]$$55VV
 

*T*AII""==d>Q>QRII""==d>U>UV
 
 
s   A=B;;
C	namec                 .    [        U R                  U5      $ rR   )getattrr   )r4   r   s     r6   __getattr__0RepararametrizeModuleContextVariable.__getattr__   s    tzz4((r8   )r   r   r   r   )r   r   r   r   r&   r   r2   r   rB   rU   r   r   r   r0   r8   r6   r   r      sa    '> S T 

(/ 
(O 
()2A	) ) )r8   r   c            	       d    \ rS rSrSr\SSS\S\SS 4S j5       rSSS\4S	 jr	SSS
\S\4S jr
Srg))GradInplaceRequiresGradCtxManagerVariable   z#represents torch grad requires gradr9   r$   r)   r,   r-   c                     [        SUS S.UD6$ Nr)   r*   r0   )r   r9   r)   r,   s      r6   r@   0GradInplaceRequiresGradCtxManagerVariable.create   s&     9 
'
 
 	
r8   c                   ^  T R                   u  n[        R                  R                  R	                  5       T l        [        R                  R                  R                  U5        T R                  UU 4S j5        UR                  R                  S[        R                  R                  R                  U40 5      T l
        [        R                  R                  S 5      $ )Nc                  j   > [         R                  R                  R                  T R                  5      $ rR   )r   _C
_functorch!set_inplace_requires_grad_allowed
prev_staterm   s   r6   ra   AGradInplaceRequiresGradCtxManagerVariable.enter.<locals>.<lambda>
  s!    EHH''IIr8   ru   )r)   r   r   r   !get_inplace_requires_grad_allowedr   r   r>   rK   create_nodeproxyr   r?   r@   )r4   r9   enableds   `  r6   rB   /GradInplaceRequiresGradCtxManagerVariable.enter  s    &&	((--OOQ==gF	
 YY**HHAAJ	

 ))0066r8   rP   c                     U R                  5         UR                  R                  S[        R                  R
                  R                  U R                  40 5        [        R                  R                  S 5      $ Nru   )rM   rK   r   r   r   r   r   r   r   r?   r@   rT   s      r6   rU   .GradInplaceRequiresGradCtxManagerVariable.exit  s[     	
		HHAA__		
 ))0066r8   r   r   Nr   r   r   r   __doc__staticmethodr   r@   r   rB   rU   r   r0   r8   r6   r   r      sh    -
#
47
CF
	4
 
7/ 7O 7$
7)
72A
7	
7r8   r   c            	       d    \ rS rSrSr\SSS\S\SS 4S j5       rSSS\4S	 jr	SSS
\S\4S jr
Srg)0TemporarilyPopInterpreterStackCtxManagerVariablei#  zJrepresents torch._functorch.pyfunction.temporarily_pop_interpreter_stack()r9   r$   r)   r,   r-   c                     [        SUS S.UD6$ r   )r   r   s      r6   r@   7TemporarilyPopInterpreterStackCtxManagerVariable.create&  s'     @ 
'
 
 	
r8   c                 R  ^  [         R                  R                  R                  5       T l        T R                  UU 4S j5        UR                  R                  S[         R                  R                  R                  S0 5      T l        [        R                  R                  S 5      $ )Nc                  j   > [         R                  R                  R                  T R                  5      $ rR   )r   r   r   push_dynamic_layer_stacksavedrm   s   r6   ra   HTemporarilyPopInterpreterStackCtxManagerVariable.enter.<locals>.<lambda>4  s    EHH''@@Lr8   ru   r0   )r   r   r   pop_dynamic_layer_stackr   r>   rK   r   r   r   r?   r@   rA   s   ` r6   rB   6TemporarilyPopInterpreterStackCtxManagerVariable.enter0  s~    XX((@@B
L	
 YY**HH77	

 ))0066r8   rP   c                     U R                  5         UR                  R                  S[        R                  R
                  R                  U R                  40 5        [        R                  R                  S 5      $ r   )rM   rK   r   r   r   r   r   r   r   r?   r@   rT   s      r6   rU   5TemporarilyPopInterpreterStackCtxManagerVariable.exit>  sZ     	
		HH88ZZM		
 ))0066r8   )r   r   Nr   r0   r8   r6   r   r   #  sh    T
#
47
CF
	;
 
7/ 7O 7
7)
72A
7	
7r8   r   c                       \ rS rSrSr\" \" 5       \R                  5      r	\
SSS\SS 4S j5       rSSS\4S jrSSS	\S\4S
 jrSrg)%JvpIncrementNestingCtxManagerVariableiK  z5represents torch.func.jvp increment/decrement nestingr9   r$   r,   r-   c                 "    [        SS S S.UD6nU$ r   )r   r9   r,   vars      r6   r@   ,JvpIncrementNestingCtxManagerVariable.createU  s*     4 

 

 
r8   c                 j   [        U R                  5        [        R                  R                  R                  5       nU R                  US 5        UR                  R                  S[        R                  R                  R                  S0 5      U l        [        R                  R                  X5      $ )Nc                  R    [         R                  R                  R                  5       $ rR   )r   r   eager_transformsexit_jvp_nestingr0   r8   r6   ra   =JvpIncrementNestingCtxManagerVariable.enter.<locals>.<lambda>d  s    ((99JJLr8   ru   r0   )r   _guards_singletonr   r   r   enter_jvp_nestingr>   rK   r   r   _jvp_increment_nestingr   r   r   build)r4   r9   	jvp_levels      r6   rB   +JvpIncrementNestingCtxManagerVariable.enter`  s    d,,-$$55GGI	L	
 YY**HH66	

 ((..r==r8   rP   c                     U R                  5         UR                  R                  S[        R                  R
                  R                  S0 5        [        R                  R                  S 5      $ Nru   r0   )
rM   rK   r   r   r   r   _jvp_decrement_nestingr   r?   r@   rT   s      r6   rU   *JvpIncrementNestingCtxManagerVariable.exitn  sQ     	
		UXX00GGR	
 ))0066r8   r   Nr   r   r   r   r   r   r   r   FUNCTORCH_STACK_MATCHr   r   r   r@   r   rB   rU   r   r0   r8   r6   r   r   K  sy    ? /1<3U3UV#/2	0 >/ >O >7)72A7	7r8   r   c            	       r    \ rS rSrSr\SSS\S\SS 4S j5       rSSS\4S	 jr	SSS
\S\4S jr
S\4S jrSrg)SetFwdGradEnabledContextManagerix  zWrepresents torch.autograd.forward_ad._set_fwd_grad_enabled() to enable/disable fwd gradr9   r$   r)   r,   r-   c                     [        SUS S.UD6$ r   )r  r   s      r6   r@   &SetFwdGradEnabledContextManager.create{  s&     / 
'
 
 	
r8   c                   ^  T R                   u  n[        R                  R                  5       T l        [        R                  R                  U5        T R                  UU 4S j5        UR                  R                  S[        R                  R
                  U40 5      T l	        [        R                  R                  S 5      $ )Nc                  V   > [         R                  R                  T R                  5      $ rR   )r   r   _set_fwd_grad_enabledr   rm   s   r6   ra   7SetFwdGradEnabledContextManager.enter.<locals>.<lambda>  s    EHH224??Cr8   ru   )r)   r   r   _is_fwd_grad_enabledr   r  r>   rK   r   r   r   r?   r@   )r4   r9   modes   `  r6   rB   %SetFwdGradEnabledContextManager.enter  s    ##((779&&t,C	
 YY**HH**G	

 ))0066r8   rP   c                     U R                  5         UR                  R                  S[        R                  R
                  U R                  40 5        [        R                  R                  S 5      $ r   )
rM   rK   r   r   r   r  r   r   r?   r@   rT   s      r6   rU   $SetFwdGradEnabledContextManager.exit  sU     	
		HH**__		
 ))0066r8   c                 J    [         R                  R                  R                  $ rR   )r   autograd
forward_adr  rm   s    r6   python_type+SetFwdGradEnabledContextManager.python_type  s    ~~((>>>r8   r   N)r   r   r   r   r   r   r   r@   r   rB   rU   r   r  r   r0   r8   r6   r  r  x  st    a
#
47
CF
	*
 
7/ 7O 7 
7)
72A
7	
7?T ?r8   r  c                       \ rS rSrSr\" \" 5       \R                  5      r	\
SSS\SS 4S j5       rSSS\4S jrSSS	\S\4S
 jrS\4S jrSrg)DualLevelContextManageri  z;Represents torch.autograd.forward_ad.dual_level ctx managerr9   r$   r,   r-   c                     [        SS S S.UD6$ r   )r  )r9   r,   s     r6   r@   DualLevelContextManager.create  s$    & 

 
 	
r8   c                 ~  ^  [        T R                  5        [        R                  R                  R                  5       T l        T R                  UU 4S j5        UR                  R                  S[        R                  R                  S0 5      T l        [        R                  R                  UT R                  5      $ )Nc                  f   > [         R                  R                  R                  T R                  S9$ )N)level)r   r  r  exit_dual_level	new_levelrm   s   r6   ra   /DualLevelContextManager.enter.<locals>.<lambda>  s!    11AAAWr8   ru   r0   )r   r   r   r  r  enter_dual_levelr%  r>   rK   r   r   _enter_dual_levelr   r   r   r  rA   s   ` r6   rB   DualLevelContextManager.enter  s    d,,-22CCEW	
 YY**HH&&	

 ((..r4>>BBr8   rP   c                     U R                  5         UR                  R                  S[        R                  R
                  U R                  40 5        [        R                  R                  S 5      $ r   )
rM   rK   r   r   r   _exit_dual_levelr%  r   r?   r@   rT   s      r6   rU   DualLevelContextManager.exit  sU     	
		HH%%^^		
 ))0066r8   c                 J    [         R                  R                  R                  $ rR   )r   r  r  
dual_levelrm   s    r6   r  #DualLevelContextManager.python_type  s    ~~((333r8   )r%  r   N)r   r   r   r   r   r   r   r   
DUAL_LEVELr   r   r   r@   r   rB   rU   r   r  r   r0   r8   r6   r  r    s    E/1<3J3JK
* 
c 
>W 
 
C/ CO C
7)
72A
7	
74T 4r8   r  c                       \ rS rSrSr\" \" 5       \R                  5      r	\
SSS\SS 4S j5       rSSS\4S jrSSS	\S\4S
 jrSrg)&GradIncrementNestingCtxManagerVariablei  z6represents torch.func.grad increment/decrement nestingr9   r$   r,   r-   c                 "    [        SS S S.UD6nU$ r   )r2  r   s      r6   r@   -GradIncrementNestingCtxManagerVariable.create  s*     5 

 

 
r8   c                 j   [        U R                  5        [        R                  R                  R                  5       nU R                  US 5        UR                  R                  S[        R                  R                  R
                  S0 5      U l	        [        R                  R                  X5      $ )Nc                  R    [         R                  R                  R                  5       $ rR   )r   r   r   _grad_decrement_nestingr0   r8   r6   ra   >GradIncrementNestingCtxManagerVariable.enter.<locals>.<lambda>      %((*=*=*U*U*Wr8   ru   r0   )r   r   r   r   r   _grad_increment_nestingr>   rK   r   r   r   r   r  )r4   r9   
grad_levels      r6   rB   ,GradIncrementNestingCtxManagerVariable.enter  s    d,,-XX((@@B
b"WXYY**HH77	

 ((..r>>r8   rP   c                     U R                  5         UR                  R                  S[        R                  R
                  R                  S0 5        [        R                  R                  S 5      $ r  )
rM   rK   r   r   r   r   r7  r   r?   r@   rT   s      r6   rU   +GradIncrementNestingCtxManagerVariable.exit  sQ     	
		UXX00HH"b	
 ))0066r8   r  Nr	  r0   r8   r6   r2  r2    sy    @ /1<3U3UV#/2	1 
?/ 
?O 
?7)72A7	7r8   r2  c                      ^  \ rS rSrSr\SSS\\\4   SS 4S j5       r	  SS\\\4   S	\
S-  S
\
S-  S\
SS4
U 4S jjjrSSS\4S jrSS jrS\4S jrSrU =r$ )CatchWarningsCtxManagerVariablei  z'Delay a call to warnings.catch_warningsr9   r$   catch_warnings_argsr-   c                     [        US S S9$ )N)rA  r)   r*   )r@  )r9   rA  s     r6   r@   &CatchWarningsCtxManagerVariable.create  s     / 3
 	
r8   Nr)   r*   r,   c                 n   > [        U[        5      (       d   U5       e[        TU ]  " SX#S.UD6  Xl        g r   )rr   r   r1   r2   rA  )r4   rA  r)   r*   r,   r5   s        r6   r2   (CatchWarningsCtxManagerVariable.__init__  sD     -t44I6II4 	
'	
JP	
 $7 r8   c                 <  ^ U R                   R                  5        VVs0 s H  u  p#X#R                  5       _M     nnn[        R                  " S0 UD6mU R                  UU4S j5        [        R                  R                  UTR                  5       5      $ s  snnf )Nc                  *   > T R                  S S S 5      $ rR   )r   )ctx_vals   r6   ra   7CatchWarningsCtxManagerVariable.enter.<locals>.<lambda>  s    '*:*:4t*Lr8   r0   )
rA  itemsas_python_constantwarningscatch_warningsr>   r   r   r  r   )r4   r9   kvr,   rH  s        @r6   rB   %CatchWarningsCtxManagerVariable.enter  s    262J2J2P2P2R
2R$!A##%%2R 	 
 ))3F3b"LM((..r73D3D3FGG
s   Bc                   ^ TR                  U4S j5        TR                  U R                  R                  5       5        [	        U R                  R                  5       5      nTR                  TR                  [        U5      US5      5        g )Nc                  (   > T R                  SS5      $ )NrL  rM  )load_import_from)r\   s   r6   ra   =CatchWarningsCtxManagerVariable.reconstruct.<locals>.<lambda>  s    G,,Z9IJr8   F)	rc   foreachrA  valuestuplekeysrd   create_call_function_kwrf   )r4   r\   rX  s    ` r6   rh   +CatchWarningsCtxManagerVariable.reconstruct  sk    J	
 	00779:T--2245g==c$iuUVr8   c                 "    [         R                  $ rR   )rL  rM  rm   s    r6   r  +CatchWarningsCtxManagerVariable.python_type%  s    &&&r8   )rA  NNr   )r   r   r   r   r   r   r   r   r   r@   r   r2   rB   rh   r   r  r   r   r   s   @r6   r@  r@    s    1
#
:>sO?S:T
	*
 
 %)%)	7!#"677 Tz7 d
	7
 7 
7 7H/ HO HW'T ' 'r8   r@  c            	           \ rS rSrSr\" \" 5       \R                  5      r	\
SSS\\   S\SS 4S j5       rSSS\4S	 jrSSS
\S\4S jrSrg)&VmapIncrementNestingCtxManagerVariablei)  z1represents torch VMap increment/decrement nestingr9   r$   r)   r,   r-   c                 "    [        SUS S.UD6nU$ r   )r_  )r9   r)   r,   r   s       r6   r@   -VmapIncrementNestingCtxManagerVariable.create3  s*     5 
'
 

 
r8   c                 @   [        U R                  5        U R                  u  p#[        U[        R
                  5      (       a  UR                  nOUR                  5       nUR                  5       n[        R                  R                  R                  XC5      nU R                  US 5        UR                  R                  S[        R                  R                  R                  UR!                  5       U40 5      U l        [        R$                  R'                  X5      $ )Nc                  R    [         R                  R                  R                  5       $ rR   )r   r   r   _vmap_decrement_nestingr0   r8   r6   ra   >VmapIncrementNestingCtxManagerVariable.enter.<locals>.<lambda>K  r9  r8   ru   )r   r   r)   rr   r   SymNodeVariablesym_numrK  r   r   r   _vmap_increment_nestingr>   rK   create_proxypredispatchas_proxyr   r   r  )r4   r9   
batch_size
randomnessbatch_size_value
vmap_levels         r6   rB   ,VmapIncrementNestingCtxManagerVariable.enter@  s    d,,-!%!3!3
j)";";<<)11)<<>224
XX((@@

 	b"WXYY++((@@  "J/	

 ((..r>>r8   rP   c                     U R                  5         UR                  R                  S[        R                  R
                  R                  S0 5        [        R                  R                  S 5      $ r  )
rM   rK   r   r   r   rj  rd  r   r?   r@   rT   s      r6   rU   +VmapIncrementNestingCtxManagerVariable.exitT  sV     	
		((@@		
 ))0066r8   r  N)r   r   r   r   r   r   r   r   r
  r   r   r   r   r   r@   rB   rU   r   r0   r8   r6   r_  r_  )  s    ; /1<3U3UV
#
0
 
 
2	
 
?/ ?O ?(
7)
72A
7	
7r8   r_  c                   N  ^  \ rS rSrSr\" \" 5       \R                  5      r	\
 SSSS\S\S\SS 4
S	 jj5       r  SS\S\\   S
-  S\S\SS
4
U 4S jjjrSSS\4S jrSSS\S\4S jrSSS\\   S\\\4   S\4U 4S jjrSSS\SS
4S jrS\4S jrS\4S jrS\4S jrSrU =r$ )GradModeVariableia  z6represents torch.{no_grad,enable_grad,set_grad_mode}()r9   r$   target_valueinitializedr,   r-   c                     [        SU/[        R                  " 5       /S.UD6nU(       a  UR                  XR                  5        U$ r   )rt  r   is_grad_enabledr<   r)   )r9   ru  rv  r,   r   s        r6   r@   GradModeVariable.createf  sM      
'.!1134
 

 NN2001
r8   Nr)   r*   c                 T   > [         TU ]  " SXS.UD6  [        U R                  5        g r   )r1   r2   r   r   )r4   r)   r*   rv  r,   r5   s        r6   r2   GradModeVariable.__init__v  s2     	 	
'	
JP	
 	d,,-r8   c                 v    U R                  XR                  5        [        R                  R	                  S 5      $ rR   r<   r)   r   r?   r@   rA   s     r6   rB   GradModeVariable.enter  +    ../))0066r8   rP   c                 v    U R                  XR                  5        [        R                  R	                  S 5      $ rR   r<   r*   r   r?   r@   rT   s      r6   rU   GradModeVariable.exit  -     	//0))0066r8   c                 Z   > U R                  XR                  5        [        TU ]  XU5      $ rR   r<   r*   r1   ru   r4   r9   rP   r,   r5   s       r6   ru   GradModeVariable.call_function  s)     	//0w$Rv66r8   rV  c                    [        U5      S:X  d   eUS   n[        R                  " 5       U:w  aW  UR                  R	                  S[        R
                  R                  U40 5        [        R
                  R                  U5        g g )Nr   r   ru   )rf   r   rx  rK   r   r   _set_grad_enabledr4   r9   rV  r   s       r6   r<   GradModeVariable._call_func  sn    6{aq	  "e+II!!!;!;eXr HH&&u-	 ,r8   c                     gNr   r0   rm   s    r6   rY   GradModeVariable.module_name      r8   c                     g)Nset_grad_enabledr0   rm   s    r6   rZ   GradModeVariable.fn_name  s    !r8   c                 "    [         R                  $ rR   )r   r  rm   s    r6   r  GradModeVariable.python_type  s    %%%r8   r0   Frx   )r   r   r   r   r   r   r   r   	GRAD_MODEr   r   r   r   r@   r   r2   r   rB   rU   r   r   ru   r<   rY   rZ   r   r  r   r   r   s   @r6   rt  rt  a  s\   @/1<3I3IJ "#  	
 
 $ 15 	
.
. !-
. 	
.
 
. 

. 
.7/ 7O 77)72A7	77#7 '7 S/)*	7
 
7.4 .c .d .S " "&T & &r8   rt  c            	          ^  \ rS rSr\SSS\S\SS 4S j5       r SS	\S
\S-  S\SS4U 4S jjjrSSS\	S\	4S jr
SSS\	4S jrS\4S jrS\4S jrS\4S jrSrU =r$ )InferenceModeVariablei  r9   r$   ru  r,   r-   c                 J    [        U/4S[        R                  " 5       0UD6nU$ )Nr*   )r  r   is_inference_mode_enabledr9   ru  r,   r   s       r6   r@   InferenceModeVariable.create  s3     $N
+0+J+J+L
PV
 
r8   Nr)   r*   c                 Z   > Uc  [         R                  " 5       n[        TU ]  " SXS.UD6  g r   )r   r  r1   r2   r3   s       r6   r2   InferenceModeVariable.__init__  s6     !"<<>N 	
'	
JP	
r8   rP   c                     U R                  5         UR                  R                  S[        R                  R
                  R                  U R                  40 5        [        R                  R                  S 5      $ r   )rS   rK   r   r   r  	grad_mode_exit_inference_moder   r   r?   r@   rT   s      r6   rU   InferenceModeVariable.exit  s]     	
		NN$$99ZZM		
 ))0066r8   c                 n  ^^^ Sm[         R                  R                  R                  (       aK  U R                  S   (       a7  Sm[         R
                  " 5       m[         R                  R                  S5        O1[         R                  R                  R                  " U R                  6 mSUUU4S jjnU R                  X5        UR                  R                  S[         R                  R                  R                  / U R                  Q70 5      U l        [        R                   R#                  S 5      $ )NFr   Tc                     > T(       a   [         R                  R                  T5        g [         R                  R                  R                  T 5        g rR   )r   r   r  r  r  r  )ctx disabled_inference_mode_forciblypriors   r6   cleanup_hook1InferenceModeVariable.enter.<locals>.cleanup_hook  s0    /**51((==cBr8   ru   rH   )r   r   r
   "fake_tensor_disable_inference_moder)   rx  r   r  r  r  _enter_inference_moder>   rK   r   r   r   r?   r@   )r4   r9   r  r  r  r  s      @@@r6   rB   InferenceModeVariable.enter  s    +0(MM  CC""1%
 04,))+EHH&&u-..**@@$BTBTUC	C 	C 	b/YY**NN$$::"d  "	

 ))0066r8   c                     gr  r0   rm   s    r6   rY   !InferenceModeVariable.module_name  r  r8   c                     g)Ninference_moder0   rm   s    r6   rZ   InferenceModeVariable.fn_name  s    r8   c                 "    [         R                  $ rR   )r   r  rm   s    r6   r  !InferenceModeVariable.python_type  s    ###r8   r  rR   )r   r   r   r   r   r   r@   r   r2   r   rU   rB   r   rY   rZ   r   r  r   r   r   s   @r6   r  r    s    #36BE	   '+

 t
 	

 

 

7)
72A
7	
77/ 7O 7<S    $T $ $r8   r  c            	          ^  \ rS rSrSr\SSS\S\SS 4S j5       r SS
\S\S	-  S\SS	4U 4S jjjrSSS\	S\	4S jr
SSS\	4S jrS\4S jrS\4S jrS\4S jrSrU =r$ )CUDADeviceVariablei  zrepresents torch.cuda.devicer9   r$   devicer,   r-   c                 \    [        S[        R                  R                  USS9/S S.UD6nU$ )NT)optionalr   r0   )r  r   cuda_get_device_index)r9   r  r,   r   s       r6   r@   CUDADeviceVariable.create  sA     ! 
 ::777NO
 

 
r8   Nr)   r*   c                 *   > [         TU ]  " SXS.UD6  g r   r1   r2   r3   s       r6   r2   CUDADeviceVariable.__init__  "     	 	
'	
JP	
r8   rP   c                     U R                  5         UR                  R                  S[        R                  R
                  U R                  40 5        [        R                  R                  S5      $ )Nru   F)
rS   rK   r   r   r  _maybe_exchange_devicer   r   r?   r@   rT   s      r6   rU   CUDADeviceVariable.exit  sW     	
		JJ--ZZM		
 ))0077r8   c                 L  ^ [         R                  R                  " U R                  6 mU R	                  UU4S j5        UR
                  R                  S[         R                  R                  / U R                  Q70 5      U l        [        R                  R                  S 5      $ )Nc                  B   > [         R                  R                  T 5      $ rR   )r   r  r  )prev_idxs   r6   ra   *CUDADeviceVariable.enter.<locals>.<lambda>  s    %***K*KH*Ur8   ru   )r   r  _exchange_devicer)   r>   rK   r   r   r   r?   r@   )r4   r9   r  s     @r6   rB   CUDADeviceVariable.enter  s~    ::..0B0BCb"UVYY**JJ''"d  "	

 ))0066r8   c                     g)Nz
torch.cudar0   rm   s    r6   rY   CUDADeviceVariable.module_name#      r8   c                     g)Nr  r0   rm   s    r6   rZ   CUDADeviceVariable.fn_name&  s    r8   c                 6    [         R                  R                  $ rR   )r   r  r  rm   s    r6   r  CUDADeviceVariable.python_type)  s    zz   r8   r  rR   )r   r   r   r   r   r   r   r@   r2   r   rU   rB   r   rY   rZ   r   r  r   r   r   s   @r6   r  r    s    &#-0<?	  &*

 d

 	

 

 

8)
82A
8	
8	7/ 	7O 	7S  !T ! !r8   r  c                     ^  \ rS rSrSr\" \" 5       \R                  5      r	\
SSS\SS 4S j5       r  SSSS	\S
\S-  S\S\SS4U 4S jjjr SSSS\S\4   S-  SS4S jjrSSS\SS4S jrS\4S jrS\4S jrS\4S jrSrU =r$ )TorchFunctionDisableVariablei-  z>represents whether torch function overrides are enabled or notr9   r$   r,   r-   c                 $    [        U 4/ / S.UD6nU$ )Nr   )r  r   s      r6   r@   #TorchFunctionDisableVariable.create2  s-     +

 	
 
r8   Nr)   r*   only_subclassc                   > [        U5      S:X  d   eUb  [        U5      S:X  d   eX@l        UR                  R                  U l        UR                  R
                  U l        [        TU ]   " SX#S.UD6  [        U R                  5        g )Nr   r   r0   )rf   r  symbolic_torch_function_statetorch_function_subclass_enabled'initial_torch_function_subclass_enabledtorch_function_mode_enabled#initial_torch_function_mode_enabledr1   r2   r   r   )r4   r9   r)   r*   r  r,   r5   s         r6   r2   %TorchFunctionDisableVariable.__init__>  s     =!Q&&&)c..AQ.FFF*,,LL 	4 ,,HH 	0 	 	
'	
JP	
 	d,,-r8   rD   .c                 x   ^ ^ Uc	  SU U4S jjnUT l         TR                  R                  T R                  5        g )Nc                     > T R                   TR                  l        T R                  (       d  T R                  TR                  l        g g rR   )r  r  r  r  r  r  rA   s   r6   rD   9TorchFunctionDisableVariable.set_cleanup_hook.<locals>.fn\  sA    @@ 00P ))@@ 44P *r8   rH   rI   rN   s   `` r6   r>   -TorchFunctionDisableVariable.set_cleanup_hookU  s3    
 :  
		""4<<0r8   rV  c                     [        U5      S:X  d   eSUR                  l        U R                  (       d  SUR                  l        g g )Nr   F)rf   r  r  r  r  r4   r9   rV  s      r6   r<   'TorchFunctionDisableVariable._call_funch  s>    6{aKP((H!!KPB,,H "r8   c                     g)Nztorch._Cr0   rm   s    r6   rY   (TorchFunctionDisableVariable.module_namen      r8   c                 (    U R                   (       a  gg)NDisableTorchFunctionSubclassDisableTorchFunction)r  rm   s    r6   rZ   $TorchFunctionDisableVariable.fn_nameq  s    1%r8   c                     U R                   (       a  [        R                  R                  $ [        R                  R                  $ rR   )r  r   r   r  r  rm   s    r6   r  (TorchFunctionDisableVariable.python_typev  s+    88888xx,,,r8   )rJ   r  r  r  rx   rR   )r   r   r   r   r   r   r   r   TORCH_FUNCTION_STATEr   r   r   r@   r   r   r2   r   r>   r<   r   rY   rZ   r   r  r   r   r   s   @r6   r  r  -  s   H/1<3T3TU	#	/2		'	 	 (,".#. . 	.
 . . 
. .4 )-1#1 S#X%1 
	1&Q4 Qe Q QS & &
-T - -r8   r  c            	          ^  \ rS rSrSr\SSS\S-  S\SS 4S	 j5       r SS
\	\S-     S\	\S-     S-  S\SS4U 4S jjjr
SSS\4S jrSSS\	\S-     SS4S jrS\4S jrS\4S jrS\4S jrSrU =r$ )!DisabledSavedTensorsHooksVariablei|  z;represents torch.autograd.graph.disable_saved_tensors_hook.r9   r$   ru  Nr,   r-   c                     [        SU/[        R                  R                  R	                  5       /S.UD6nUR                  X/5        UR                  U 5        U$ r   )r  r   r   	_autograd/_saved_tensors_hooks_get_disabled_error_messager<   r>   r  s       r6   r@   (DisabledSavedTensorsHooksVariable.create  s`     0 
'.""RRT

 
 	r>*R 
r8   r)   r*   c                 *   > [         TU ]  " SXS.UD6  g r   r  r3   s       r6   r2   *DisabledSavedTensorsHooksVariable.__init__  r  r8   c                 @    [         R                  R                  S 5      $ rR   r   r?   r@   rA   s     r6   rB   'DisabledSavedTensorsHooksVariable.enter      ))0066r8   rV  c                    [        U5      S:X  d   eUS   nUbk  UR                  R                  S[        R                  R
                  R                  U40 5        [        R                  R
                  R                  U5        g UR                  R                  S[        R                  R
                  R                  S0 5        [        R                  R
                  R                  5         g )Nr   r   ru   r0   )rf   rK   r   r   r   r  _saved_tensors_hooks_disable_saved_tensors_hooks_enabler  s       r6   r<   ,DisabledSavedTensorsHooksVariable._call_func  s     6{aq	 II!!""??	 HH;;EB II!!!3!3!O!OQSUW HH::<r8   c                     g)Nztorch.autograd.graphr0   rm   s    r6   rY   -DisabledSavedTensorsHooksVariable.module_name      %r8   c                     g)Ndisable_saved_tensors_hooksr0   rm   s    r6   rZ   )DisabledSavedTensorsHooksVariable.fn_name  s    ,r8   c                 "    [         R                  $ rR   
contextlib_GeneratorContextManagerrm   s    r6   r  -DisabledSavedTensorsHooksVariable.python_type      222r8   r0   rR   )r   r   r   r   r   r   r   r   r@   r   r2   r   rB   r<   rY   rZ   r   r  r   r   r   s   @r6   r  r  |  s    E#36:IL	, " 7;
d
+
 !t,t3
 	

 

 
7/ 7O 7=)=3;C$J3G=	=.&S &- -3T 3 3r8   r  c            	         ^  \ rS rSr\S\R                  R                  R                  S\	\
   S\\\
4   SS 4S j5       r SS\	\
   S	\
S-  S\
SS4U 4S
 jjjrSSS\S\4S jrSSS\4S jrS\4S jrS\4S jrS\4S jrSrU =r$ )AutocastModeVariablei  funcrP   r,   r-   c                 N   U [         R                  R                  R                  [         R                  R                  R                  [         R
                  R                  R                  4;   d   e[        R                  " U 5      R                  " U0 UD6nUR                  5         / nUR                  5         S H  nUS:X  ax  U [         R                  R                  R                  [         R
                  R                  R                  4;   a,  U [         R                  R                  R                  L a  SOSnOUR                  U   n[        U[        5      (       a!  UR                  UR                  5       5        M  UR                  U5        M     [!        U4SS 0UD6nU$ )N)device_typedtyper   cache_enabledr  r  cpur*   )r   ampautocast_modeautocastr  r  inspect	signaturebindapply_defaultsclear	argumentsrr   r   appendrK  r
  )r  rP   r,   
bound_argsr)   keyargr   s           r6   r@   AutocastModeVariable.create  sH    II##,,JJNN##IIMM""
 
 	
 
 &&t,114B6B
!!#GCm#

''		&&1 )
 !%

(?(? ?fU **3/#//$$S%;%;%=>$$S) H #=PPP
r8   Nr)   r*   c                 *   > [         TU ]  " SXS.UD6  g r   r  r3   s       r6   r2   AutocastModeVariable.__init__  r  r8   r9   r$   c                     U R                  5         UR                  R                  S[        R                  R
                  U R                  40 5        [        R                  R                  S 5      $ r   )
rS   rK   r   r   r  _exit_autocastr   r   r?   r@   rT   s      r6   rU   AutocastModeVariable.exit  sT     	
		UYY55

}b	
 ))0066r8   c                 L  ^ [         R                  R                  " U R                  6 mU R	                  UU4S j5        UR
                  R                  S[         R                  R                  / U R                  Q70 5      U l        [        R                  R                  S 5      $ )Nc                  B   > [         R                  R                  T 5      $ rR   )r   r  r"  r  s   r6   ra   ,AutocastModeVariable.enter.<locals>.<lambda>  s    %))*B*B3*Gr8   ru   )r   r  _enter_autocastr)   r>   rK   r   r   r   r?   r@   )r4   r9   r  s     @r6   rB   AutocastModeVariable.enter  s}    ii''););<b"GHYY**UYY668N$:L:L8NPR

 ))0066r8   c                     g)Nztorch.amp.autocast_moder0   rm   s    r6   rY    AutocastModeVariable.module_name  s    (r8   c                     g)Nr  r0   rm   s    r6   rZ   AutocastModeVariable.fn_name   r  r8   c                 J    [         R                  R                  R                  $ rR   )r   r  r  r  rm   s    r6   r   AutocastModeVariable.python_type  s    yy&&///r8   r  rR   )r   r   r   r   r   r   r  r  r  r   r   r   r   r@   r2   r   rU   rB   rY   rZ   r   r  r   r   r   s   @r6   r
  r
    s    "ii%%.."sm" S#X" 
 	" "N &*
}
 d

 	

 

 
7)72A7	77/ 7O 7)S ) 0T 0 0r8   r
  c                      ^  \ rS rSrSrSS\S-  S\SS4U 4S jjjrSS	S\4S
 jrSS	S\S\4S jr	S\
4S jrS\
4S jrS\4S jrSrU =r$ )NullContextVariablei  z6
This class represents Python contextlib.nullcontext.
Nr)   r,   r-   c                 *   > [         TU ]  " SSU0UD6  g Nr)   r0   r  )r4   r)   r,   r5   s      r6   r2   NullContextVariable.__init__  s    ?}??r8   r9   r$   c                 ~    [         R                  R                  S 5      nU R                  (       a  U R                  $ U$ rR   )r   r?   r@   r)   )r4   r9   nones      r6   rB   NullContextVariable.enter  s1    ))006%)%7%7t!!ATAr8   rP   c                 @    [         R                  R                  S 5      $ rR   r  rT   s      r6   rU   NullContextVariable.exit       ))0066r8   c                     gNr  r0   rm   s    r6   rY   NullContextVariable.module_name  r  r8   c                     gNnullcontextr0   rm   s    r6   rZ   NullContextVariable.fn_name      r8   c                 "    [         R                  $ rR   )r  r@  rm   s    r6   r  NullContextVariable.python_type  s    %%%r8   r0   rR   )r   r   r   r   r   r   r2   r   rB   rU   r   rY   rZ   r   r  r   r   r   s   @r6   r1  r1    s    @cDj @3 @4 @ @B/ BO B7)72A7	7
S  &T & &r8   r1  c                      ^  \ rS rSrSrS\SS4U 4S jjrS\4S jrSS	S\	4S
 jr
SS	S\	S\	4S jrS\4S jrS\4S jrSS jrSrU =r$ )ProfilerContextVariablei"  af  
This class represents a set of torch profiler context objects, where Dynamo
ignores all the side-effects in the __init__, __enter__ and __exit__ methods
by treating the object mostly as a `contextlib.nullcontext`, except for edge
cases like the `__enter__` method which returns the object itself rather
than `None`, per implementation of the torch objects.
r,   r-   Nc                 *   > [         TU ]  " SSS 0UD6  g r3  r  )r4   r,   r5   s     r6   r2    ProfilerContextVariable.__init__+  s    6t6v6r8   c                 6    [         R                  R                  $ rR   )r   profilerprofilerm   s    r6   r  #ProfilerContextVariable.python_type.  s    ~~%%%r8   r9   r$   c                     U $ rR   r0   rA   s     r6   rB   ProfilerContextVariable.enter1  s    r8   rP   c                 @    [         R                  R                  S 5      $ rR   r  rT   s      r6   rU   ProfilerContextVariable.exit4  r:  r8   c                     gr<  r0   rm   s    r6   rY   #ProfilerContextVariable.module_name9  r  r8   c                     gr?  r0   rm   s    r6   rZ   ProfilerContextVariable.fn_name<  rB  r8   c                 N    [        S[        U 5      S/ [        R                  QS9  g )Nz2torch.profiler object escaped from compiled regionzXDynamo doesn't support compiling a region that returns a torch.profiler context manager.gb_typecontextexplanationhintsr   r   r   SUPPORTABLEr[   s     r6   rh   #ProfilerContextVariable.reconstruct?  s*    HIr"..		
r8   r0   r   )r   r   r   r   r   r   r2   r   r  r   rB   rU   r   rY   rZ   rh   r   r   r   s   @r6   rF  rF  "  sz    7 7 7&T &/ O 7)72A7	7
S  
 
r8   rF  c                      ^  \ rS rSrSrS1\R                  kr\S\S\	\
   SSS\S	S 4
S
 j5       r  SS\S\S-  S\S	S4U 4S jjjrS	\4S jrSSS	\
4S jrSSS\
S	\
4S jrS	\4S jrS	\4S jrSU 4S jjrSrU =r$ )%ProfilerRecordFunctionContextVariableiJ  aK  
This class represents torch profiler context objects.

For record_function: emits torch.ops.profiler._record_function_enter_new
to the graph on enter, and torch.ops.profiler._record_function_exit on exit.
But if emit_profiler_ops=False, behaves like nullcontext.

For profile: behaves like nullcontext, ignoring all side-effects.
emit_profiler_opsr  record_argsrecord_kwargszdict[str, VariableTracker]r,   r-   c                    S n[         R                  (       a  U(       a  US   R                  5       O<UR                  S[        R
                  R                  S5      5      R                  5       nS n[        U5      S:  a  US   R                  5       nOSU;   a  US   R                  5       nXV/nO[        [        SU 5        [        SUS S.UD6$ )	Nr   r   unknownr   rP   z+Profiler record function %s will be ignoredr   r0   )r
    capture_profiler_record_functionrK  getr   r?   r@   rf   r   logr_  )r  ra  rb  r,   r)   r   record_args_consts          r6   r@   ,ProfilerRecordFunctionContextVariable.createZ  s     22
  A113ZZI66==iH$$&  !%;!#$/N$E$E$G!6!$*6N$E$E$G!!5MKTR4 
'
 
 	
r8   Nr)   r*   c                 *   > [         TU ]  " SXS.UD6  g r   r  r3   s       r6   r2   .ProfilerRecordFunctionContextVariable.__init__z  r  r8   c                 J    [         R                  R                  R                  $ rR   )r   r  rJ  record_functionrm   s    r6   r  1ProfilerRecordFunctionContextVariable.python_type  s    ~~&&666r8   r9   r$   c                     [         R                  (       aT  U R                  u  p#UR                  R	                  S[
        R                  R                  R                  X#40 5      U l	        U $ r   )
r
   re  r)   rK   r   r   opsrJ  _record_function_enter_newr   )r4   r9   r   rP   s       r6   rB   +ProfilerRecordFunctionContextVariable.enter  sS    22++JD..		""==	DJ r8   rP   c                    [         R                  (       aU  UR                  R                  S[        R
                  R                  R                  R                  U R                  40 5        [        R                  R                  S 5      $ r   )r
   re  rK   r   r   rp  rJ  _record_function_exit_RecordFunctionr   r   r?   r@   rT   s      r6   rU   *ProfilerRecordFunctionContextVariable.exit  s`     22II!!		""88HH	 ))0066r8   c                 4    [         R                  (       a  S$ S$ )Nztorch.autograd.profilerr  r
   re  rm   s    r6   rY   1ProfilerRecordFunctionContextVariable.module_name  s!     66 &	
 	
r8   c                 4    [         R                  (       a  S$ S$ )Nrm  r@  rx  rm   s    r6   rZ   -ProfilerRecordFunctionContextVariable.fn_name  s!     66 	
 	
r8   c                    > [         R                  (       a&  [        S[        U 5      S/ [        R
                  QS9  g [        TU ]  U5        g )Nz,record_function escaped from compiled regionzADynamo doesn't support graph break inside record_function region.rV  )r
   re  r   r   r   r\  r1   r]   )r4   r\   r5   s     r6   r]   6ProfilerRecordFunctionContextVariable.reconstruct_type  sE     22FD	_&22	 G$W-r8   r  r]  r   )r   r   r   r   r   r&   r   r   r   r   r   r@   r2   r   r  rB   rU   r   rY   rZ   r]   r   r   r   s   @r6   r_  r_  J  s    		 	/	/N
 

o.
 4
 	

 
1
 
B "%)

 d

 	

 

 
7T 7
/ 
O 
7)72A7	7
S 

 
. .r8   r_  c                      ^  \ rS rSrSr\SSS\SS 4S j5       r\SSS\4S j5       rS\S	\S
\	SS4U 4S jjr
S\4S jrSSS\4S jrSSS\S\4S jrSS jrSrU =r$ )PreserveVersionContextVariablei  z7
Wraps torch.autograd._unsafe_preserve_version_counter
r9   r$   tensorsr-   c           	         UR                  5       (       aO  [        R                  " U4 Vs/ s H  o"R                  U S5      PM     sn5      n[        R                  " U/5      nOc[	        U[        R                  5      (       d   e[        R                  " UR
                   Vs/ s H  o"R                  U S5      PM     sn5      nUn[        XC5      $ s  snf s  snf )N_version)	is_tensorr   TupleVariabler   rr   rJ  r  )r9   r  r   versionstensors_tuples        r6   _create_lambda_from_tensors:PreserveVersionContextVariable._create_lambda_from_tensors  s    
  ..9@	B	1r:.	BH &33WI>Mgy'>'>???? ..8?F1r:.FH $M-mFF C Gs   C$Cc                 8   ^  [         R                  " U 4S j5      $ )Nc                 0   > [         R                  TU 5      $ rR   )r  r  )r  r9   s    r6   ra   <PreserveVersionContextVariable.constructor.<locals>.<lambda>  s    :VVGr8   )r   LambdaVariable)r9   s   `r6   constructor*PreserveVersionContextVariable.constructor  s    ''
 	
r8   prev_versionsr,   Nc                 x  > UR                  SS 5        [        TU ]  " S0 UD6  Xl        X l        U R                  R                  5       (       a&  [        R                  " U R                  /5      U l        U R                  R                  5       (       a'  [        R                  " U R                  /5      U l        g g r3  )	
setdefaultr1   r2   r  r  r  r   r  is_symnode_like)r4   r  r  r,   r5   s       r6   r2   'PreserveVersionContextVariable.__init__  s     	/40"6"*<<!!##$22DLL>BDL--//!*!8!8$:L:L9M!ND 0r8   c                 J    [         R                  R                  R                  $ rR   )r   r  r   _unsafe_preserve_version_counterrm   s    r6   r  *PreserveVersionContextVariable.python_type  s    ~~''HHHr8   c                 @    [         R                  R                  S 5      $ rR   r  rA   s     r6   rB   $PreserveVersionContextVariable.enter  r  r8   rP   c                     SSK Jn  [        R                  " U5      R	                  XR
                  U R                  /0 5      $ )Nr   )_unsafe_set_version_counter)tensor_version_opr  r   TorchInGraphFunctionVariableru   r  r  )r4   r9   rP   r  s       r6   rU   #PreserveVersionContextVariable.exit  s:     	D55'

-\\4+=+=>
C	Dr8   c                 N    [        S[        U 5      S/ [        R                  QS9  g )NzLtorch.autograd._unsafe_preserve_version_counter escaped from compiled regionzyDynamo doesn't support compiling a region that returns a torch.autograd._unsafe_preserve_version_counter context manager.rV  r[  r[   s     r6   rh   *PreserveVersionContextVariable.reconstruct  s-    bIU"..
	
r8   )r  r  r   )r   r   r   r   r   r   r   r  r  r   r2   r   r  rB   rU   rh   r   r   r   s   @r6   r  r    s     G#G G 
*G G" 
/ 
O 
 
O O 'O 	O
 
O IT I7/ 7O 7D)D2AD	D
 
r8   r  c                   @  ^  \ rS rSr\" \" 5       \R                  5      r\	SSS\
S\
S\
SS 4
S j5       r SS\
S
\\
   S\\
   S	-  S\
SS	4
U 4S jjjrSSS\4S jrSSS\S\4S jrSSS\\   S\\\4   S\4U 4S jjrSSS\\
   SS	4S jrS\4S jrS\4S jrSrU =r$ )&FSDPParamGroupUseTrainingStateVariablei  r9   r$   param_group_varru  r,   r-   c                 P    [        SUU/UR                  R                  /S.UD6nU$ )N)r  r)   r*   r0   )r  r   _training_state)r9   r  ru  r,   r   s        r6   r@   -FSDPParamGroupUseTrainingStateVariable.create  s>     5 
+'.+11AAB
 	
 
r8   Nr)   r*   c                 `   > [         TU ]  " SX#S.UD6  Xl        [        U R                  5        g r   )r1   r2   r  r   r   )r4   r  r)   r*   r,   r5   s        r6   r2   /FSDPParamGroupUseTrainingStateVariable.__init__  s8     	 	
'	
JP	
  /d,,-r8   c                 v    U R                  XR                  5        [        R                  R	                  S 5      $ rR   r}  rA   s     r6   rB   ,FSDPParamGroupUseTrainingStateVariable.enter+  r  r8   rP   c                 v    U R                  XR                  5        [        R                  R	                  S 5      $ rR   r  rT   s      r6   rU   +FSDPParamGroupUseTrainingStateVariable.exit/  r  r8   c                 Z   > U R                  XR                  5        [        TU ]  XU5      $ rR   r  r  s       r6   ru   4FSDPParamGroupUseTrainingStateVariable.call_function5  s)     	//0w$Rv66r8   rV  c           	      d   [        U5      S:X  d   eUS   nU R                  R                  R                  U:w  av  U R                  R	                  US[
        R                  R                  US5      [
        R                  R                  X5      40 5        X0R                  R                  l        g g )Nr   r   __setattr__r  )rf   r  r   r  call_methodr   r   r  r  s       r6   r<   1FSDPParamGroupUseTrainingStateVariable._call_func?  s    6{aq	%%55>  ,,--33B8IJ--33B>  :?  &&6 ?r8   c                     g)NzDtorch.distributed.fsdp._fully_shard._fsdp_param_group.FSDPParamGroupr0   rm   s    r6   rY   2FSDPParamGroupUseTrainingStateVariable.module_nameN  s    Ur8   c                     g)Nuse_training_stater0   rm   s    r6   rZ   .FSDPParamGroupUseTrainingStateVariable.fn_nameQ      #r8   )r  rR   )r   r   r   r   r   r   r   FSDP_TRAINING_STATEr   r   r   r@   r   r2   r   rB   rU   r   r   ru   r<   rY   rZ   r   r   r   s   @r6   r  r    sP   /1<3S3ST#  	
 
2 $ 04	..  }. !,	.
 . 
. .7/ 7O 77)72A7	77#7 '7 S/)*	7
 
7?4 ?hsm ?PT ?VS V$ $ $r8   r  c                   :  ^  \ rS rSrSr\ SSSS\S\S\SS 4
S	 jj5       r  SS\	\
R                  R                  R                     S\S\S\SS
4
U 4S jjjr\SSS\	\   S\	\   4S j5       rSSS\4S jrSSS\S\4S jrS\4S jrS\4S jrS\4S jrSrU =r$ )SDPAKernelVariableiU  z)represents torch.nn.attention.sdpa_kernelr9   r$   backendsset_priorityr,   r-   c                     [        U[        R                  R                  R                  5      (       a  U/n[        SUS US.UD6nU$ )N)r)   r*   r  r0   )rr   r   nn	attention
SDPBackendr  )r9   r  r  r,   r   s        r6   r@   SDPAKernelVariable.createX  sQ     h 2 2 = =>> zH  
"%
 	
 
r8   Nr)   r*   c                 6   > [         TU ]  " SXS.UD6  X0l        g r   )r1   r2   r  )r4   r)   r*   r  r,   r5   s        r6   r2   SDPAKernelVariable.__init__i  s*     	 	
'	
JP	
 )r8   c           	          U Vs/ s HN  nU R                   R                  S[        R                  R                  R
                  UR                  40 5      PMP     nnU$ s  snf r   )rK   r   r   r  r  _backend_from_stringr   )r9   r  backendnodess       r6   _backends_to_nodes%SDPAKernelVariable._backends_to_nodesu  se     $
 $ II!!""77	 $ 	 
 
s   AAc                 4  ^  [         R                  R                  R                  T R                  S9T l        T R                  UU 4S j5        [         R                  R                  R                  T R                  T R                  S9  T R                  UT R                  5      nUR                  R                  S[         R                  R                  R                  U[        T R                  5      40 5        [        R                  R                  S 5      $ )N)with_priorityc                  |   > [         R                  R                  R                  T R                  T R
                  S9$ )Nr  )r   r  r  _sdpa_kernelprev_backendsr  rm   s   r6   ra   *SDPAKernelVariable.enter.<locals>.<lambda>  s0    EHH&&33""1B1B 4 r8   r  ru   )r   r  r  _cur_sdpa_kernel_backendsr  r  r>   r  r)   r  rK   r   r   r   r?   r@   )r4   r9   r  s   `  r6   rB   SDPAKernelVariable.enter  s    "XX//II++ J 
 		
 	''T->-> 	( 	
 %%b$*<*<=
		HH++$t(()*		
 ))0066r8   rP   c                 @   U R                  5         U R                  XR                  5      nUR                  R	                  S[
        R                  R                  R                  U[        U R                  5      40 5        [        R                  R                  S 5      $ r   )rS   r  r  rK   r   r   r  r  r  r   r  r   r?   r@   )r4   r9   rP   r  s       r6   rU   SDPAKernelVariable.exit  s}     	%%b*<*<=
		HH++$t(()*		
 ))0066r8   c                     g)Nztorch.nn.attentionr0   rm   s    r6   rY   SDPAKernelVariable.module_name  r  r8   c                     g)N_sdpa_kernel_variadicr0   rm   s    r6   rZ   SDPAKernelVariable.fn_name  s    &r8   c                 "    [         R                  $ rR   r  rm   s    r6   r  SDPAKernelVariable.python_type  r  r8   )r  r  r  r   )r   r   r   r   r   r   r   r   r@   r   r   r  r  r  r2   r  r   rB   rU   r   rY   rZ   r   r  r   r   r   s   @r6   r  r  U  s2   3 ##  	
 
 & #"	
)EHH..99:
) 
) 	
)
 
) 

) 
) #s) 
c  7/ 7O 7,7)72A7	7$S $
' '3T 3 3r8   r  c            	          ^  \ rS rSrSr SS\S\S\SS4U 4S jjjrS	S
S\S\4S jrS\	4S jr
S\	4S jrS\4S jrSS jrSrU =r$ )FxTracebackAnnotateVariablei  a  
fx.traceback.annotate is a context manager that allows users to annotate the
fx graph nodes with custom metadata. In the context of Dynamo, we don't have
to trace the body of the context manager. Instead we want to directly run
the body of the context manager, so the Dynamo created Fx graphs have the
right custom metadata. This variable tracker just runs __enter__ and
__exit__ method (instead of tracing).
Nr)   r*   r,   r-   c                 *   > [         TU ]  " SXS.UD6  g r   r  r3   s       r6   r2   $FxTracebackAnnotateVariable.__init__  s"     	 	
'	
JP	
r8   r9   r$   rP   c                 t  ^ [        5       mTR                  [        R                  R                  R                  U R                  5      5        TR                  [        R                  R                  R                  5       5        U R                  UU4S j5        [        R                  R                  S 5      $ )Nc                  $   > T R                  5       $ rR   )close)stacks   r6   ra   3FxTracebackAnnotateVariable.enter.<locals>.<lambda>  s    %++-r8   )r   enter_contextr   fx	tracebackannotater)   preserve_node_metar>   r   r?   r@   )r4   r9   rP   r  s      @r6   rB   !FxTracebackAnnotateVariable.enter  s~     EHH..778J8JKLEHH..AACDb"78))0066r8   c                     g)Nztorch.fx.tracebackr0   rm   s    r6   rY   'FxTracebackAnnotateVariable.module_name  r  r8   c                     g)Nr  r0   rm   s    r6   rZ   #FxTracebackAnnotateVariable.fn_name  r  r8   c                 "    [         R                  $ rR   r  rm   s    r6   r  'FxTracebackAnnotateVariable.python_type  r  r8   c                 N    [        S[        U 5      S/ [        R                  QS9  g )Nz8torch.fx.traceback.annotate escaped from compiled regionzBDynamo doesn't support graph break on torch.fx.traceback.annotate.rV  r[  r[   s     r6   r]   ,FxTracebackAnnotateVariable.reconstruct_type  s*    NI\"..		
r8   r0   rR   r   )r   r   r   r   r   r   r2   r   rB   r   rY   rZ   r   r  r]   r   r   r   s   @r6   r  r    s     9=
 
25
HK
	
 

7)
72A
7	
7$S $ 3T 3
 
r8   r  c                      ^  \ rS rSrSrS\\\4   S\SS4U 4S jjrSS	S
\SS4S jr	S\4S jr
S\4S jrS\4S jrSrU =r$ )DynamoConfigPatchVariablei  z,represents torch._dynamo.patch_dynamo_configr)   r,   r-   Nc                   > [        UR                  5       5      n[        TU ]  " SU4S S.UD6  0 nU H0  u  pV[        R
                  R                  R                  U5      XE'   M2     [        UR                  5       5      4U l        g r   )	rW  rJ  r1   r2   r   r   r
   r   r*   )r4   r)   r,   target_values_tupleinitial_values_dictr  _r5   s          r6   r2   "DynamoConfigPatchVariable.__init__  s    #M$7$7$9: 	
.0	
IO	
 !)FC',}}';';'G'G'L$ *$%8%>%>%@ACr8   r9   r$   rV  c                     [        U5      S:X  d   eUS   nU H.  u  pE[        R                  R                  R	                  XE5        M0     g Nr   r   )rf   r   r   r
   r  )r4   r9   rV  r   r  rg   s         r6   r<   $DynamoConfigPatchVariable._call_func  sA    6{aq	HCMM  ,,S6 r8   c                     gNztorch._dynamor0   rm   s    r6   rY   %DynamoConfigPatchVariable.module_name      r8   c                     g)Npatch_dynamo_configr0   rm   s    r6   rZ   !DynamoConfigPatchVariable.fn_name      $r8   c                     SSK Jn  U$ )Nr   )DynamoConfigPatchProxy)torch._dynamo.decoratorsr  )r4   r  s     r6   r  %DynamoConfigPatchVariable.python_type  s    C%%r8   r*   )r   r   r   r   r   r   r   r   r2   r<   rY   rZ   r   r  r   r   r   s   @r6   r  r    sp    6	Dd38n 	D 	D 	D74 7c 7d 7S % %&T & &r8   r  c                      ^  \ rS rSrSrS\S\SS4U 4S jjrSS	S
\\   SS4S jr	S\
4S jrS\
4S jrS\4S jrSrU =r$ )ErrorOnGraphBreakVariablei  z-represents torch._dynamo.error_on_graph_breakerror_on_graph_breakr,   r-   Nc                 @   > [         TU ]  " SU4[        5       4S.UD6  g r   )r1   r2   r   )r4   r  r,   r5   s      r6   r2   "ErrorOnGraphBreakVariable.__init__  s.     	
/1579	
 	
r8   r9   r$   rV  c                 B    [        U5      S:X  d   e[        US   5        g r  )rf   r   r  s      r6   r<   $ErrorOnGraphBreakVariable._call_func  s     6{a!&),r8   c                     gr  r0   rm   s    r6   rY   %ErrorOnGraphBreakVariable.module_name  r   r8   c                     g)Nr  r0   rm   s    r6   rZ   !ErrorOnGraphBreakVariable.fn_name  r  r8   c                     SSK Jn  U$ )Nr   )(ErrorOnGraphBreakDecoratorContextManager)r  r  )r4   r  s     r6   r  %ErrorOnGraphBreakVariable.python_type!  s    U77r8   r0   )r   r   r   r   r   r   r   r2   r   r<   r   rY   rZ   r   r  r   r   r   s   @r6   r  r    si    7
T 
S 
T 
-4 -htn -QU -S & &8T 8 8r8   r  c                      ^  \ rS rSrSrS\S-  S\S-  S\SS4U 4S jjrSU 4S jjrS	S
S\	\S4   SS4S jr
S\4S jrS\4S jrS\4S jrS\4S jrS	S
S\SS4S jrSrU =r$ )CudagraphOverrideVariablei'  z,represents torch._dynamo.override_cudagraphsfwdNbwdr,   r-   c                 .   > [         TU ]  " SX4S S.UD6  g r   r  )r4   r  r  r,   r5   s       r6   r2   "CudagraphOverrideVariable.__init__*  s'     	
*	
 	
r8   r9   r$   r   c                    > UR                   R                  nUb  UR                  UR                  4U l        OSU l        [
        TU ]  U5      $ )NrR   )rK   cudagraph_annotationr  r  r*   r1   rB   )r4   r9   prevr5   s      r6   rB   CudagraphOverrideVariable.enter1  sD    yy--#'88TXX"6D")Dw}R  r8   rV  .c                    SSK Jn  [        U5      S:X  a3  US   c-  S UR                  l        S UR                  R
                  l        g [        U5      S:X  d   eUu  pEU" XES9nXaR                  l        XaR                  R
                  l        g )Nr   )_CudagraphAnnotationr   r   )r  r  )torch._inductorr#  rf   rK   r  tracing_context)r4   r9   rV  r#  r  r  
annotations          r6   r<   $CudagraphOverrideVariable._call_func:  su    8v;!q	 1-1BII*=ABII%%:v;!###HC-#?J-7II*=GII%%:r8   c                     gr  r0   rm   s    r6   rY   %CudagraphOverrideVariable.module_nameH  r   r8   c                     g)Noverride_cudagraphsr0   rm   s    r6   rZ   !CudagraphOverrideVariable.fn_nameK  r  r8   c                     SSK Jn  U$ )Nr   )CudagraphOverrideContextManager)r  r.  )r4   r.  s     r6   r  %CudagraphOverrideVariable.python_typeN  s    L..r8   c                     gr   r0   rm   s    r6   r}   -CudagraphOverrideVariable.exit_on_graph_breakS  s     r8   rP   c                 @    [         R                  R                  S 5      $ rR   r  rT   s      r6   rU   CudagraphOverrideVariable.exitX  s     ))0066r8   r	  )r9   r$   r-   r   )r   r   r   r   r   r   r   r2   rB   rW  r<   r   rY   rZ   r   r  r}   r   rU   r   r   r   s   @r6   r  r  '  s    6
D4K 
dTk 
S 
T 
!H4 HeCHo HRV HS % %/T /
T 
7)72A7	7 7r8   r  c                      ^  \ rS rSrS\\-  S\SS4U 4S jjrS\4S jr	SS	S
\
\   S\\\4   S\4S jrSS jrSrU =r$ )WithEnterFunctionVariableia  r  r,   r-   Nc                 2   > [         TU ]  " S0 UD6  Xl        g r/   )r1   r2   r  )r4   r  r,   r5   s      r6   r2   "WithEnterFunctionVariable.__init__b  s    
 	"6"r8   c                 "    [         R                  $ rR   types
MethodTyperm   s    r6   r  %WithEnterFunctionVariable.python_typej      r8   r9   r$   rP   c                 r    U(       a   eU(       a   eUR                  U R                  UR                  5      $ rR   )	enter_ctxr  current_instructionrt   s       r6   ru   'WithEnterFunctionVariable.call_functionm  s0     xz ||DHHb&<&<==r8   c                 X    U R                   R                  5        SU R                   R                  5        3n[        S[	        U R                   5      SU S3S/[        R                  Q[        R                  QS9  g ! [         a!    [	        [        U R                   5      5      n Nof = f)N.z;Attempted to reconstruct context manager's __enter__ methodz)Attempted to reconstruct context manager z while tracing `with ...:`zIt is likely there is a graph break while tracing `with ctx:` but outside the actual `ctx.__enter__()` method. `torch.compile` does not expect this to happen.rV  )
r  rY   rZ   rl   r   r   r   r   	DIFFICULT
DYNAMO_BUG)r4   r\   type_strs      r6   rh   %WithEnterFunctionVariable.reconstructz  s    	+((..014883C3C3E2FGH 	QMCH:MghB #,,	
 #--		
 # 	+4>*H	+s   7A> >(B)(B)r&  r   )r   r   r   r   r&   r   r   r2   r   r  r   r   r   r   ru   rh   r   r   r   s   @r6   r5  r5  a  sz    $'EE  
	 T  >#> '> S/)*	>
 
>
 
r8   r5  c                      ^  \ rS rSrS1\R
                  krS\\-  S\S\SS4U 4S jjr	S\
4S jrS	S
S\\   S\\\4   S\4S jrSS jrSrU =r$ )WithExitFunctionVariablei  targetr  r,   r-   Nc                 x   > [         TU ]  " S0 UD6  [        U[        [        45      (       d   eXl        X l        g r/   )r1   r2   rr   r&   r   r  rJ  )r4   r  rJ  r,   r5   s       r6   r2   !WithExitFunctionVariable.__init__  sD     	"6")+IJ
 
 	
 
 r8   c                 "    [         R                  $ rR   r9  rm   s    r6   r  $WithExitFunctionVariable.python_type  r=  r8   r9   r$   rP   c                 N    U(       a   eU R                   R                  " U/UQ76 $ rR   )r  rU   rt   s       r6   ru   &WithExitFunctionVariable.call_function  s$     zxx}}R'$''r8   c                 :    U R                   R                  U5        g rR   )r  r]   r[   s     r6   rh   $WithExitFunctionVariable.reconstruct  s     	!!'*r8   )r  rJ  r   )r   r   r   r   r   r   r&   r   r   r2   r   r  r   r   r   ru   rh   r   r   r   s   @r6   rI  rI    s    		'	'N
$'EE  	
 
 T  (#( '( S/)*	(
 
(+ +r8   rI  )Xr   r  r  loggingr:  rL  collections.abcr   r   r   r   r   typingr   r	   torch._Cr   torch._dynamor
   torch._guardsr   torch._loggingr    r   r   bytecode_transformationr   excr   guardsr   r   r   r   r   utilsr   r   baser   	functionsr   r   r   r   r   r   r    r!   user_definedr"   torch._dynamo.codegenr#   torch._dynamo.symbolic_convertr$   	getLoggerr   rg  r&   r   r   r   r   r   r  r  r2  r@  r_  rt  r  r  r  r  r
  r1  rF  r_  r  r  r  r  r  r  r  r5  rI  r0   r8   r6   <module>re     s  (      5 5 8 %     ' + :  0 2 H !	 	 	 4 /D!do dN*%> *Z")+I ")J)70G )7X%77N %7P*7,C *7Z*?&= *?Z(45 (4V(7-D (7V+'&= +'\57-D 57pE&. E&PH$3 H$V6!0 6!rL-#: L-^=3(? =3@H02 H0V&1 &6%
5 %
Ps.,C s.lI
%< I
XF$-D F$R]30 ]3@.
"9 .
b$& 7 $&N8 7 8477 7 77t)
 )
X#+ #+r8   