+
    –°³jKÙ  ã                  óÆ  a € 0 t $ R t^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIH	t	 ^ RI
HtHtHtHtHt ^ RIt^ RIHt ^ RIHtHt ^ RIHtHt ^ RIHt ^ R	IHtHtHtHtH t H!t!H"t"H#t#H$t$ ^ R
I%H&t&H't' ^ RI(H)t)H*t*H+t+H,t,H-t-H.t.H/t/H0t0H1t1 ^ RI2H3t3H4t4 ^ RI5H6t6 ^ RI7H8t8 ^RI9H:t: ^RI;H<t< ]'       dV   ^ RI=H>t> ^ RI?H@t@HAtA ^ RIBHCtC ^ RIDHEtE ^ RIFHGtG ^ RIHHItI ^RIJHKtK ^RILHMtM ]@]A].,          .]N3,          tOR]PR&    ! R R]4      tQ]P¤                  ! ]S4      tT]Pª                   ! R R4      4       tV]WtXR]PR&   R  R! ltYR" R# ltZR$ R% lt[R& R' lt\R( R) lt]R* R+ lt^R, R- lt_R. R/ lt` ! R0 R14      ta ! R2 R3]a4      tb]Pª                   ! R4 R5]V4      4       tc]Pª                   ! R6 R7]V4      4       td]Pª                   ! R8 R9]V4      4       te]Pª                   ! R: R;]V4      4       tfR# )<aÞ  
This provides an abstract class which parametrizes over an "output code" concept
for Inductor.  Intuitively, this represents the compiled callable which Inductor
produces which you can call to get optimized code.  However, this callable
has some other capabilities:

- It is serializable, so you can save/load this product from disk without
  having to do compilation again.

- (When using remote cache) it is addressable, so you can save just a key
  which you can use to load this product from remote cache later.

This class is abstract because we have several different implementations of
serialized format:

- Python wrapper (the default)

- AOTInductor (this produces ABI stable binaries which work across PyTorch
  versions)

)ÚannotationsN)Úpartial)ÚAnyÚcastÚProtocolÚTYPE_CHECKINGÚ	TypeAlias)ÚCustomClassBase)ÚcountersÚget_runtime_metrics_context)Úcompile_contextÚCompileContext)Úinductor_compiled_code)	ÚBoxedDeviceIndexÚ/cudagraph_trees_clone_live_user_visible_outputsÚCudagraphCachedInfoÚCudagraphMetadataÚget_input_storage_mutation_infoÚ!get_input_storage_mutation_reasonÚ get_partition_cudagraph_metadataÚget_placeholder_infoÚ#log_cudagraph_skip_and_bump_counter)Úhas_frozen_paramsÚis_frozen_param)	Ú&_unstable_customized_partition_wrapperÚalign_inputs_from_check_idxsÚ	BoxedBoolÚCUDAGraphWrapperMetadataÚGraphPartitionMapÚ	InputTypeÚis_gpuÚoutput_nodeÚ"set_tracing_context_output_strides)Ú_node_metadata_key_filter_safeÚ_ops_filter_safe)Ú
OrderedSet)Úis_in_torch_dispatch_mode)Úconfig)ÚAutotuneCacheBundler)ÚCounter)ÚCallableÚSequence)Úmetrics)ÚGraphLowering)ÚFakeScriptObject)ÚWeights)Ú_CompileFxKwargs)ÚTritonBundler   Ú_BoxedCallablec                  ó2   € ] tR t^Ut$ RtR]R&   R R ltRtR# )ÚCompiledFnRunnera  Runner emitted by the Python wrapper when graph_partition is on.

codegen writes a Runner class (see codegen/wrapper.py) whose partitions
hold the per-partition callables and whose recursively_apply_fns rewrites
each partition in place (e.g. wrapping it in a cudagraph).
zlist[Callable[..., Any]]Ú
partitionsc               ó    € V ^8„  d   QhRRRR/# )é   ÚfnszSequence[Callable[..., Any]]ÚreturnÚNone© )Úformats   "Ú\/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torch/_inductor/output_code.pyÚ__annotate__ÚCompiledFnRunner.__annotate___   s   € ×WÑWÐ-IÐWÈdÑWó    c                	ó   € R # ©Nr;   )Úselfr8   s   &&r=   Úrecursively_apply_fnsÚ&CompiledFnRunner.recursively_apply_fns_   s   € ÑTWr@   r;   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotations__rD   Ú__static_attributes__r;   r@   r=   r4   r4   U   s   ‡ ñ	ð -Ó,çWÑWr@   r4   c                  óÞ   € ] tR t^et$ ]P
                  ! RRR7      tR]R&   ]P
                  ! RRR7      tR]R&   ]P
                  ! RRR7      t	R]R	&   R
 R lt
R R ltR R ltR R ltRtR# )Ú
OutputCodeNF)ÚdefaultÚinitú
str | NoneÚ_fx_graph_cache_keyzlist[str] | NoneÚ_fx_graph_cache_debug_linesz
int | NoneÚ_time_taken_nsc               ó    € V ^8„  d   QhRRRR/# ©r7   ÚinputszSequence[Any]r9   r   r;   )r<   s   "r=   r>   ÚOutputCode.__annotate__r   s   € ÷ .ñ .˜}ð .°ñ .r@   c                	ó*   € \        \        V 4      4      hrB   ©ÚNotImplementedErrorÚtype©rC   rW   s   &&r=   Ú__call__ÚOutputCode.__call__r   ó   € Ü!¤$ t£*Ó-Ð-r@   c               ó   € V ^8„  d   QhRR/# ©r7   r9   r:   r;   )r<   s   "r=   r>   rX   u   s   € ÷ .ñ .¨4ñ .r@   c                	ó*   € \        \        V 4      4      hrB   rZ   ©rC   s   &r=   Úprepare_for_serializationÚ$OutputCode.prepare_for_serializationu   r`   r@   c               ó(   € V ^8„  d   QhRRRRRRRR/# ©	r7   Úexample_inputsúSequence[InputType]Ú	constantsÚCompiledFxGraphConstantsÚgraph_kwargsr0   r9   r:   r;   )r<   s   "r=   r>   rX   x   s2   € ÷ .ñ .à+ð.ð ,ð.ð 'ð	.ð
 
ñ.r@   c                	ó*   € \        \        V 4      4      hrB   rZ   ©rC   ri   rk   rm   s   &&&&r=   Úpost_compileÚOutputCode.post_compilex   s   € ô "¤$ t£*Ó-Ð-r@   c               ó    € V ^8„  d   QhRRRR/# ©r7   Útriton_bundler   r9   r:   r;   )r<   s   "r=   r>   rX   �   s   € ÷ .ñ .¨sð .°tñ .r@   c                	ó*   € \        \        V 4      4      hrB   rZ   ©rC   rt   s   &&r=   Úset_triton_bundleÚOutputCode.set_triton_bundle�   r`   r@   r;   )rF   rG   rH   rI   ÚdataclassesÚfieldrR   rK   rS   rT   r^   re   rp   rw   rL   r;   r@   r=   rN   rN   e   sl   ‡ ð
 '2×&7Ò&7ÀÈ5Ô&QÐ˜ÓQØ4?×4EÒ4EØ˜5ô5ÐÐ!1ó ð
 "-×!2Ò!2¸4ÀeÔ!L€N�JÓLõ.õ.õ.÷.ñ .r@   rN   Ú_StrideExprStrc               ó    € V ^8„  d   QhRRRR/# )r7   Útútorch.Tensorr9   ú	list[int]r;   )r<   s   "r=   r>   r>   Œ   s   € ÷ Mñ M˜ð M¨)ñ Mr@   c                óø   € \        V \        P                  4      '       g   R # \        V P                  4       Uu. uF4  qP                  V4      ^ 8X  g   K  V P                  V4      ^8w  g   K2  VNK6  	  up# u upi rB   )Ú
isinstanceÚtorchÚTensorÚrangeÚndimÚstrideÚsize)r}   Úis   & r=   Úget_expanded_dimsr‰   Œ   sU   € Ü�aœŸ™×&Ò&áÜ˜QŸV™V”}ÓL‘}�!¯©°«°qÑ(8ŒA¸Q¿V¹VÀA»YÈ!¹^�AˆA‘}ÑLÐLùÒLs   ºA7ÁA7Á.A7c               ó$   € V ^8„  d   QhRRRRRR/# )r7   r}   r~   Úexpanded_dimsr   r9   r;   )r<   s   "r=   r>   r>   “   s!   € ÷ ñ ˜<ð ¸	ð Àlñ r@   c                ón   € V F.  p\         P                  P                  P                  W^ ^4      p K0  	  V # )é    )r‚   ÚopsÚatenÚslice)r}   r‹   Úexpanded_dims   && r=   Úindex_expanded_dimsr’   “   s-   € Û%ˆÜ�I‰I�N‰N× Ñ  °!°QÓ7Šñ &à€Hr@   c               ó$   € V ^8„  d   QhRRRRRR/# )r7   Údstr~   Úsrcr9   r:   r;   )r<   s   "r=   r>   r>   �   s!   € ÷ ñ ˜|ð °,ð À4ñ r@   c           	     óÌ  € V P                   VP                   8w  d&   \        R V P                    RVP                    24      h\        V P                  4       4      \        VP                  4       4      8w  d@   \        R\        V P                  4       4       R\        VP                  4       4       24      h\        V P	                  4       4      \        VP	                  4       4      8w  d@   \        R\        V P	                  4       4       R\        VP	                  4       4       24      hV P                  4       ^ 8X  d   R# \        ;QJ d*    R VP	                  4        4       F  '       d   K   RM	  RM! R VP	                  4        4       4      '       g   \        R4      hVP                  4       p\        R	 \        VP                  4       VP	                  4       4       4       4      ^,           V,          pVP                  4       V,          pV P                  4       V,          pV P                  4       WUV,            P                  VP                  4       WDV,            4       R# )
zdtype mismatch: dst=z src=zsize mismatch: dst=zstride mismatch: dst=Nc              3  ó*   "  € T F	  q^ 8¬  x € K  	  R# 5i)r�   Nr;   )Ú.0Ústs   & r=   Ú	<genexpr>Ú(copy_strided_storage_.<locals>.<genexpr>ª   s   é € Ð/¡,˜B�a–£,ùs   ‚FTz3copy_strided_storage_ requires non-negative stridesc              3  óF   "  € T F  w  rV^,
          V,          x € K  	  R# 5i)é   Nr;   )r˜   Úsr™   s   &  r=   rš   r›   ­   s   é € ÐJÑ,I¡5 1�1�q•5˜B—,’,Ó,Iùs   ‚!)ÚdtypeÚAssertionErrorÚtupler‡   r†   ÚnumelÚallÚelement_sizeÚsumÚzipÚstorage_offsetÚuntyped_storageÚcopy_)r”   r•   ÚelemÚnbytesÚsrc_offÚdst_offs   &&    r=   Úcopy_strided_storage_r®   �   sÀ  € Ø
‡y�y�C—I‘IÔÜÐ3°C·I±I°;¸eÀCÇIÁIÀ;ÐOÓPÐPÜˆS�X‰X‹ZÓœE #§(¡(£*Ó-Ô-ÜØ!¤%¨¯©«
Ó"3Ð!4°E¼%ÀÇÁÃ
Ó:KÐ9LÐMó
ð 	
ô ˆS�Z‰Z‹\Óœe C§J¡J£LÓ1Ô1ÜØ#¤E¨#¯*©*«,Ó$7Ð#8¸¼eÀCÇJÁJÃLÓ>QÐ=RÐSó
ð 	
ð ‡y�yƒ{�aÔÙß‹CÑ/ #§*¡*¤,Ó/�C�CŠCÑ/ #§*¡*¤,Ó/×/Ò/ÜÐRÓSÐSØ×ÑÓ€DÜÑJ¬C°·±³
¸C¿J¹J»LÔ,IÓJÓJÈQÕNÐRVÕV€FØ× Ñ Ó" TÕ)€GØ× Ñ Ó" TÕ)€GØ×ÑÓ˜'¨fÕ$4Ð5×;Ñ;Ø×ÑÓ˜g°&Õ(8Ð9ör@   c               ó$   € V ^8„  d   QhRRRRRR/# )r7   Úcompiled_graphÚCompiledFxGraphÚboxed_forward_device_indexúBoxedDeviceIndex | Noner9   r:   r;   )r<   s   "r=   r>   r>   µ   s&   € ÷ <ñ <Ø#ð<à 7ð<ð 
ñ<r@   c                óÊ  aa€ V P                   f   \        R4      hV P                  R,          pV'       d­   \        P                  P
                  '       d‹   Vf   \        R4      hVP                  f   \        R4      hV P                   o\        P                  P
                  P                  VP                  RR7      oSf   \        R4      hR VV3R	 llpW0n         R # R # R # )
Nú0compiled_graph.current_callable must not be NoneÚis_backwardz+boxed_forward_device_index must not be Nonez1boxed_forward_device_index.value must not be NoneF)Úcreate_if_none_existsz"CUDAGraph manager must not be Nonec               ó    € V ^8„  d   QhRRRR/# )r7   Ú
new_inputsrj   r9   Úobjectr;   )r<   s   "r=   r>   Ú6maybe_handle_backward_generation.<locals>.__annotate__Î   s   € ÷ 	7ñ 	7Ð*=ð 	7À&ñ 	7r@   c                ó4   <€ SP                  4        S! V 4      # rB   )Úset_to_running_backward)r¹   Úcompiled_graph_callableÚmanagers   &€€r=   Úcompiled_artifactÚ;maybe_handle_backward_generation.<locals>.compiled_artifactÎ   s   ø€ Ø×+Ñ+Ô-Ù*¨:Ó6Ð6r@   )
Úcurrent_callabler    Ú	fx_kwargsr'   ÚtritonÚcudagraph_treesÚvaluer‚   Ú	_inductorÚget_manager)r°   r²   r¶   rÀ   r¾   r¿   s   &&  @@r=   Ú maybe_handle_backward_generationrÉ   µ   sÍ   ù€ ð ×&Ñ&Ò.ÜÐOÓPÐPØ ×*Ñ*¨=Õ9€K÷
 ”v—}‘}×4×4Ð4Ø%Ò-Ü Ð!NÓOÐOØ%×+Ñ+Ò3Ü Ð!TÓUÐUØ"0×"AÑ"AÐä—/‘/×1Ñ1×=Ñ=Ø&×,Ñ,ÀEð >ó 
ˆð Š?Ü Ð!EÓFÐF÷	7ñ 	7ð +<Ö'ñ% 5�{r@   c               ó(   € V ^8„  d   QhRRRRRRRR/# )	r7   r°   r±   ri   rj   r²   r³   r9   r:   r;   )r<   s   "r=   r>   r>   Õ   s6   € ÷ Oñ OØ#ðOà'ðOð !8ðOð 
ñ	Or@   c                óŒ  € \         P                  P                  '       g7   V F0  p\        V\        P
                  4      '       g   K%  \        V4       K2  	  V P                  R ,          pV P                  R,          pVeD   V'       g:   V'       g0   VP                  \        \        V P                  4      4      4       R# R# R# R# )Úis_inferencer¶   N)r'   rÄ   rÅ   r�   r‚   ÚSymIntÚintrÃ   ÚsetÚnextÚiterÚdevice_idxs)r°   ri   r²   r}   rÌ   r¶   s   &&&   r=   Úprepare_cudagraph_post_compilerÓ   Õ   sŒ   € ô
 �=‰=×(×(Ð(ãˆAÜ˜!œUŸ\™\×*Ô*Ü�A–ñ  ð "×+Ñ+¨NÕ;€LØ ×*Ñ*¨=Õ9€KØ!Ò-·lÏ;Ø"×&Ñ&¤t¬D°×1KÑ1KÓ,LÓ'MÖNñ LW±lÑ-r@   c               ó0   € V ^8„  d   QhRRRRRRRRR	R
RR/# ©r7   ri   rj   r°   r±   Ú
cudagraphsr   rk   údict[str, torch.Tensor | type]r²   r³   r9   r:   r;   )r<   s   "r=   r>   r>   æ   sL   € ÷ bñ bØ'ðbà#ðbð ðbð .ð	bð
 !8ðbð 
ñbr@   c                óð  € ^ RI Hp VP                  f   \        R4      hVP                  f   \        R4      hVP                  pVP
                  pVP                  R,          pVP                  R,          p	VP                  RR4      '       d/   \        P                  ! V4       \        W4       \        R	4       R# V'       Egƒ   VP                  p
V
R
,          pVP                  pVP                  pVf   \        R4      h\        VRR4      p\        WV4       VP                  pVf   \        R4      hVP!                  4        UUu/ uF+  w  pp\#        V\$        P&                  4      '       g   K(  VVbK-  	  ppp\)        \+        VP,                  4      4      p\/        VVV	V\1        VP3                  4       4      V\1        VP4                  4      VP6                  \1        V4      R7	      p\8        P:                  pVe'   VP<                  ! TT T;'       g    R3/ VB Vn        R# ^RIHp T! V3R
T;'       g    R/VB Vn        R# \        P                  ! V4       \        W4       \@        ;QJ d&    R VPB                   4       F  '       g   K   RM	  RM! R VPB                   4       4      '       d:   VPD                  '       d   \        VPD                  4       R# \        RV 24       R# R# u uppi )z‘
Checks for any reasons not to run cudagraphs and then
runs it on compiled_graph.
Mutates the `compiled_graph.current_callable` and `cudagraphs`
©ÚCompilerBisectorNrµ   ú.compiled_graph.cudagraph_info must not be NonerÌ   r¶   ÚinductorrÖ   ú#skipping cudagraphs due to bisectorÚstatic_input_idxsz9stack_traces should not be None in cudagraph_post_compileÚuser_visible_output_idxsz!current_callable must not be None)	Údevice_indexÚstack_tracesr¶   rÌ   rk   ÚplaceholdersÚmutated_input_idxsÚkernel_free_cudagraphrß   ©Úcudagraphifyc              3  ó8   "  € T F  p\        V4      x € K  	  R # 5irB   ©r    ©r˜   Údevices   & r=   rš   Ú)cudagraph_post_compile.<locals>.<genexpr>>  s   é € ÐHÑ,G &Œv�f�~ˆ~Ó,Gùó   ‚TFúskipping cudagraphs due to r;   )#Ú!torch._inductor.compiler_bisectorrÚ   rÂ   r    Úcudagraph_infoÚcudagraph_fail_reasonsrÃ   Údisable_subsystemr   ÚdisablerÉ   r   râ   rá   ÚgetattrrÓ   Úitemsr�   r‚   rƒ   rÐ   rÑ   rÒ   Údictr¡   Úvaluesrã   rä   r'   Úcudagraph_policyræ   Ú
compile_fxÚanyÚdevice_typesÚdisabled_cudagraphs_reason)ri   r°   rÖ   rk   r²   rÚ   Úcached_inforð   rÌ   r¶   rÃ   rÞ   râ   rá   rß   rÂ   ÚkÚvÚtensor_constantsrà   Úcudagraphify_kwargsÚpolicyræ   s   &&&&&                  r=   Úcudagraph_post_compiler  æ   sÆ  € õ Cà×&Ñ&Ò.ÜÐOÓPÐPØ×$Ñ$Ò,ÜÐMÓNÐNØ ×/Ñ/€KØ(×?Ñ?ÐØ!×+Ñ+¨NÕ;€LØ ×*Ñ*¨=Õ9€Kð ×)Ñ)¨*°l×CÒCÜ×Ò˜*Ô%Ü(¨ÔTÜ+Ð,QÔRÙç!Ð!Ø"×,Ñ,ˆ	Ø%Ð&9Õ:Ðà"×/Ñ/ˆØ"×/Ñ/ˆØÒÜ ØKóð ô $+¨;Ð8RÐTVÓ#WÐ ä&ØÐ,Fô	
ð *×:Ñ:ÐØÒ#Ü Ð!DÓEÐEð 'Ÿ_™_Ô.ô
Ù.‘T�Q˜´*¸QÄÇÁ×2MŒDˆAˆqŠDÑ.ð 	ñ 
ô œD ×!;Ñ!;Ó<Ó=ˆÜ"Ø%Ø%Ø#Ø%ÜÐ,×3Ñ3Ó5Ó6Ø%Ü$ ^×%FÑ%FÓGØ"0×"FÑ"FÜ%*Ð+CÓ%Dô

Ðô ×(Ñ(ˆØÒØ.4×.AÒ.AØ ØØ!×'Ð' Rñ/ð &ñ	/ˆNÖ+õ 1á.:Ø ñ/à"3×"9Ð"9°rð/ð &ñ/ˆNÖ+ô 	×Ò˜*Ô%Ü(¨ÔTç‹3ÑH¨N×,GÒ,GÓH�3�3Š3ÑH¨N×,GÒ,GÓH×HÒHð ×8×8Ð8Ü3Ø"×=Ñ=öô 4Ø1Ð2HÐ1IÐJöñ IùóM
s   Å	%K2Å3K2c               ó0   € V ^8„  d   QhRRRRRRRRR	R
RR/# rÕ   r;   )r<   s   "r=   r>   r>   K  sL   € ÷ a;ñ a;Ø'ða;à#ða;ð ða;ð .ð	a;ð
 !8ða;ð 
ña;r@   c                ó@  € ^ RI Hp VP                  RR4      '       d/   \        P                  ! V4       \        W4       \        R4       R# VP                  f   \        R4      hVP                  P                  pV'       g)   VP                  e   \        VP                  4      ^ 8X  d$   \        P                  ! V4       \        W4       R# VP                  f   \        R4      hVP                  f   \        R4      hVP                  R	,          pVP                  R
,          p\        VP                  R,          ;'       g    R4      p	VP                   p
\#        \%        VP&                  4      4      pVP)                  4        UUu/ uF)  w  rÍ\+        V\,        P.                  4      '       g   K'  WÍbK+  	  pppVP                  P0                  f   \        R4      h\3        VP                  P4                  V	V
VP                  P0                  \        \7        VP                  RR4      4      V4      p\9        WV4       ^RIHp . pVP                   F®  p\?        VV4      p\A        V\C        VPD                  4      VVP0                  VV\C        VPF                  PI                  4       4      VP4                  \C        VP                   4      VPJ                  \C        VPL                  4      R7      pVPO                  V4       K°  	  VP                  V4       R# u uppi )a2  
Cudagraphify each partition function, which first prepares the necessary
metadata and then applies the cudagraphify function to each partition.

Assuming all partition functions are cudagraphified and share the same order
as `compiled_graph.partition_maps`. See [Note: Graph Partition Map for CUDAGraph].
rÙ   rÜ   rÖ   rÝ   NrÛ   rµ   z5compiled_graph.recursively_apply_fns must not be NonerÌ   r¶   rÞ   zCstack_traces should not be None in cudagraph_partition_post_compilerß   rå   )
rÞ   rà   rá   r¶   rÌ   rk   râ   rã   rä   rß   r;   )(rî   rÚ   rñ   r   rò   rÉ   r   rï   r    rð   Úpartition_mapsÚlenrÂ   rD   rÃ   r%   rã   rÐ   rÑ   rÒ   rô   r�   r‚   rƒ   rá   r   râ   ró   rÓ   rø   ræ   r   r   r¡   rÞ   rk   rö   rä   rß   Úappend)ri   r°   rÖ   rk   r²   rÚ   rð   rÌ   r¶   rÞ   rã   rà   rý   rþ   rÿ   Úgraph_metadataræ   Úcudagraphify_fnsÚpartition_mapÚpartition_metadataÚcudagraphify_fns   &&&&&                r=   Ú cudagraph_partition_post_compiler  K  sÁ  € õ Cà×)Ñ)¨*°l×CÒCÜ×Ò˜*Ô%Ü(¨ÔTÜ+Ð,QÔRÙà×$Ñ$Ò,ÜÐMÓNÐNØ+×:Ñ:×QÑQÐ÷ 	Ø×(Ñ(Ò0Üˆ~×,Ñ,Ó-°Ô2ô 	×Ò˜*Ô%Ü(¨ÔTÙà×&Ñ&Ò.ÜÐOÓPÐPØ×+Ñ+Ò3ÜÐTÓUÐUØ!×+Ñ+¨NÕ;€LØ ×*Ñ*¨=Õ9€KÜ" >×#;Ñ#;Ð<OÕ#P×#VÐ#VÐTVÓWÐØ'×:Ñ:ÐÜœ˜^×7Ñ7Ó8Ó9€Lð #Ÿ™Ô*ôÙ*‘�¬j¸¼E¿L¹L×.IŒˆŠÑ*ð ñ ð ×$Ñ$×1Ñ1Ò9ÜØQó
ð 	
ô 'Ø×%Ñ%×2Ñ2ØØØ×%Ñ%×2Ñ2ÜÜ�N×1Ñ1Ð3MÈrÓRó	
ð 	ó	€Nô #ØÐ(Bôõ )ð
 ÐØ'×6Ô6ˆÜ=ØØó
Ðô
 "ØÜ#Ð$6×$HÑ$HÓIØ%Ø+×8Ñ8Ø#Ø%ÜÐ.×8Ñ8×?Ñ?ÓAÓBØ+×8Ñ8Ü$Ð%7×%JÑ%JÓKØ"0×"FÑ"FÜ%*Ð+=×+VÑ+VÓ%Wô
ˆð 	×Ñ Ö0ñ' 7ð* ×(Ñ(Ð)9Ö:ùóes   Æ
$LÆ3Lc          
     ó,   € V ^8„  d   QhRRRRRRRRR	R
/# )r7   Úran_cudagraphsr   r°   r±   Úinputs_to_checkúSequence[int]Úmutated_inputs_idxsúOrderedSet[int]r9   r:   r;   )r<   s   "r=   r>   r>   ¯  sA   € ÷ $Wñ $WØð$Wà#ð$Wð #ð$Wð )ð	$Wð
 
ñ$Wr@   c                ó6  € V '       gŒ   TpVP                   '       d   V Uu. uF  qUV9   g   K  VNK  	  ppV'       dU   VP                  f   \        R4      h\        VP                  VV4      pWaP                  Jd   \	        RV4      Vn        R# R# R# R# u upi )a7  
Realigns input strides from inputs_to_check if
we didn't end up running cudagraphs. Mutates
`compiled_graph.current_callable` if cudagraphs
was run. Otherwise, does nothing.

Non-mutated inputs are handled by deferred alignment copies
in the generated code. Only mutated inputs need the wrapper
for writeback.
Nrµ   r2   )Ú_defers_input_alignmentrÂ   r    r   r   )r  r°   r  r  Ú
check_idxsrˆ   Únew_callables   &&&&   r=   Úmaybe_realign_inputsr  ¯  s    € ÷  Ø$ˆ
Ø×1×1Ð1ñ
 &5ÓQ¡_ Ð=PÑ8PŸ!˜!¡_ˆJÐQßØ×.Ñ.Ò6Ü$Ð%WÓXÐXÜ7Ø×/Ñ/ØØ#óˆLð
 ×#BÑ#BÓBô 37Ð7GÈÓ2V�Ö/ñ	 Cñ ñ ùò Rs
   ¡B®Bc                  ó&   € ] tR tRtRtR R ltRtR# )rl   iÖ  a,  Wrapper class that unwraps constants from a compiled fx graph. This
version of the class only supports directly grabbing the saved constants off of
a CompiledFxGraph.

With freezing, FxGraphCache doesn't store the constants of the input
GraphModule it gets from AOTAutograd. Instead, it saves just the **names**
of those constants, and grabs the constant values directly from the graph module
passed in at runtime.

Thing is, we don't always *have* the graph module available at runtime, hence
the existence of this class and its CompiledFxGraphConstantsWithGm counterpart.

To support freezing, FXGraphCache gets passed a CompiledFxGraphConstantsWithGm during
post compile. Otherwise, CompiledFxGraphConstants supports the basic case of loading
the value of constants directly off of the original saved object.
c               ó    € V ^8„  d   QhRRRR/# ©r7   Úgr±   r9   r×   r;   )r<   s   "r=   r>   Ú%CompiledFxGraphConstants.__annotate__è  s   € ÷ >ñ >˜ð >Ð,Jñ >r@   c                	óh   € VP                   f   \        R4      h/ VP                   CVP                  C# )Nzg.constants must not be None)rk   r    Úopaque_value_type_classes)rC   r  s   &&r=   ÚunwrapÚCompiledFxGraphConstants.unwrapè  s2   € Ø�;‰;ÒÜ Ð!?Ó@Ð@Ø=�!—+‘+Ð= ×!<Ñ!<Ð=Ð=r@   r;   N)rF   rG   rH   rI   rJ   r   rL   r;   r@   r=   rl   rl   Ö  s   † ñ÷">ñ >r@   rl   c                  ó2   € ] tR tRtRtR R ltR R ltRtR# )	ÚCompiledFxGraphConstantsWithGmiî  a  
This version of CompiledFxGraphConstants, instead of grabbing constants
directly saved on CompiledFxGraphs, will just grab their names. Then, it takes
a second GraphModule to grab the corresponding constant values out of.

This is necessary for supporting freezing in FxGraphCache.
c               ó    € V ^8„  d   QhRRRR/# )r7   Úgmútorch.fx.GraphModuler9   r:   r;   )r<   s   "r=   r>   Ú+CompiledFxGraphConstantsWithGm.__annotate__÷  s   € ÷ ñ Ð/ð °Dñ r@   c                	ó   € Wn         R # rB   ©r%  )rC   r%  s   &&r=   Ú__init__Ú'CompiledFxGraphConstantsWithGm.__init__÷  s   € ØŽr@   c               ó    € V ^8„  d   QhRRRR/# r  r;   )r<   s   "r=   r>   r'  ú  s   € ÷ Mñ M˜ð MÐ,Jñ Mr@   c           	     	óâ   € VP                   P                  4        UUu/ uF  w  r#V\        V P                  V4      bK  	  pppVP                  ;'       g    / p/ VCVCVP
                  C# u uppi rB   )Úfrozen_param_namesrô   ró   r%  rk   r  )rC   r  ÚnameÚ	orig_nameÚfrozen_paramsrk   s   &&    r=   r   Ú%CompiledFxGraphConstantsWithGm.unwrapú  sx   € ð $%×#7Ñ#7×#=Ñ#=Ô#?ô
á#?‘�ð ”'˜$Ÿ'™' 9Ó-Ò-Ù#?ð 	ñ 
ð —K‘K×%Ð% 2ˆ	ØL�)ÐL˜}ÐL°×0KÑ0KÐLÐLùó
s   ž"A+r)  N)rF   rG   rH   rI   rJ   r*  r   rL   r;   r@   r=   r#  r#  î  s   † ñõ÷Mñ Mr@   r#  c                  ó´  € ] tR tRt$ RtR]R&   R]R&   R]R&   R	]R
&   ]P                  ! RR7      tR	]R&   ]P                  ! RR7      t	R	]R&   ]P                  ! RR7      t
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"]R(&   R"]R)&   R"]R*&   R"]R+&   R,]R-&   R.]R/&   R0]R1&   R"]R2&   R3]R4&   R5]R6&   R7tR8]R9&   R7tR:]R;&   RtR,]R<&   RtR,]R=&   ]P                  ! R7RRRR>7      tR?]R@&   R7tRA]RB&   R7tRC]RD&   RXRE RF lltRG RH ltRI RJ ltRK RL ltRM RN ltRO RP ltRQ RR ltRS RT ltRU RV ltRWtR7# )Yr±   i  zf
Class holding a compiled FX graph. This is the object serialized on disk
to support FxGraph caching.
ú_BoxedCallable | NonerÂ   z5Callable[[Sequence[Callable[..., Any]]], None] | NonerD   úCompiledFnRunner | NoneÚcompiled_fn_runnerÚstrÚ	cache_keyF)ÚreprÚsource_codeÚrunnable_graph_strÚinductor_post_grad_graph_strzlist[tuple[int, str]] | NoneÚcache_linemapzOrderedSet[str]rú   r  rÒ   Úmutated_inputsrã   zdict[str, torch.Tensor] | Nonerk   zdict[str, str]r.  z3dict[str, torch._C.ScriptObject | FakeScriptObject]Útorchbind_constantszdict[str, type]r  z.list[tuple[_StrideExprStr, ...] | None] | NoneÚoutput_stridesrQ   rû   úmetrics.CachedMetricsDeltasÚmetrics_deltasúCounter[str]Úcounter_deltasÚguards_exprÚextern_libs_keyÚinductor_provenance_mapping_strÚ$inductor_provenance_stack_traces_strÚboolrä   zCudagraphCachedInfo | Nonerï   zlist[GraphPartitionMap] | Noner  Úcompile_region_namer0   rÃ   r  r  Nzbool | NoneÚ_boxed_callzTritonBundle | NoneÚ_triton_bundleÚ_wrap_compiled_regionsr  )rO   rP   r9  ÚcomparezCompileContext | NoneÚ_compile_contextztorch.fx.GraphModule | NoneÚ_original_gmúbytes | NoneÚ_serialized_original_gmc          &     ód   € V ^8„  d   Qh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RRRRR
RR
R R!/# )"r7   rÂ   r4  Úgraphr-   r%  r&  r@  z'list[tuple[_StrideExprStr, ...] | None]rû   rQ   rB  rA  rD  rC  rÖ   r   ri   rj   rÞ   r  rJ  rÃ   r0   r  r;  r7  r<  r6  r5  rG  rH  r9   r:   r;   )r<   s   "r=   r>   ÚCompiledFxGraph.__annotate__>  sÞ   € ÷ ~(ñ ~(à/ð~(ð ð~(ð !ð	~(ð
 @ð~(ð %/ð~(ð 4ð~(ð %ð~(ð ð~(ð ,ð~(ð )ð~(ð (ð~(ð $ð~(ð 'ð~(ð  ð~(ð  '*ð!~(ð" 4ð#~(ð$ *4ð%~(ð& /9ð'~(ð( 
ñ)~(r@   c                	óæ  € Wn         VV n        Ve   VP                  MR V n        VP                  V n        VP                  '       d<   \        VP                  4      ;_uu_ 4       pVP                  4       V n        R R R 4       Wàn        Wðn	        VV n
        VV n        VP                  V n        \        VP                  4      V n        \        VP                  4      V n        \        VP                   4      V n        \        VP"                  4      V n        \%        V4      '       g   VP&                  V n        / V n        Mt/ V n        / V n        VP&                  P+                  4        FH  w  pp\-        V4      '       d#   VP.                  V,          V P(                  V&   K9  VV P&                  V&   KJ  	  VP0                  V n        VP2                  V n        W@n        WPn        VP8                  V n        W`n        Wpn        R V n        R V n         R V n!        VPD                  V n"        \G        VRR4      V n$        \K        V4      p/ V n&        RV n'        R pV'       EdÌ   V P6                  '       d    \P        ;QJ d&    R V P                   4       F  '       g   K   RM	  RM! R V P                   4       4      '       d   \S        RV P6                   24       M \T        R,          R;;,          ^,          uu&   \V        PX                  ! V4       EM\Z        P\                  P^                  '       g:   ^ RI0H1p V! VV P                   V P"                  V
4      pVR JpV'       d   VV n        MR p\e        V4      pVe   VV n        VR J R	3V'       * R
3\Z        Pf                  '       * R3\h        ;QJ d    R V	 4       F  '       d   K   RM	  RM! R V	 4       4      R3.p\k        V4      p\m        VPn                  4      ^8w  d"   \q        R\m        VPn                  4       24      hVPr                  Pu                  R4      ;'       gd    VPn                  ^ ,           Uu. uFE  p\w        V\x        Pz                  P|                  P~                  4      '       d   VP€                  MR NKG  	  upp\ƒ        4       '       d   VPr                  Pu                  RR4      MRp V U!U"u. uF  w  p!p"V!'       d   K  V"NK  	  p#p!p"\…        \‡        VPˆ                  4      4      p$\‹        V$V\…        V 4      V#4      pVV n!        W°nF        WÐn'        WÀn&        V P�                  4        RV nH        \Z        P’                  V nJ        V P”                  '       dV   ^ R IKp%V%P™                  V4      p&V&Pˆ                  Pš                   F  p'V'Pr                  P�                  4        K  	  V&V nO        R # R #   + '       g   i     ELb; iu upi u up"p!i )Nr  Fc              3  ó8   "  € T F  p\        V4      x € K  	  R # 5irB   rè   ré   s   & r=   rš   Ú+CompiledFxGraph.__init__.<locals>.<genexpr>�  ó   é € ÐFÑ4E¨&”v˜f—~�~Ó4Eùrì   Trí   rÜ   Úcudagraph_skips)Ú3check_for_mutation_ignore_cuda_graph_managed_tensorzinput storage mutationzmutated inputsÚ$force_disable_cudagraph_TESTING_ONLYc              3  óž   "  € T FC  p\        V\        P                  \        P                  \        P                  \
        34      x € KE  	  R # 5irB   )r�   r‚   rƒ   rÍ   Ú	Generatorr	   )r˜   r}   s   & r=   rš   rX  ¼  sE   é € ð ñ &4 ô 'Ø !ä$)§L¡LÜ$)§L¡LÜ$)§O¡OÜ$3ð	!"÷ð ó &4ùs   ‚AAznon-Tensor inputsz+Expected output.args to have length 1, got Úoutput_stack_tracesrß   r;   )PrÂ   r6  rD   r8  Ú
cache_pathÚopenÚreadr:  r;  r<  rG  rH  r=  r%   rú   rÒ   r>  rã   r   rk   r.  rô   r   Úallocated_constant_namer?  r  r@  rû   rä   rB  rD  rE  rF  rï   r  ró   r  r   rÃ   r  rù   r   r
   r   rò   r'   rÄ   Ú cudagraph_support_input_mutationÚtorch._inductor.cudagraph_utilsr[  r   r\  r£   r!   r  Úargsr    ÚmetaÚgetr�   r‚   ÚfxÚnodeÚNodeÚstack_tracer   r¡   r   rT  r   rJ  Ú'_set_compile_context_for_autotune_cacherK  Úwrap_inductor_compiled_regionsrM  ÚcopyÚdeepcopyÚnodesÚclearrP  )(rC   rÂ   rT  r%  r@  rû   rB  rD  rÖ   ri   rÞ   rJ  rÃ   r  r;  r<  r6  rG  rH  Úfrý   rþ   Ústorage_mutation_inforï   r[  Úhas_mutation_strÚhas_mutationÚstorage_mutation_reasonÚcudagraph_testsÚoutputÚargrá   rß   Úbrž   rð   râ   ro  Úgm_copyrj  s(   &&&&&&&&&&&&&&&&&&&                     r=   r*  ÚCompiledFxGraph.__init__>  s-  € ð* !1ÔØ"4ˆÔð "Ò-ð ×4Ò4àð 	Ô"ð
 Ÿ™ˆŒØ××ÐÜ�e×&Ñ&×'Ô'¨1Ø#$§6¡6£8�Ô ÷ (à"4ÔØ,HÔ)Ø/NˆÔ,Ø4XˆÔ1Ø"×0Ñ0ˆÔä& u×'9Ñ'9Ó:ˆÔÜ% e×&7Ñ&7Ó8ˆÔÜ(¨×)=Ñ)=Ó>ˆÔÜ",¨U×-EÑ-EÓ"FˆÔô ! ×$Ò$Ø"Ÿ_™_ˆDŒNØ&(ˆDÕ#àˆDŒNØ&(ˆDÔ#ØŸ™×-Ñ-Ö/‘��1Ü" 1×%Ò%Ø16×1NÑ1NÈqÕ1Q�D×+Ñ+¨AÓ.à()�D—N‘N 1Ó%ñ	 0ð $)×#<Ñ#<ˆÔ Ø).×)HÑ)HˆÔ&Ø,ÔØ*DÔ'Ø%*×%@Ñ%@ˆÔ"Ø,ÔØ,ÔØˆÔØ#ˆÔØ"ˆÔØ#×2Ñ2ˆÔÜ'.¨uÐ6OÐQVÓ'WˆÔ$Ü ?ÀÓ CÐØˆŒØ!ˆÔàˆßˆ:à×.×.Ð.ß“3ÑF°D×4EÒ4EÓF—3—3’3ÑF°D×4EÒ4EÓF×FÒFÜ7Ø5°d×6UÑ6UÐ5VÐWõô ˜ZÕ(Ð):×;¸qÕ@Ó;Ü×!Ò! *Ö-ä—}‘}×E×EÐEõñ
 LØØ ×/Ñ/Ø ×3Ñ3Ø-ó	ð %ð $4¸4Ð#?�Lç#Ø:J˜Ô7øð $(�Lä*KØ)ó+Ð'ð +Ò6Ø6M�DÔ3ð -°Ð4Ð6NÐOØ%Ô%Ð'7Ð8ä"×GÑGÔGØ>ð÷
 ›ñ ñ &4óŸŸšñ ñ &4óó ð ,ðð#�ô. % R›�ä�v—{‘{Ó# qÔ(Ü(ØEÄcÈ&Ï+É+ÓFVÐEWÐXóð ð  &Ÿ{™{Ÿ™Ð/DÓE÷  ð  à%Ÿ{™{¨1ž~óJá-˜ô )3°3¼¿¹¿¹×8JÑ8J×(KÒ(K�S—_’_ÐQUÒUÙ-ñJ�ô G×HÒHð —K‘K—O‘OÐ$>ÀÔCàð )ñ
 9HÔ)Q¹±°°1Ìq¯!¨!¹Ð&Ñ)QÜ$Ô%9¸"¿(¹(Ó%CÓD�Ü!4Ø Ø ÜÐ2Ó3Ø*ó	"�ð -ˆÔØ#6Ô Ø.ÔØ"ŒØ×4Ñ4Ô6ð  ˆÔô '-×&KÑ&KˆÔ#à×&×&Ð&ó à—m‘m BÓ'ˆGØŸ™×+Ô+�Ø—	‘	—‘Ö!ñ ,à 'ˆDÖñ '÷o (×'Ð'üòpJùó *Rs   Á%WÑAW(ÓW-Ó(W-×W%	c               ó   € V ^8„  d   QhRR/# rb   r;   )r<   s   "r=   r>   rU  þ  s   € ÷ 3ñ 3˜ñ 3r@   c                	ó>   € V P                   e   V P                   =R # R # rB   )r6  r5   rd   s   &r=   Ú__del__ÚCompiledFxGraph.__del__þ  s!   € Ø×"Ñ"Ò.ð ×'Ñ'Ò2ñ /r@   c               ó   € V ^8„  d   QhRR/# rb   r;   )r<   s   "r=   r>   rU    s   € ÷ 
ñ 
¸ñ 
r@   c                	óˆ   € \         P                  ! 4       p\        P                  ! V4      '       d
   VV n        R # R V n        R # rB   )r   Útry_getr(   Úhas_active_compilerO  )rC   Ú"compile_context_for_autotune_caches   & r=   rm  Ú7CompiledFxGraph._set_compile_context_for_autotune_cache  sC   € Ü-;×-CÒ-CÓ-EÐ*ô $×6Ò6Ø2÷ò ð /ð 	Öð
 ð 	Ör@   c               ó    € V ^8„  d   QhRRRR/# rV   r;   )r<   s   "r=   r>   rU    s   € ÷ 7-ñ 7-˜}ð 7-°ñ 7-r@   c           	     	óÌ  € V P                   f   \        R4      h\        P                  P                  P
                  '       dÖ   \        P                  P                  P                  e°   V P                  P                  R4      pVeZ   \        P                  P                  P                  e4   \        P                  P                  P                  P                  V4      MR p\        P                  P                  P                  P                  RV/4       V P                  p\        P                  ! V4      pV'       d   \        V4      M\        P                   ! 4       p T;_uu_ 4         \        P"                  P$                  P&                  '       dÌ   \        P(                  P*                  P-                  RV P.                   R2RR/R7      ;_uu_ 4        V P                  V4      uuR R R 4       \1        4       P3                  4        V'       d   \        P4                  ! 4        uuR R R 4       V'       d&   \        P                  ! V4      '       g	   R V n        # # # V P                  V4      \1        4       P3                  4        V'       d   \        P4                  ! 4        uuR R R 4       V'       d&   \        P                  ! V4      '       g	   R V n        # # #   + '       g   i     M; i \1        4       P3                  4        T'       d   \        P4                  ! 4        M;  \1        4       P3                  4        T'       d   \        P4                  ! 4        i i ; iR R R 4       M  + '       g   i     M; iT'       d(   \        P                  ! T4      '       g
   R T n        R # R # R #   T'       d&   \        P                  ! T4      '       g	   R T n        i i i ; i)	Nz&self.current_callable must not be NoneÚgraph_idÚ
compile_idz## Call CompiledFxGraph z ##ÚscopeÚ
user_scope)Úkeyword_values)rÂ   r    r‚   rÇ   ÚdebugÚRECORD_GRAPH_EXECUTIONÚGRAPH_EXECUTION_ORDERrÃ   rh  ÚGRAPH_COMPILE_IDSr  rO  r(   r…  r   Ú
contextlibÚnullcontextÚautogradÚprofilerÚ_is_profiler_enabledÚ_CÚ	_profilerÚ_RecordFunctionFastrR   r   ÚfinishÚend_compile)rC   rW   rŠ  r‹  r†  Ú!has_active_autotune_cache_bundlerÚautotune_cache_contexts   &&     r=   r^   ÚCompiledFxGraph.__call__  s  € Ø× Ñ Ò(Ü Ð!IÓJÐJô �O‰O×!Ñ!×8×8Ð8Ü—‘×%Ñ%×;Ñ;ÒGà—~‘~×)Ñ)¨*Ó5ˆHð Ò'Ü—O‘O×)Ñ)×;Ñ;ÒGô —‘×%Ñ%×7Ñ7×;Ñ;¸HÔEð ð	 ô �O‰O×!Ñ!×7Ñ7×>Ñ>à  *ðôð
 .2×-BÑ-BÐ*Ü,@×,SÒ,SØ.ó-
Ð)÷
 1ô Ð>Ô?ä×'Ò'Ó)ð 	ð	-ß'Ò'ð;ä—~‘~×.Ñ.×C×CÐCÜ"ŸX™X×/Ñ/×CÑCØ6°t×7OÑ7OÐ6PÐPSÐTØ,3°\Ð+Bð D÷ õ ð $(×#8Ñ#8¸Ó#@÷	ñ ô 0Ó1×8Ñ8Ô:ß8Ü,×8Ò8Ô:÷ (Ñ'÷" 2Ü,×?Ò?Ø6÷ò ð )-�Õ%ð	ð 2ð  $×4Ñ4°VÓ<ä/Ó1×8Ñ8Ô:ß8Ü,×8Ò8Ô:÷ (Ñ'÷" 2Ü,×?Ò?Ø6÷ò ð )-�Õ%ð	ð 2÷÷ úð ô 0Ó1×8Ñ8Ô:ß8Ü,×8Ò8Ô:ùô 0Ó1×8Ñ8Ô:ß8Ü,×8Ò8Õ:ð 9ú÷ (×'×'Ð'ú÷" 2Ü,×?Ò?Ø6÷ò ð )-�Ö%ñ	ñ 2ø×1Ü,×?Ò?Ø6÷ò ð )-�Õ%ð	ð 2úsy   Å$
N4 Å.M0Å0A-L,ÇK"	Ç.
L,Ç85M0È-
N4 É%L,É55M0Ê*
N4 Ë"K2Ë-L,Ë66M0Ì,8M$Í$M0Í'	N4 Í0N 	Í;N4 Î4$O#Ï
O#c               ó(   € V ^8„  d   QhRRRRRRRR/# rh   r;   )r<   s   "r=   r>   rU  J  s8   € ÷ X5ñ X5à+ðX5ð ,ðX5ð 'ð	X5ð
 
ñX5r@   c                óü  a aaa€ \         P                  '       dÆ   \        P                  '       d°   S P                  f   \        R4      hS P                  f   \        R4      h\        S P                  P                  4      p\        V4       Uu. uF  p\        WE4      NK  	  pp\        P                  oV Uu. uF  pV3V3R llNK  	  ppS P	                  V4       R# \        VS 4       VR,          f   \        R4      hVR,          f   \        R4      hVR,          p	VR,          p
\         P                  pVeN   VP                  S 4      '       g7   \        R	,          R
;;,          ^,          uu&   \        P                   ! V
4       V
'       Ed>   S P"                  '       dŸ   \$        ;QJ d&    R S P&                   4       F  '       g   K   RM	  RM! R S P&                   4       4      '       d   \)        RS P"                   24       M \        R	,          R
;;,          ^,          uu&   \        P                   ! V
4       M�V	'       d   RV9  d   \        R4      hVR,          pMVP+                  RR4      p\         P                  '       d$   Vf    \-        VS V
VP/                  S 4      V4       M\1        VS V
VP/                  S 4      V4       S P2                  p\5        V
S VS P6                  4       S P8                  fŒ   S P:                  e~   ^ RIHp ^ RI H!p ^ RI"H#p V! RV! 4       R7      p\I        \J        PL                  PN                  VPQ                  S P:                  V4      4      pVPS                  4        VS n        RS n        S PT                  '       dS   S PV                  eC   ^ RI,H-p S PV                  oV! SS P8                  S P\                  R7      oVVV 3R lpVS n+        R# R# R# u upi u upi )a_  
Run a set of post processing steps after loading from the cache. These involve:
 - Setting the tracing context output strides
 - Running cudagraphs if enabled
 - Realigning inputs

This runs whether or not we have a cache hit, and always runs directly after we get a CompiledFxGraph.
The results of this function are *not* saved in the cache itself.
Nz+self.recursively_apply_fns must not be Nonez(self.compiled_fn_runner must not be Nonec                ó   <€ S! W4      # rB   r;   )rs  ÚmÚcustomized_wrappers   &&€r=   Ú<lambda>Ú.CompiledFxGraph.post_compile.<locals>.<lambda>f  s   ø€ Ñ&8¸Ô&>r@   rÖ   z+graph_kwargs['cudagraphs'] must not be Noner¶   z,graph_kwargs['is_backward'] must not be NonerÜ   rZ  c              3  ó8   "  € T F  p\        V4      x € K  	  R # 5irB   rè   ré   s   & r=   rš   Ú/CompiledFxGraph.post_compile.<locals>.<genexpr>ƒ  rY  rì   TFrí   r²   z5Expected 'boxed_forward_device_index' in graph_kwargs)ÚFakeTensorMode©ÚGraphPickler)ÚShapeEnv)Úallow_non_fake_inputsÚ	shape_env)ÚInductorCompiledCallable)rJ  c                óŠ   <€ \        4       '       d,   SP                  e   RSP                  /M/ p\        SV 3/ VB # S! V 4      # )Nr/  )r&   rJ  r   )rW   ÚkwargsÚinductor_callableÚoriginal_callablerC   s   & €€€r=   Úwrapped_callableÚ6CompiledFxGraph.post_compile.<locals>.wrapped_callable×  sR   ø€ Ü,×.Ò.ð  ×3Ñ3Ò?ð   ×!9Ñ!9Ñ:àð ô
 2Ð2CÀVÑVÈvÑVÐVá,¨VÓ4Ð4r@   )/r'   Úgraph_partitionr   ÚwrapperrD   r    r6  r  r5   r„   r   r"   r÷   Úshould_wrapr
   r   rò   rû   rù   rú   r   rh  r  r   r  r  r  rã   rP  rR  Útorch._subclassesr©  Útorch.fx._graph_picklerr«  Ú%torch.fx.experimental.symbolic_shapesr¬  r   r‚   ri  ÚGraphModuleÚloadsÚ	recompilerM  rÂ   Útorch._higher_order_ops.wrapr¯  rJ  )rC   ri   rk   rm   Únum_partitionsrˆ   Úwrapper_metadatasÚmetadataÚ!customized_wrappers_with_metadatar¶   rÖ   r  r²   r  r©  r«  r¬  Ú	fake_modeÚoriginal_gmr¯  r´  r¤  r²  r³  s   f&&&                 @@@r=   rp   ÚCompiledFxGraph.post_compileJ  sž  û€ ô ×!×!Ð!Ô&L×&T×&TÐ&Tà×)Ñ)Ò1Ü$Ð%RÓSÐSØ×&Ñ&Ò.Ü$Ð%OÓPÐPÜ  ×!8Ñ!8×!CÑ!CÓDˆNô ˜~Ô.ó!á.�Aô )¨Ö;Ù.ð ð !ô "H×!OÑ!OÐñ !2ó1á 1�Hð %×>Ñ>Ù 1ð .ð 1ð ×&Ñ&Ð'HÔIÙä*¨>¸4Ô@Ø˜Õ%Ò-Ü Ð!NÓOÐOØ˜Õ&Ò.Ü Ð!OÓPÐPØ" =Õ1ˆØ ,¨\Õ :ˆ
ô ×(Ñ(ˆØÒ f×&8Ñ&8¸×&>Ò&>Ü�ZÕ Ð!2×3°qÕ8Ó3Ü×Ò˜jÔ)çˆ:ð ×.×.Ð.ß“3ÑF°D×4EÒ4EÓF—3—3’3ÑF°D×4EÒ4EÓF×FÒFÜ7Ø5°d×6UÑ6UÐ5VÐWõô ˜ZÕ(Ð):×;¸qÕ@Ó;Ü×!Ò! *Õ-çØ3¸<ÔGÜ,ØSóð ð 2>Ø4õ2Ñ.ð 2>×1AÑ1AØ4°dó2Ð.ô ×)×)Ð)¨fªnô 5Ø&ØØ"Ø!×(Ñ(¨Ó.Ø2õô +Ø&ØØ"Ø!×(Ñ(¨Ó.Ø2ôð ×.Ñ.ˆô 	ØØØØ×#Ñ#ô		
ð ×ÑÒ$¨×)EÑ)EÒ)QÝ8Ý<ÝFá&Ø&*Ù"›*ôˆIô Ü—‘×$Ñ$Ø×"Ñ" 4×#?Ñ#?ÀÓKóˆKð ×!Ñ!Ô#Ø +ˆDÔØ+/ˆDÔ(ð ×&×&Ð&¨4×+@Ñ+@Ò+LÝMà $× 5Ñ 5Ðá 8Ø!Ø×!Ñ!Ø$(×$<Ñ$<ô!Ð÷	5ð %5ˆDÖ!ñ- ,MÑ&ùòY!ùò
1s   ÂO4Â9O9c               ó    € V ^8„  d   QhRRRR/# rs   r;   )r<   s   "r=   r>   rU  ä  s   € ÷ ,ñ ,¨sð ,°tñ ,r@   c                	ó   € Wn         R # rB   )rL  rv   s   &&r=   rw   Ú!CompiledFxGraph.set_triton_bundleä  s   € Ø+Ör@   c               ó   € V ^8„  d   QhRR/# rb   r;   )r<   s   "r=   r>   rU  ç  s   € ÷ %ñ %¨4ñ %r@   c                	óÌ   € R V n         R V n        R V n        R V n        V P                  e:   ^ RIHpHp VP                  V P                  V! R R7      4      V n	        R V n        R # R # )N©r«  ÚOptions)Ú
ops_filter)
rO  rÂ   rD   r6  rP  rº  r«  rÍ  ÚdumpsrR  )rC   r«  rÍ  s   &  r=   re   Ú)CompiledFxGraph.prepare_for_serializationç  se   € ð
 !%ˆÔØ $ˆÔØ%)ˆÔ"Ø"&ˆÔØ×ÑÒ(ßEà+7×+=Ñ+=Ø×!Ñ!¡7°dÔ#;ó,ˆDÔ(ð !%ˆDÖñ )r@   c               ó   € V ^8„  d   QhRR/# )r7   r9   r7  r;   )r<   s   "r=   r>   rU  ú  s   € ÷ ñ ˜sñ r@   c                	ó  € ^ RI Hp ^ RIHpHp V! V P
                  R4      ^,          pV P                  p\        P                  P                  V4      '       g'   VR,          R;;,          ^,          uu&   V! WERR7       V# )r�   )r
   )Úget_pathÚwrite_atomicÚpyrÜ   Úfxgraph_lookup_write_fileT)Ú	make_dirs)
Útorch._dynamo.utilsr
   Útorch._inductor.codecacherÓ  rÔ  r8  r:  ÚosÚpathÚexists)rC   r
   rÓ  rÔ  Úartifact_pathÚcodes   &     r=   Úwrite_to_diskÚCompiledFxGraph.write_to_diskú  sc   € Ý0ßDñ ! §¡°Ó6°qÕ9ˆØ×ÑˆÜ�w‰w�~‰~˜m×,Ò,Ø�ZÕ Ð!<×=ÀÕBÓ=Ù˜¸Õ=ØÐr@   c               ó    € V ^8„  d   QhRRRR/# )r7   rk   rl   r9   r7  r;   )r<   s   "r=   r>   rU    s   € ÷ ñ Ð/Gð ÈCñ r@   c           
     	óÂ  € ^ RI Hp ^ RIHp V P	                  4       p V! RRR7      ;_uu_ 4        VP                  V P                  VV P                  VP                  V 4      4      pVP                  V n
        \        VRR4      V n        \        VRR4      V n        RRR4       V#   + '       g   i     T# ; i  \         d    \        P!                  R	T4       h i ; i)
r�   )Údynamo_timed)ÚPyCodeCachezPyCodeCache.load_by_key_pathT)Úlog_pt2_compile_eventrD   NÚrunnerzFailed to load artifact: %s)rØ  rã  rÙ  rä  rß  Úload_by_key_pathr8  r=  r   ÚcallrÂ   ró   rD   r6  ÚOSErrorÚlogÚerror)rC   rk   rã  rä  rÝ  Ú
code_caches   &&    r=   Úafter_deserializationÚ%CompiledFxGraph.after_deserialization  sÙ   € Ý4Ý9à×*Ñ*Ó,ˆð	ÙØ.Ø&*÷ö ð )×9Ñ9Ø—N‘NØ!Ø×&Ñ&Ø×$Ñ$ TÓ*ó	�
ð )3¯©�Ô%Ü-4ØÐ 7¸ó.�Ô*ô +2°*¸hÈÓ*M�Ô'÷ð& Ð÷'ö ð& Ðûô	 ô 	Ü�I‰IÐ3°]ÔCØð	ús)   žB; °A-B'ÂB; Â'B8	Â2B; Â8B; Â;#C)%rK  rO  r  rP  rR  rL  rM  r8  r=  rJ  r6  rk   rD  rï   rÂ   rÒ   rú   rû   rF  r.  rÃ   rE  r<  rG  rH  r  rä   rB  rã   r>  r  r@  r  rD   r;  r:  r?  )NNN)rF   rG   rH   rI   rJ   rK   ry   rz   r:  r;  r<  rK  rL  rM  r  rO  rP  rR  r*  r€  rm  r^   rp   rw   re   rß  rí  rL   r;   r@   r=   r±   r±     s�  ‡ ñð
 ,Ó+ØPÓPØ/Ó/ØƒNØ"×(Ò(¨eÔ4€K�Ó4Ø)×/Ò/°UÔ;Ð˜Ó;Ø(3×(9Ò(9Øô)Ð  #ó ð 0Ó/Ø!Ó!Ø Ó Ø#Ó#Ø'Ó'Ø-Ó-Ø&Ó&ØLÓLØ.Ó.ØBÓBØ *Ó*Ø/Ó/Ø Ó ð ÓØÓØ%/Ó/Ø*4Ó4ØÓà.Ó.Ø2Ó2Ø#Ó#ØÓØ"Ó"à#€K�Ó#Ø*.€NÐ'Ó.Ø#(Ð˜DÓ(Ø$)Ð˜TÓ)Ø.9×.?Ò.?Ø˜5 u°eô/ÐÐ+ó ð 15€LÐ-Ó4Ø,0Ð˜\Ó0÷~(õ@3õ
õ7-õrX5õt,õ%õ&÷ñ r@   r±   c                  óª   € ] tR tRt$ RtR]R&   R]R&   RtR]R	&   ]P                  ! ]	R
7      t
R]R&   R tR R ltR R ltR tR R ltR R ltRtR# )ÚCompiledAOTIi$  z+
Class holding an AOTInductor compiled so.
z0str | list[str | Weights] | torch.fx.GraphModuleÚfilenamer7  Údevice_typeNzCallable[..., Any] | NonerÂ   )Údefault_factoryzdict[str, bytes]Ú_cached_filesc                	ó  € \         P                  P                  '       g   R # \        P                  P
                  P                  '       g+   \        P                  P
                  P                  '       d   R # \         P                  P                  R8X  d   R # \         P                  P                  '       d   R # \         P                  '       g   R # \        V P                  \        4      '       d   \        R V P                   4       4      pMV P                  p\        V\        P                  P                   4      '       d	   Wn        R # V P$                  P'                  R4      '       dC   \        P(                  P*                  P-                  V^V P$                  RR4      P.                  pMÀV P$                  P'                  R4      '       dB   \        P(                  P*                  P1                  V^V P$                  R4      P.                  pM^V P$                  R8X  d6   \        P(                  P*                  P3                  V^4      P.                  pM\5        RV P$                   24      hWn        RV n        V P8                   Fi  p\:        P<                  P?                  V4      '       d   K*  \A        VR	4      ;_uu_ 4       pVPC                  V P8                  V,          4       R R R 4       Kk  	  R #   + '       g   i     K€  ; i)
NÚwindowsc              3  óˆ   "  € T F8  p\        V\        4      '       g   K  VP                  R 4      '       g   K4  Vx € K:  	  R# 5i)z.soN)r�   r7  Úendswith)r˜   Úfns   & r=   rš   Ú-CompiledAOTI.__post_init__.<locals>.<genexpr>C  s,   é € ð $Ù*�r¬j¸¼S×.A”ÀbÇkÁkÐRW×FX—’›]ùs   ‚AŸA¸
AÚcudaÚ TÚxpuÚcpuzunsupported device type Úwb)"r'   Úaot_inductorÚlink_libtorchr‚   rÇ   Úcpp_builderÚ	_IS_MACOSÚ_IS_WINDOWSÚcross_target_platformÚpackage_cpp_onlyÚenable_autograd_for_aotr�   rñ  ÚlistrÐ   ri  r¼  rÂ   rò  Ú
startswithr˜  Ú_aotiÚAOTIModelContainerRunnerCudaÚrunÚAOTIModelContainerRunnerXpuÚAOTIModelContainerRunnerCpuÚRuntimeErrorrK  rô  rÚ  rÛ  rÜ  ra  Úwrite)rC   rÂ   Úfilers  s   &   r=   Ú__post_init__ÚCompiledAOTI.__post_init__/  s2  € Ü×"Ñ"×0×0Ð0Ùô �O‰O×'Ñ'×1×1Ð1Ü�‰×*Ñ*×6×6Ð6áä×Ñ×4Ñ4¸	ÔAÙä×Ñ×/×/Ð/Ùä×-×-Ð-Ùä�d—m‘m¤T×*Ò*Ü#ñ $Ø!Ÿ]š]ó$ó  Ñð  $Ÿ}™}ÐäÐ&¬¯©×(<Ñ(<×=Ò=à$4Ô!Ùà×Ñ×&Ñ& v×.Ò.ä—‘—‘×;Ñ;Ø$ØØ×$Ñ$ØØó÷ ‘#ñ ð ×Ñ×(Ñ(¨×/Ò/ä—‘—‘×:Ñ:Ø$ØØ×$Ñ$Øó	÷
 ‘#ñ ð ×Ñ Ô&ä—‘—‘×:Ñ:Ø$ aóç‘#ñ ô Ð!9¸$×:JÑ:JÐ9KÐLÓMÐMØ 0ÔØˆÔØ×&Ô&ˆDÜ—7‘7—>‘> $×'Ô'Ü˜$ ×%Ô%¨Ø—G‘G˜D×.Ñ.¨tÕ4Ô5÷ &Ñ%ó 'ç%×%Ð%ús   Ë	#K:Ë:Lc               ó    € V ^8„  d   QhRRRR/# rV   r;   )r<   s   "r=   r>   ÚCompiledAOTI.__annotate__p  s   € ÷ -ñ -˜}ð -°ñ -r@   c                	óV   € V P                   f   \        R4      hV P                  V4      # )Nz%AOTInductor compiled so is not loaded)rÂ   r  r]   s   &&r=   r^   ÚCompiledAOTI.__call__p  s+   € Ø× Ñ Ò(ÜÐFÓGÐGØ×$Ñ$ VÓ,Ð,r@   c               ó   € V ^8„  d   QhRR/# rb   r;   )r<   s   "r=   r>   r  u  s   € ÷ 
4ñ 
4¨4ñ 
4r@   c                	óˆ  € R V n         / V n        . p\        V P                  \        4      '       d   V P                  pM-\        V P                  \
        4      '       d   V P                  .pV F=  p\        VR4      ;_uu_ 4       pVP                  4       V P                  V&   R R R 4       K?  	  R #   + '       g   i     KT  ; i)NÚrb)rÂ   rô  r�   rñ  r  r7  ra  rb  )rC   Ú	filenamesr/  rs  s   &   r=   re   Ú&CompiledAOTI.prepare_for_serializationu  sŽ   € Ø $ˆÔØˆÔØ!ˆ	Ü�d—m‘m¤T×*Ò*ØŸ™‰IÜ˜Ÿ™¤s×+Ò+ØŸ™˜ˆIÛˆDÜ�d˜D×!Ô! QØ+,¯6©6«8�×"Ñ" 4Ñ(÷ "Ñ!ó ß!×!Ð!ús   ÂB0Â0Cc                	óD   € V P                   P                  4       pR VR&   V# )NrÂ   )Ú__dict__ro  )rC   Ústates   & r=   Ú__getstate__ÚCompiledAOTI.__getstate__�  s$   € Ø—‘×"Ñ"Ó$ˆØ$(ˆÐ Ñ!Øˆr@   c               ó(   € V ^8„  d   QhRRRRRRRR/# rh   r;   )r<   s   "r=   r>   r  †  s2   € ÷ !ñ !à+ð!ð ,ð!ð 'ð	!ð
 
ñ!r@   c                	óF   € V P                   f   V P                  4        R # R # rB   )rÂ   r  ro   s   &&&&r=   rp   ÚCompiledAOTI.post_compile†  s!   € ð × Ñ Ò(Ø×ÑÖ ñ )r@   c               ó    € V ^8„  d   QhRRRR/# rs   r;   )r<   s   "r=   r>   r  �  ó   € ÷ ñ ¨sð °tñ r@   c                	ó   € R # rB   r;   rv   s   &&r=   rw   ÚCompiledAOTI.set_triton_bundle�  ó   € Ùr@   )rK  rô  rÂ   )rF   rG   rH   rI   rJ   rK   rÂ   ry   rz   rõ   rô  r  r^   re   r   rp   rw   rL   r;   r@   r=   rð  rð  $  s[   ‡ ñð ?Ó>ØÓØ26ÐÐ/Ó6Ø&1×&7Ò&7ÈÔ&M€MÐ#ÓMò?6õB-õ

4òõ
!÷ñ r@   rð  c                  óV   € ] tR tRt$ RtR]R&   R R ltR R ltR	 R
 ltR R lt	Rt
R# )ÚMockFXGraphCacheOutputi“  Nr   r%  c               ó   € V ^8„  d   QhRR/# rb   r;   )r<   s   "r=   r>   Ú#MockFXGraphCacheOutput.__annotate__—  s   € ÷  ñ  ˜tñ  r@   c                	ó   € R V n         R# )TN©rK  rd   s   &r=   r  Ú$MockFXGraphCacheOutput.__post_init__—  s
   € ØˆÖr@   c               ó(   € V ^8„  d   QhRRRRRRRR/# rh   r;   )r<   s   "r=   r>   r-  š  s2   € ÷ ñ à+ðð ,ðð 'ð	ð
 
ñr@   c                	ó   € R # rB   r;   ro   s   &&&&r=   rp   Ú#MockFXGraphCacheOutput.post_compileš  s   € ñ 	r@   c               ó    € V ^8„  d   QhRRRR/# rV   r;   )r<   s   "r=   r>   r-  ¢  s   € ÷ ñ ˜}ð °ñ r@   c                	ó$   € V P                  V4      # rB   r)  r]   s   &&r=   r^   ÚMockFXGraphCacheOutput.__call__¢  s   € Ø�w‰w�v‹Ðr@   c               ó    € V ^8„  d   QhRRRR/# rs   r;   )r<   s   "r=   r>   r-  ¥  r&  r@   c                	ó   € R # rB   r;   rv   s   &&r=   rw   Ú(MockFXGraphCacheOutput.set_triton_bundle¥  r)  r@   r/  )rF   rG   rH   rI   r%  rK   r  rp   r^   rw   rL   r;   r@   r=   r+  r+  “  s$   ‡ à€BˆƒNõ õõ÷ñ r@   r+  c                  ó²   a € ] tR tRt$ RtRtR]R&   RtR]R&   RtR]R	&   ]	]
3R
 V 3R llltR R lt]R 4       tR R ltR R ltR R ltR R ltRtV ;t# )ÚRegionalOutputCodei©  aÐ  
OutputCode for regional inductor compilation results.

Regional inductor returns a torch.fx.GraphModule that contains both
compiled regions (via standalone_compile) and eager regions. This needs
special serialization using GraphPickler instead of standard pickle.

The serialization strategy stores the GraphModule as bytes using
GraphPickler.dumps(), which handles FakeTensors, AOTCompiledArtifacts,
and other special objects that standard pickle cannot handle.
NrQ  Ú_serialized_graph_moduleztorch.nn.Module | NoneÚ_graph_moduleúCallable[[str], bool] | NoneÚ_ops_filterc               ó$   € V ^8„  d   QhRRRRRR/# )r7   Úgraph_moduler&  rÎ  zCallable[[str], bool]Únode_metadata_key_filterr>  r;   )r<   s   "r=   r>   ÚRegionalOutputCode.__annotate__À  s-   € ÷ Bñ Bà*ðBð *ðBð #?ñ	Br@   c                ó$  <€ \         SV `  4        Wn        RV n        . V n        RV n        V P                  4       w  rE\        VP                  P                  \        P                  P                  P                  4      V n        W n        W0n        R# )zë
Args:
    graph_module: The torch.fx.GraphModule returned by regional_inductor
    ops_filter: Optional filter function for op names during serialization.
        If provided, only ops whose name passes the filter will be serialized.
NT)Úsuperr*  r=  r<  Ú_serialized_wrappersrK  Ú_unwrap_graph_moduler�   rT  Ú_codegenr‚   ri  Ú_BoxedCodeGenÚ_inner_boxed_callr?  Ú_node_metadata_key_filter)rC   rA  rÎ  rB  Ú_ÚmoduleÚ	__class__s   &&&&  €r=   r*  ÚRegionalOutputCode.__init__À  sv   ø€ ô 	‰ÑÔØ)ÔØ(,ˆÔ%Ø$&ˆÔ!ØˆÔØ×-Ñ-Ó/‰	ˆÜ!+Ø�L‰L×!Ñ!¤5§8¡8§>¡>×#?Ñ#?ó"
ˆÔð &ÔØ)AÖ&r@   c               ó    € V ^8„  d   QhRRRR/# )r7   rW   z	list[Any]r9   r   r;   )r<   s   "r=   r>   rC  Ú  s   € ÷ +ñ +˜yð +¨Sñ +r@   c                óš   € V P                   f   \        R4      hV P                  '       d   V P                  V4      # V P                   ! V!  # )a$  
Execute the regional compiled graph.

Args:
    inputs: A mutable list of inputs. Must be a list (not an arbitrary
        Sequence) because the boxed calling convention allows the callee
        to mutably clear the list when inputs become dead, enabling early
        memory deallocation.
zURegionalOutputCode has no graph module loaded. Did you forget to call post_compile()?)r=  r  rJ  r]   s   &&r=   r^   ÚRegionalOutputCode.__call__Ú  sR   € ð ×ÑÒ%Üð9óð ð
 ×!×!Ð!Ø×%Ñ% fÓ-Ð-Ø×!Ò! 6Ñ*Ð*r@   c                	ó>   € V P                  4       w  rVP                  # rB   )rG  rT  )rC   rL  rM  s   &  r=   rT  ÚRegionalOutputCode.graphî  s   € à×-Ñ-Ó/‰	ˆØ�|‰|Ðr@   c               ó   € V ^8„  d   QhRR/# )r7   r9   zBtuple[list[tuple[Callable, dict[str, Any]]], torch.fx.GraphModule]r;   )r<   s   "r=   r>   rC  ó  s   € ÷ +ñ +à	Kñ+r@   c                	óF  € V P                   p. p\        V\        P                  P                  4      '       d§   VP
                  p\        V\        P                  P                  P                  4      '       g   \        R \        V4       24      hVP                  \        P                  P                  RVP                  RVP                  /34       VP                  p\        V\        P                  P                   4      '       g   \        R\        V4       24      hW!3# )zExpected DisableContext, got ÚreasonÚwrappingú#Expected torch.fx.GraphModule, got )r=  r�   r‚   Ú_dynamoÚOptimizedModuleÚ
dynamo_ctxÚ
eval_frameÚDisableContextr    r\   r  rò   ÚmsgrX  Ú	_orig_modri  r¼  )rC   rM  Úserialized_wrappersr\  s   &   r=   rG  Ú'RegionalOutputCode._unwrap_graph_moduleó  sç   € ð ×#Ñ#ˆØ ÐÜ�fœeŸm™m×;Ñ;×<Ò<Ø×*Ñ*ˆJÜ˜j¬%¯-©-×*BÑ*B×*QÑ*Q×RÒRÜ$Ð'DÄTÈ*ÓEUÐDVÐ%WÓXÐXØ×&Ñ&ä—M‘M×)Ñ)Ø˜zŸ~™~¨z¸:×;NÑ;NÐOðôð ×%Ñ%ˆFÜ˜&¤%§(¡(×"6Ñ"6×7Ò7Ü Ð#FÄtÈFÃ|ÀnÐ!UÓVÐVØ"Ð*Ð*r@   c               ó(   € V ^8„  d   QhRRRRRRRR/# rh   r;   )r<   s   "r=   r>   rC    s2   € ÷ # ñ # à+ð# ð ,ð# ð 'ð	# ð
 
ñ# r@   c                óÒ  € V P                   e   R# V P                  f   \        R4      h^ RIHp V! V4      pVf   \        R4      h^ RIHp VP                  V P                  V4      p\        V\        P                  P                  4      '       g   \        R\        V4       24      hVP                  4        \        V P                   4       F  w  r‰V! V3/ V	B pK  	  Wpn         R# )z 
Post-compile processing for regional inductor.

This deserializes the GraphModule from bytes using GraphPickler,
extracting the fake_mode from example_inputs.
Nz.self._serialized_graph_module must not be None)Údetect_fake_modeziCould not detect fake mode from example inputs. Regional inductor requires fake mode for deserialization.rª  rY  )r=  r<  r    Útorch._guardsre  r  rº  r«  r½  r�   r‚   ri  r¼  r\   r¾  ÚreversedrF  )
rC   ri   rk   rm   re  rÄ  r«  r%  rù  r±  s
   &&&&      r=   rp   ÚRegionalOutputCode.post_compile  sÑ   € ð ×ÑÒ)ÙØ×(Ñ(Ò0Ü Ð!QÓRÐRå2á$ ^Ó4ˆ	ØÒÜðLóð õ 	9à×Ñ × =Ñ =¸yÓIˆÜ˜"œeŸh™h×2Ñ2×3Ò3Ü Ð#FÄtÈBÃxÀjÐ!QÓRÐRØ
�‰ŒÜ" 4×#<Ñ#<Ö=‰JˆBÙ�BÑ!˜&Ñ!ŠBñ >àÖr@   c               ó    € V ^8„  d   QhRRRR/# rs   r;   )r<   s   "r=   r>   rC  ,  s   € ÷ Eñ E¨sð E°tñ Er@   c                ó   € R# )z6Regional inductor doesn't use triton bundles directly.Nr;   rv   s   &&r=   rw   Ú$RegionalOutputCode.set_triton_bundle,  s   ‚ r@   c               ó   € V ^8„  d   QhRR/# rb   r;   )r<   s   "r=   r>   rC  /  s   € ÷ &ñ &¨4ñ &r@   c                óê   € V P                   ee   ^ RIHpHp RV n        V P                  4       w  V n        pVP                  VV! V P                  V P                  R7      R7      V n        RV n         R# R# )zà
Prepare for serialization by converting the GraphModule to bytes.

This uses GraphPickler to serialize the graph module since it contains
special objects like FakeTensors and AOTCompiledArtifacts that need
custom pickling.
NrÌ  )rÎ  rB  )Úoptions)
r=  rº  r«  rÍ  r<  rG  rF  rÏ  r?  rK  )rC   r«  rÍ  rA  s   &   r=   re   Ú,RegionalOutputCode.prepare_for_serialization/  su   € ð ×ÑÒ)ßEà,0ˆDÔ)Ø6:×6OÑ6OÓ6QÑ3ˆDÔ% |à,8×,>Ñ,>ØÙØ#×/Ñ/Ø-1×-KÑ-Kôð -?ó -ˆDÔ)ð "&ˆDÖñ *r@   )rK  r=  rJ  rK  r?  r<  rF  )rF   rG   rH   rI   rJ   r<  rK   r=  r?  r$   r#   r*  r^   ÚpropertyrT  rG  rp   rw   re   rL   Ú__classcell__)rN  s   @r=   r;  r;  ©  sw   ø‡ ñ
ð .2Ð˜lÓ1ð -1€MÐ)Ó0ð 15€KÐ-Ó4ð
 -=à*÷Bò Bõ4+ð( ñó ðõ+õ(# õJE÷&ó &r@   r;  )gÚ__conditional_annotations__rJ   Ú
__future__r   r“  ry   ÚloggingrÚ  Ú	functoolsr   Útypingr   r   r   r   r   r‚   Útorch._custom_class_baser	   rØ  r
   r   rf  r   r   r¿  r   re  r   r   r   r   r   r   r   r   r   Útorch._inductor.freezing_utilsr   r   Útorch._inductor.utilsr   r   r   r   r   r   r    r!   r"   rº  r#   r$   Útorch.utils._ordered_setr%   Útorch.utils._python_dispatchr&   rü  r'   Úruntime.autotune_cacher(   Úcollectionsr)   Úcollections.abcr*   r+   Útorch._inductorr,   Útorch._inductor.graphr-   Ú"torch._library.fake_class_registryr.   Ú)torch.export.pt2_archive._package_weightsr/   rø   r0   Útriton_bundlerr1   rº   r2   rK   r4   Ú	getLoggerrF   rê  Ú	dataclassrN   r7  r{   r‰   r’   r®   rÉ   rÓ   r  r  r  rl   r#  r±   rð  r+  r;  )rr  s   @r=   Ú<module>r†     sÉ  øðôõ, #ã Û Û Û 	Ý ß @Õ @ã Ý 4ß Eß 9Ý ?÷
÷ 
õ 
÷ N÷
÷ 
õ 
÷ UÝ /Ý Bå Ý 8÷ Ý#ß2å'Ý3ÝCÝAå,Ý,ð
 !)¨(°9Õ*=Ð)>ÀÐ)FÕ G€N�IÓGô
X˜8ô 
Xð ×Ò˜Ó!€ð ×Ñ÷.ð .ó ð.ð>  €�	Ó õMõõõ0<õ@Oõ"bõJa;õH$W÷N>ñ >ô0MÐ%=ô Mð* ×Ñô]�jó ]ó ð]ð@ ×Ñôk�:ó kó ðkð\ ×Ñô˜Zó ó ðð* ×Ñô[&˜ó [&ó ò[&r@   