ó
    Eñi[  ã                   óô  • S r SSKrSSKJrJrJrJrJrJr  SSK	J
r
JrJr  SSKJrJrJr  SSKJr  SSKJr  SS	KJrJrJrJrJrJrJrJrJrJrJrJrJ r J!r!J"r"J#r#J$r$J%r%J&r&J'r'J(r(  SS
KJ)r)J*r*J+r+J,r,J-r-J.r.J/r/J0r0J1r1  SSK2J3r3  SSK4J5r5  SSK6J7r7  SSK8J9r9  SSK:J;r;J<r<J=r=J>r>J?r?J@r@  SSKAJBrC  / SQrD\RŠ                  R�                  \RŽ                  R&                  R�                  /5        \R’                  \R”                  R’                  L aU  SSKKr\R˜                  " \R’                  5      \lI        \Rš                  Rœ                  RŸ                  \R’                  S5        SS jrPSS jrQS\R4S jrSS\RSS4S jrTg)až  
TorchDynamo is a Python-level JIT compiler designed to make unmodified PyTorch programs faster.
TorchDynamo hooks into the frame evaluation API in CPython (PEP 523) to dynamically modify Python
bytecode right before it is executed. It rewrites Python bytecode in order to extract sequences of
PyTorch operations into an FX Graph which is then just-in-time compiled with a customizable backend.
It creates this FX Graph through bytecode analysis and is designed to mix Python execution with
compiled backends to get the best of both worlds: usability and performance. This allows it to
seamlessly optimize PyTorch programs, including those using modern Python features.
é    Né   )Úaot_compileÚconfigÚconvert_frameÚ
eval_frameÚfunctional_exportÚresume_execution)Úlist_backendsÚlookup_backendÚregister_backend)Úcallback_handlerÚon_compile_endÚon_compile_start)Úcode_context)Úreplay)Úallow_in_graphÚassume_constant_resultÚdisableÚdisable_nested_graph_breaksÚdisallow_in_graphÚdont_skip_tracingÚerror_on_graph_breakÚforbid_in_graphÚgraph_breakÚis_dynamo_disable_recursiveÚmark_dynamicÚmark_staticÚmark_static_addressÚmaybe_mark_dynamicÚnonstrict_traceÚpatch_dynamo_configÚrunÚ
set_stanceÚ
skip_frameÚstep_unsupportedÚsubstitute_in_graph)	Ú_reset_guarded_backend_cacheÚexplainÚexportÚis_dynamo_supportedÚis_inductor_supportedÚoptimizeÚoptimize_assertÚOptimizedModuleÚ
reset_code)Úis_compiling)ÚGenerationTracker)Úreset_code_state)ÚTensorifyState)Úgraph_break_reasonsÚguard_failuresÚorig_code_mapÚ(register_hook_for_recompile_user_contextÚreset_frame_countÚreset_recompile_user_contexts)Úloader)#r   r   r   r   r   r   r   r)   r(   r   r   r0   r   r
   r   r   r   r   r   r    r,   r-   r.   r!   r   r   Úresetr9   r"   r   Úset_recursion_limitr#   r$   r%   r&   zaten::manual_seedÚreturnc                  óx  • SSK n U R                  [        5      nUR                  S5        [        R
                     [        5         [        R                  R                  5         [        5         [        R                  R                  5         [        R                  " 5         [        R                  " 5         [        R                  " 5         [        R                  R                   R                  5         [#        5         [%        5         [&        R(                  R*                  R-                  5         S[        l        [        R0                  R                  5         [2        R                  " 5         [4        R                  " 5         [6        R                  " 5         [&        R(                  R8                  R:                  R                  5         [&        R<                  R>                  RA                  S5        [&        RB                  RE                  5       (       a  SSK#J$n  U" 5         SSS5        g! , (       d  f       g= f)a•  
Clear all compile caches and restore initial state.  This function is intended
to reset Dynamo's state *as if* you had started a fresh process invocation, which
makes it good for testing scenarios where you want to behave as if you started
a new process.  It does NOT affect any file system caches.

NB: this does NOT reset logging state.  Don't use this to test logging
initialization/reinitialization.
r   Nztorch._dynamo.resetF)Úreset_cudagraph_trees)%ÚloggingÚ	getLoggerÚ__name__Úinfor   Úcompile_lockÚreset_code_cachesÚinput_codesÚclearr2   Úoutput_codesr6   r5   r4   r	   ÚContinueExecutionCacheÚcacher'   r8   ÚtorchÚ_dynamoÚcompiled_autogradr;   ÚFRAME_COUNTERÚFRAME_COMPILE_COUNTERr   r1   r3   ÚutilsÚwarn_once_cacheÚ_CÚ	_autogradÚ _saved_tensors_hooks_set_tracingÚcudaÚis_availableÚtorch._inductor.cudagraph_treesr?   )r@   Úlogr?   s      ÚS/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torch/_dynamo/__init__.pyr;   r;   ‚   sW  € ó à
×
Ñ
œHÓ
%€CØ‡H�HÐ"Ô#Ü	×	#Ó	#ÜÔÜ×!Ñ!×'Ñ'Ô)ÜÔÜ×"Ñ"×(Ñ(Ô*Ü×ÒÔÜ×ÒÔÜ×!Ò!Ô#Ü×/Ñ/×5Ñ5×;Ñ;Ô=Ü$Ô&ÜÔÜ�‰×'Ñ'×-Ñ-Ô/Ø&'ŒÔ#Ü×+Ñ+×1Ñ1Ô3Ü×ÒÔ Ü×ÒÔ!Ü×ÒÔÜ�‰×Ñ×+Ñ+×1Ñ1Ô3Ü�‰×Ñ×;Ñ;¸EÔBô �:‰:×"Ñ"×$Ñ$ÝMá!Ô#÷3 
$×	#Ö	#ús   »G'H+È+
H9c                  óš  • SSK n U R                  [        5      nUR                  S5         [        R
                     [        5         [        R                  R                  [        R                  R                  -    H  nU" 5       nU(       d  M  [        U5        M      [        R                  " 5         SSS5        g! , (       d  f       g= f)zŸ
Clears in-memory code cache, which is what stores compiled products.  This
resets less state than :func:`reset` and is mostly only used for testing
purposes.
r   Nztorch._dynamo.reset_code_caches)r@   rA   rB   rC   r   rD   r2   rF   ÚseenrH   r/   r   rG   )r@   rX   Ú	weak_codeÚcodes       rY   rE   rE   ­   s‘   € ó à
×
Ñ
œHÓ
%€CØ‡H�HÐ.Ô/Ø=Ü	×	#Ó	#ÜÔä×%Ñ%×*Ñ*¬]×-GÑ-G×-LÑ-LÔLð ñ “;ˆDßˆtÜ˜4Ö ñ	 Mô
 	×ÒÔ÷ 
$×	#Ö	#ús   ¼AB<Â$B<Â<
C
c                  óf   • [         R                  R                  R                  R	                  5       $ )z‹
Returns the internal dynamo recursion limit set by `torch._dynamo.set_recursion_limit`.

Returns -1 if no c recursion limit has been set.
)rK   rR   rL   r   Úget_c_recursion_limit© ó    rY   Úget_recursion_limitrb   Ä   s#   € ô �8‰8×Ñ×&Ñ&×<Ñ<Ó>Ð>ra   Úlimitc                 ój   • [         R                  R                  R                  R	                  U 5        g)ao  
Sets an internal dynamo recursion limit. The limit must be >= 1, or -1 to reset
to the default (unset) state.

This is possibly needed in Python 3.12-3.13 since there is a separate C recursion limit
that is not visible at the Python level. If you are getting RecursionErrors during
Dynamo compilation and `sys.setrecursionlimit()` doesn't help, this function may alleviate
the issue.

NOTE: this function does NOT call `sys.setrecursionlimit()` - the user is expected to manually
    call this if required. This is because the 2 recursion limits are not sync'd up - e.g. in
    Python 3.12, functions can be inline-evaluated, which apparently doesn't use up the C stack.

WARNING: increasing the recursion limit to an arbitrary large value may cause segfaults
    due to stack overflows! You can try also try to manually increase the stack size, e.g.
    with `$ ulimit -s ...`
N)rK   rR   rL   r   Úset_c_recursion_limit)rc   s    rY   r<   r<   Í   s"   € ô$ 
‡H�H×Ñ×Ñ×5Ñ5°eÕ<ra   )r=   N)UÚ__doc__rK   Ú r   r   r   r   r   r	   Úbackends.registryr
   r   r   Úcallbackr   r   r   r   r   Ú
decoratorsr   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   Úexternal_utilsr0   Úmutation_guardr1   Úpgor2   Úsymbolic_convertr3   rP   r4   r5   r6   r7   r8   r9   Ú	polyfillsr:   Ú_Ú__all__ÚserializationÚadd_safe_globalsrL   Ú	_DimRangeÚmanual_seedÚrandomÚtorch.jit._builtinsÚ_disable_dynamoÚjitÚ	_builtinsÚ_register_builtinr;   rE   Úintrb   r<   r`   ra   rY   Ú<module>r}      s*  ðñó ÷÷ ÷ OÑ Nß HÑ HÝ &Ý !÷÷ ÷ ÷ ÷ õ ÷.
÷ 
õ 
õ )Ý -Ý !Ý ,÷÷ õ #ò$€ðN × Ñ × $Ñ $ e§m¡m×&>Ñ&>×&HÑ&HÐ%IÔ Jà×Ñ˜Ÿ™×0Ñ0Ò0Ûð ×-Ò-¨e×.?Ñ.?Ó@€EÔà	‡I�I×Ñ×)Ñ)¨%×*;Ñ*;Ð=PÔQô($ôVð.?˜Sô ?ð=˜sð = tõ =ra   