ó
    
EñiÁ  ã                   óÄ   • S SK r S SKrS SKr\ R                  S 5       r\ R                  S 5       r\R                  R                  rS	S jr	S r
S rS\\\\4      4S jrg)
é    Nc              #   ó  #   • [         R                  R                  5       n[         R                  R                  U 5         Sv •  [         R                  R                  U5        g! [         R                  R                  U5        f = f7f)zlContext manager that controls whether the JIT's executor will run optimizations before executing a function.N)ÚtorchÚ_CÚ_get_graph_executor_optimizeÚ_set_graph_executor_optimize)Úshould_optimizeÚstored_flags     ÚM/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torch/jit/_fuser.pyÚoptimized_executionr      sW   é € ô —(‘(×7Ñ7Ó9€KÜ	‡H�H×)Ñ)¨/Ô:ð;Ûä�‰×-Ñ-¨kÕ:øŒ�‰×-Ñ-¨kÕ:üs   ‚>B	ÁA% Á B	Á%!BÂB	c              #   ó8  #   • [         R                  R                  5       n[         R                  R                  5       n[         R                  R	                  5       n[         R                  R                  5       n[         R                  R                  5       nU S:X  a�  [         R                  R                  S5        [         R                  R                  S5        [         R                  R                  S5        [         R                  R                  S5        [         R                  R                  S5        GOU S:X  aÛ  [         R                  R                  S5      n[         R                  R                  S5      n[         R                  R                  S5        [         R                  R                  S5        [         R                  R                  S5        [         R                  R                  S5        [         R                  R                  S5        GO4U S:X  a�  [         R                  R                  S5        [         R                  R                  S5        [         R                  R                  S5        [         R                  R                  S5        [         R                  R                  S5        GO‘U S:X  aÚ  [         R                  R                  S5      n[         R                  R                  S5      n[         R                  R                  S5        [         R                  R                  S5        [         R                  R                  S5        [         R                  R                  S5        [         R                  R                  S5        O±U S:X  aœ  [         R                  R                  S5        [         R                  R                  S5        [         R                  R                  S5        [         R                  R                  S5        [         R                  R                  S5        O[        SU  S	35      e S
v •  U S;   a>  [         R                  R                  W5        [         R                  R                  W5        [         R                  R                  U5        [         R                  R                  U5        [         R                  R                  U5        [         R                  R                  U5        [         R                  R                  U5        g
! U S;   a>  [         R                  R                  W5        [         R                  R                  W5        [         R                  R                  U5        [         R                  R                  U5        [         R                  R                  U5        [         R                  R                  U5        [         R                  R                  U5        f = f7f)zâContext manager that facilitates switching between backend fusers.

Valid names:
* ``fuser0`` - enables only legacy fuser
* ``fuser1`` - enables only NNC
* ``fuser2`` - enables only nvFuser
* ``fuser3`` - enables oneDNN Graph
Úfuser0TFÚfuser1Úfuser2Úfuser3Únonez!unrecognized fuser option (name: Ú)N)r   r   )r   r   Ú_jit_can_fuse_on_cpuÚ_jit_can_fuse_on_gpuÚ_jit_texpr_fuser_enabledÚ_jit_nvfuser_enabledÚ_jit_llga_enabledÚ_jit_override_can_fuse_on_cpuÚ_jit_override_can_fuse_on_gpuÚ_jit_set_texpr_fuser_enabledÚ_jit_set_nvfuser_enabledÚ_jit_set_llga_enabledÚ_jit_set_profiling_executorr   Ú	Exception)ÚnameÚold_cpu_fuseÚold_gpu_fuseÚold_texpr_fuser_stateÚold_nvfuser_stateÚold_llga_stateÚold_profiling_executorÚold_profiling_modes           r
   Úfuserr'      sÖ  é € ô —8‘8×0Ñ0Ó2€LÜ—8‘8×0Ñ0Ó2€LÜ!ŸH™H×=Ñ=Ó?ÐÜŸ™×5Ñ5Ó7ÐÜ—X‘X×/Ñ/Ó1€NØˆxÓÜ�‰×.Ñ.¨tÔ4Ü�‰×.Ñ.¨tÔ4Ü�‰×-Ñ-¨eÔ4Ü�‰×)Ñ)¨%Ô0Ü�‰×&Ñ& uÖ-Ø	�Ó	Ü!&§¡×!EÑ!EÀdÓ!KÐÜ"ŸX™X×BÑBÀ4ÓHÐÜ�‰×.Ñ.¨tÔ4Ü�‰×.Ñ.¨tÔ4Ü�‰×-Ñ-¨dÔ3Ü�‰×)Ñ)¨%Ô0Ü�‰×&Ñ& uÖ-Ø	�Ó	Ü�‰×.Ñ.¨uÔ5Ü�‰×.Ñ.¨uÔ5Ü�‰×-Ñ-¨eÔ4Ü�‰×)Ñ)¨$Ô/Ü�‰×&Ñ& uÖ-Ø	�Ó	Ü!&§¡×!EÑ!EÀdÓ!KÐÜ"ŸX™X×BÑBÀ4ÓHÐÜ�‰×.Ñ.¨tÔ4Ü�‰×.Ñ.¨uÔ5Ü�‰×-Ñ-¨dÔ3Ü�‰×)Ñ)¨%Ô0Ü�‰×&Ñ& tÕ,Ø	�‹Ü�‰×.Ñ.¨uÔ5Ü�‰×.Ñ.¨uÔ5Ü�‰×-Ñ-¨eÔ4Ü�‰×)Ñ)¨%Ô0Ü�‰×&Ñ& uÕ-äÐ;¸D¸6ÀÐCÓDÐDð7ÛàÐ'Ó'Ü�H‰H×0Ñ0Ð1GÔHÜ�H‰H×1Ñ1Ð2DÔEä�‰×.Ñ.¨|Ô<Ü�‰×.Ñ.¨|Ô<Ü�‰×-Ñ-Ð.CÔDÜ�‰×)Ñ)Ð*;Ô<Ü�‰×&Ñ& ~Õ6øð Ð'Ó'Ü�H‰H×0Ñ0Ð1GÔHÜ�H‰H×1Ñ1Ð2DÔEä�‰×.Ñ.¨|Ô<Ü�‰×.Ñ.¨|Ô<Ü�‰×-Ñ-Ð.CÔDÜ�‰×)Ñ)Ð*;Ô<Ü�‰×&Ñ& ~Õ6üs    ‚QXÑT6 ÑC XÔ6C!XØXc                 óÂ   • U R                  5       S:X  a  UR                  U 5        g U R                  5        H%  nUR                  5        H  n[	        X15        M     M'     g )Nzprim::DifferentiableGraph)ÚkindÚappendÚblocksÚnodesÚ_get_differentiable_graph_node)ÚnodeÚ	diff_nodeÚblockÚns       r
   r-   r-   W   sG   € Ø‡y�yƒ{Ð1Ó1Ø×Ñ˜Õà—[‘[–]ˆEØ—[‘[–]�Ü.¨qÖ<ó #ò #ó    c                 ó    • [        X /UQ70 UD6$ )N)Ú_script_method_graph_for)ÚselfÚargsÚkwargss      r
   Ú
_graph_forr8   `   s   € Ü# DÐ@°Ò@¸Ñ@Ð@r2   c                 ó   •  UR                  5       n[        UR                  R                  5       5      n[	        U5      S:w  a  [        S[	        U5       35      eUS   R                  R                  5       nUS   R                  R                  5       n/ nUR                  5        H  n	[        X˜5        M     [	        U5      [	        U5      :w  a$  [        S[	        U5       S[	        U5       S35      e[        X‡5       HX  u  pš[        U
R                  R                  5       5      n[	        U5      S:X  d  M9  U	R                  SUS   R                  5        MZ     U$ ! [         a    U " U0 UD6  [        5       s $ f = f)Né   z'Expected exactly 1 execution plan, got r   zExpected fw_states (z) and diff_nodes (z) to have the same lengthÚSubgraph)Úget_debug_stateÚlistÚexecution_plansÚvaluesÚlenÚAssertionErrorÚgraphÚcopyÚcodeÚ!differentiable_op_executor_statesr,   r-   ÚzipÚg_r   Úlast_executed_optimized_graph)r5   Úparentr6   r7   ÚdbsÚepsrB   Ú	fw_statesÚ
diff_nodesr1   ÚstateÚfw_execution_planss               r
   r4   r4   d   sb  € ð /Ø×$Ñ$Ó&ˆÜ�3×&Ñ&×-Ñ-Ó/Ó0ˆÜˆs‹8�q‹=Ü Ð#JÌ3ÈsË8È*Ð!UÓVÐVØ�A‘—‘×!Ñ!Ó#ˆð ˜‘F—K‘K×AÑAÓCˆ	Ø*,ˆ
Ø—‘–ˆAÜ*¨1Ö9ñ ô ˆy‹>œS ›_Ó,Ü Ø&¤s¨9£~Ð&6ð 7Ü˜
“OÐ$Ð$=ð?óð ô
 ˜JÖ2‰HˆAÜ!% e×&;Ñ&;×&BÑ&BÓ&DÓ!EÐô Ð%Ó&¨!Õ+Ø—‘�ZÐ!3°AÑ!6×!<Ñ!<Ö=ñ 3ð ˆøÜó /ñ 	ˆdÐ�fÒÜ,Ó.Ò.ð	/ús   ‚D3E Ä9$E ÅE=Å<E=Ústrategyc                 óv   • [         R                  " S[        5        [        R                  R                  U 5      $ )a]  Set the type and number of specializations that can occur during fusion.

.. deprecated:: 2.5
    TorchScript is deprecated, please use ``torch.compile`` instead.

Usage: provide a list of pairs (type, depth) where type is one of "STATIC" or "DYNAMIC"
and depth is an integer.

Behavior - static vs dynamic:
    In STATIC fusion, fused ops are compiled to have fixed input shapes. The shape is determined
    based on some initial profiling runs.
    In DYNAMIC fusion, fused ops are compiled to have variable input shapes, so that multiple
    shapes are possible.

In both cases, we also recompile on new striding behavior, device, or dtype.

Behavior - fallback functions & depth:
    When an input doesn't match the format required by the specialized compiled op, it will run
    a fallback function. Fallback functions are recursively be compiled and specialized based
    on the observed tensor shapes. Since compilation can be slow, the "depth" parameter is provided to
    limit the number of specializations that can be compiled, before giving up on recompiling and
    falling back to a completely un-fused, un-specialized implementation.

The list of (type, depth) pairs controls the type of specializations and the number of
specializations. For example: [("STATIC", 2), ("DYNAMIC", 2)] indicates that the first
two specializations will use static fusions, the following two specializations will use
dynamic fusion, and any inputs that satisfy none of the 4 options will run an
unfused implementation.

NB: in the future, if more as more fusion backends are added there may be more granular
apis for specific fusers.
zR`torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.)ÚwarningsÚwarnÚDeprecationWarningr   r   Ú_jit_set_fusion_strategy)rP   s    r
   Úset_fusion_strategyrV   ˆ   s.   € ôB ‡M‚MØ\Üôô �8‰8×,Ñ,¨XÓ6Ð6r2   )ÚreturnN)Ú
contextlibrR   r   Úcontextmanagerr   r'   r   Ú_last_executed_optimized_graphrH   r-   r8   r4   r=   ÚtupleÚstrÚintrV   © r2   r
   Ú<module>r_      s   ðã Û ã ð ×Ññ;ó ð;ð ×Ññ=7ó ð=7ð@ !&§¡× GÑ GÐ ô=òAò!/ðH%7 $ u¨S°#¨X¡Ñ"7õ %7r2   