ó
    Eñi5G  ã                   óf  • S SK r S SKrS SKJr  S SKJr  S SKrS SKrS SKJ	s  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  S SKJr  S SKJr  S S	KJr  S S
KJr  \R>                  " \ 5      r!S\RD                  RF                  S\$\   S\%S\4S jr& " S S\RN                  5      r( " S S\5      r)g)é    N)ÚCallable)ÚAny)Úir)ÚKernelTemplate)ÚBufferÚFixedLayoutÚget_free_symbolsÚget_symbolic_inputsÚgm_original_output_stridesÚir_node_to_tensorÚLayout)Úbenchmarker)Údo_bench_using_profiling©ÚV)Ú
OrderedSetÚgmÚinputsÚnameÚreturnc                 óÜ   • SSK Jn  [        R                  R                  n U [        R                  l        U" X5      U[        R                  l        $ ! U[        R                  l        f = f)a  Inline a subgraph by converting its FX operations to individual IR nodes.

This converts a subgraph to multiple ComputedBuffer nodes (fusable),
enabling epilogue fusion with subsequent operations.

Returns:
    TensorBox containing the final operation result as individual IR nodes
r   )Úprocess_subgraph_nodes)Útorch._inductor.loweringr   r   ÚgraphÚmodule)r   r   r   r   Úoriginal_modules        Ú]/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torch/_inductor/codegen/subgraph.pyÚinline_subgraph_to_ir_nodesr      sF   € õ @ô —g‘g—n‘n€Oð)ØŒ�‰ŒÙ% bÓ1à(Œ�‰�ø˜Œ�‰�ús   ¢A ÁA+c                   ó¢  ^ • \ rS rSrSr SS\S\\   S\S\S\	S	\
4   S
\\\	\
/\R                  4   4   S-  SS4U 4S jjjrS\\   4S jrS\	S	\
4   S\\\
4   SS4S jrS\4S jrS\
4S jrS\\
   S\R                  S\4S jrS\\
   S\R                  SS4S jrS\4S jrS\R2                  4S jrS\\\
4   4S jrS\4S jrSrU =r$ )ÚSubgraphChoiceCalleré4   z–
Represents a Subgraph Autotuning choice, and the subgraph can be any arbitrary
GraphModule. Compiles the Subgraph down to a module for benchmarking.
Nr   Úinput_nodesÚlayoutÚdescriptionÚmake_fx_graph.Úinput_gen_fnsr   c           	      ó  >• [         T	U ]  XX45        / U l        [        R                     [        U R                  5       H¾  u  px[        [        UR                  5       SS95      S:X  d   e[        [        UR                  5       SS95      S:X  d   eUR                  R                  5         Ub*  Xv;   a%  U R                  R                  Xg   " U5      5        Mš  U R                  R                  [        U5      5        MÀ     S S S 5        U" U R                  6 U l        [!        U R                  5        [#        U R                  5      U l        U R'                  5       U l        S U l        0 U l        S U l        g ! , (       d  f       N|= f)NT)Úunbacked_onlyr   )ÚsuperÚ__init__Úexample_inputsr   Ú	fake_modeÚ	enumerater"   Úlenr	   Úget_sizeÚ
get_strideÚdataÚfreeze_layoutÚappendr   r   r   r
   Ú
sym_inputsÚ_compute_sym_input_valuesÚsym_input_valuesÚdecompositionÚdecomposition_kwargsÚ_compiled_module)
Úselfr   r"   r#   r$   r%   r&   ÚiÚinpÚ	__class__s
            €r   r*   ÚSubgraphChoiceCaller.__init__:   s<  ø€ ô 	‰Ñ˜¨FÔ@à ˆÔÜ�[‹[Ü# D×$4Ñ$4Ö5‘�äÔ+¨C¯L©L«NÈ$ÑOÓPÐTUÓUÐUÐUÜÔ+¨C¯N©NÓ,<ÈDÑQÓRÐVWÓWÐWÐWà—‘×&Ñ&Ô(ð !Ñ,°Ó1CØ×'Ñ'×.Ñ.¨}Ò/?ÀÓ/DÖEà×'Ñ'×.Ñ.Ô/@ÀÓ/EÖFñ 6÷ ñ   ×!4Ñ!4Ð5ˆŒÜ" 4§7¡7Ô+ä-¨d×.>Ñ.>Ó?ˆŒØ $× >Ñ >Ó @ˆÔð 9=ˆÔØ46ˆÔ!à%)ˆÕ÷3 �[ús   ©CE7Å7
Fc           	      ó²  • [        U R                   Vs/ s H"  n[        US5      (       d  M  UR                  PM$     sn5      n0 n[	        U R
                  U R                  5       H³  u  pE[        U[        R                  5      (       d  M&  [	        UR                  5       UR                  5       He  u  pg[        U[        R                  5      (       a  [        U5      X6R                  '   M=  [        U5      U;   d  MN  [        U5      U[        U5      '   Mg     Mµ     / nU R                   H£  n	[        U	[        R                  5      (       a/  U	R                  U;   a  UR!                  X9R                     5        MQ  ["        R$                  R&                  R(                  R+                  U	5      n
UR!                  U
b  [        U
5      OS5        M¥     U$ s  snf )a  Extract concrete dimension values for sym_inputs from example_inputs.

The compiled module expects symbolic dimension values as runtime arguments.
This maps each symbolic variable to its concrete value from the example tensors.
Used for range based autotuning.
r   é   )r   r4   Úhasattrr   Úzipr"   r+   Ú
isinstanceÚtorchÚTensorr/   ÚshapeÚsympyÚSymbolÚintÚstrr3   r   r   ÚsizevarsÚ	shape_envÚ	size_hint)r:   ÚsÚsym_input_namesÚsym_name_to_valueÚinp_nodeÚexample_inpÚsym_dimÚ
actual_dimÚresultÚsym_varÚhints              r   r5   Ú.SubgraphChoiceCaller._compute_sym_input_valuesa   s\  € ô %Ø!Ÿ_š_ÓCš_˜´¸¸6×0B‹VˆQ�VŒV™_ÑCó
ˆð
 -/ÐÜ%(¨×)9Ñ)9¸4×;NÑ;NÖ%OÑ!ˆHÜ˜+¤u§|¡|×4Ó4Ü+.¨x×/@Ñ/@Ó/BÀK×DUÑDUÖ+VÑ'�GÜ! '¬5¯<©<×8Ñ8Ü:=¸j»/Ð)¯,©,Ó7Ü˜W›¨Õ8Ü:=¸j»/Ð)¬#¨g«,Ó7ó	 ,Wñ &Pð ˆØ—”ˆGÜ˜'¤5§<¡<×0Ñ0°W·\±\ÐEVÓ5VØ—‘Ð/·±Ñ=Ö>ä—w‘w×'Ñ'×1Ñ1×;Ñ;¸GÓD�Ø—‘¨4Ñ+;œc $œiÀÖCñ 'ð ˆùò) Ds
   ”G­Gr7   Úkwargsc                 ó   • Xl         X l        g)zHCache decomposition function and kwargs for range-based dispatch lookup.N)r7   r8   )r:   r7   rY   s      r   Úcache_decompositionÚ(SubgraphChoiceCaller.cache_decomposition   s   € ð +ÔØ$*Õ!ó    c                 ó"   • SU R                    S3$ )NzSubgraphCaller(Ú)©r   ©r:   s    r   Ú__str__ÚSubgraphChoiceCaller.__str__†   s   € Ø  §¡ ¨1Ð-Ð-r]   c                 óš  • SSK Jn  U R                  R                  SS5      R                  SS5      nU" U R                  U R
                  [        R                  R                  [        R                  R                  [        R                  R                  [        R                  R                  [        R                  R                  [        R                  R                  SU 3S9	nU R                   H@  nXCR                  UR                  '   UR                   R#                  UR                  5        MB     [        R$                  " U5         [&        R(                  " SSS	S
9   UR*                  " U R
                  6   UR-                  5       sSSS5        sSSS5        $ ! , (       d  f       O= f SSS5        g! , (       d  f       g= f)zCCompile the subgraph for benchmarking, returns the compiled module.r   )ÚGraphLoweringz::Ú_Ú.Ú
benchmark_)	r   r+   rL   Úcpp_wrapperÚaot_modeÚextern_node_serializerÚis_inferenceÚis_backwardr   FÚATEN)Úmax_autotuneÚmax_autotune_gemmÚmax_autotune_gemm_backendsN)Útorch._inductor.graphre   r   Úreplacer   r+   r   r   Ú
_shape_envri   rj   rk   rl   rm   r4   Úgraph_inputsÚgraph_input_namesr3   Úset_graph_handlerÚconfigÚpatchÚrunÚcompile_to_module)r:   re   Ú	safe_nameÚbm_graph_loweringÚsym_inps        r   Ú_compile_for_benchmarkingÚ.SubgraphChoiceCaller._compile_for_benchmarking‰   sK  € å7à—I‘I×%Ñ% d¨CÓ0×8Ñ8¸¸cÓBˆ	á)Ø�w‰wØ×.Ñ.Ü—g‘g×(Ñ(ÜŸ™×+Ñ+Ü—W‘W×%Ñ%Ü#$§7¡7×#AÑ#AÜŸ™×-Ñ-ÜŸ™×+Ñ+Ø˜i˜[Ð)ñ

Ðð —”ˆGØ;B×*Ñ*¨7¯<©<Ñ8Ø×/Ñ/×6Ñ6°w·|±|ÖDñ 'ô × Ò Ð!2Õ3ä—’Ø"Ø"'Ø+1óð
 "×%Ò% t×':Ñ':Ñ;Ø(×:Ñ:Ó<÷ð ÷ 4Ñ3÷õ úð ÷ 4×3Ö3ús$   ÅF<Å%)F!Æ	F<Æ!
F/	Æ+F<Æ<
G
ÚargsÚoutc                ó>  ^^^• U R                   c  U R                  5       U l         U R                   R                  mU R                  m[        R
                  (       a  [        UUU4S j5      $ [        R                  " UUU4S j[        R                  " / TQTQ76 S9$ )zBRegular benchmarking: compile and use benchmarker with warmup/rep.c                  ó   >• T" / TQT Q5      $ ©N© ©r�   Úbm_funcr4   s   €€€r   Ú<lambda>Ú0SubgraphChoiceCaller.benchmark.<locals>.<lambda>±   s   ø€ ±GÐ<P¸jÐ<PÈ4Ð<PÔ4Qr]   c                  ó   >• T" / TQT Q5      $ r…   r†   r‡   s   €€€r   r‰   rŠ   ´   s   ø€ ‘GÐ0˜jÐ0¨4Ð0Ô1r]   )Údevice)
r9   r   Úcallr6   rx   Ú/profile_bandwidth_with_do_bench_using_profilingr   r   Ú	benchmarkÚinfer_device)r:   r‚   r�   rˆ   r4   s     `@@r   r�   ÚSubgraphChoiceCaller.benchmark©   s}   ú€ à× Ñ Ñ(Ø$(×$BÑ$BÓ$DˆDÔ!à×'Ñ'×,Ñ,ˆØ×*Ñ*ˆ
Ü×A×AÜ+Ö,QÓRÐRÜ×$Ò$æ1Ü×+Ò+Ð?¨ZÐ?¸$Ò?ñ
ð 	
r]   c                óš   • U R                   c  U R                  5       U l         U R                   R                  / U R                  QUQ5        g)zFRun once for collective benchmarking (barrier sync handled by caller).N)r9   r   r�   r6   )r:   r‚   r�   s      r   Úbenchmark_collectiveÚ)SubgraphChoiceCaller.benchmark_collective¸   sD   € à× Ñ Ñ(Ø$(×$BÑ$BÓ$DˆDÔ!à×Ñ×"Ñ"Ð#B T×%:Ñ%:Ð#B¸TÐ#BÕCr]   c           
      ó‚  • SR                  U R                  R                  SS5      S   /U R                   Vs/ s H  n[	        UR                  5       5      PM     snQU R                   Vs/ s H  n[	        UR                  5       5      PM     snQ[	        U R                  R                  5      P5      $ s  snf s  snf )NÚ-rf   r@   r   )	Újoinr   Úrsplitr"   rJ   r/   r0   r   r   )r:   r<   s     r   Úhash_keyÚSubgraphChoiceCaller.hash_key¿   s¨   € Ø�x‰xà—	‘	× Ñ   aÓ(¨Ñ+ðà15×1AÒ1AÓBÒ1A¨#”#�c—l‘l“nÖ%Ñ1AÑBðð 48×3CÒ3CÓDÒ3C¨C”#�c—n‘nÓ&Ö'Ñ3CÑDðô �D—G‘G—M‘MÓ"ð	ó
ð 	
ùò CùÚDs   ¹#B7
Á-#B<
c           
      óÐ   • [         R                  R                  [         R                  " U R                  U R
                  U R                  U R                  U R                  S95      $ )N)r#   r"   r   r+   Úsubgraph_name)	r   Ú	TensorBoxÚcreateÚSubgraphBufferr#   r"   r   r+   r   ra   s    r   Úoutput_nodeÚ SubgraphChoiceCaller.output_nodeÉ   sN   € Ü�|‰|×"Ñ"Ü×ÒØ—{‘{Ø ×,Ñ,Ø—7‘7Ø#×2Ñ2Ø"Ÿi™iñó
ð 	
r]   c                 ó    • SU R                   S.$ )zRInformation returned here is logged to the autotune log file when that is enabled.Úsubgraph)ÚbackendÚkernel_namer`   ra   s    r   Ú	info_dictÚSubgraphChoiceCaller.info_dictÔ   s   € ð "ØŸ9™9ñ
ð 	
r]   c                 ó    • SU R                    3$ )NÚ	subgraph_r`   ra   s    r   Úautoheuristic_idÚ%SubgraphChoiceCaller.autoheuristic_idÛ   s   € Ø˜4Ÿ9™9˜+Ð&Ð&r]   )r9   r7   r8   r+   r   r6   r4   r…   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__rJ   Úlistr   r   r   r   ÚdictrI   rD   rE   r*   r5   r[   rb   r   Úfloatr�   r“   r™   r   r�   r    r¦   rª   Ú__static_attributes__Ú__classcell__©r=   s   @r   r    r    4   sj  ø† ñð JNñ%*àð%*ð ˜&‘\ð%*ð ð	%*ð
 ð%*ð    S Ñ)ð%*ð ˜C ¨3¨%°·±Ð*=Ñ!>Ð>Ñ?À$ÑFð%*ð 
÷%*ð %*ðN¨4°©9ô ð<+Ø% c¨3 hÑ/ð+Ø9=¸cÀ3¸h¹ð+à	ô+ð.˜ô .ð=¨3ô =ð@
˜t C™yð 
¨u¯|©|ð 
Àô 
ðD¨$¨s©)ð D¸%¿,¹,ð DÈ4ô Dð
˜#ô 
ð	
˜RŸ\™\ô 	
ð
˜4  S ™>ô 
ð' #÷ 'ò 'r]   r    c                   ó\  ^ • \ rS rSrSr\R                  " 5       rS\4U 4S jjr	  SS\S\
\   S\S\S	\4   S
\S\\\\/\R$                  4   4   S-  S\S\4S jjr  SS\S\
\S	\4      S\
\   S\
\\\4      S\S	\4   S-  S\\\\/\R$                  4   4   S-  S\
\   4S jjrS\S	\4   S\\\4   S\4S jrS\\\4   SS4S jrS\S\
\S	\4      S\
\   SS4S jr  SS\
\   S\S	\4   S\\\4   S\S	\4   S-  S\\\\/\R$                  4   4   S-  S\4S jjrSrU =r$ )ÚSubgraphTemplateéß   zø
A template for subgraph evaluation to be used in autotuning.

This class allows creating customized subgraphs that can be appended
as choices during the autotuning process, enabling the selection of
optimal implementations for complex operations.
r   c                 ó    >• [         TU ]  US9  g)zd
Initialize a subgraph template.

Args:
    name: The name of this template
    graph: The FX graph
r`   N)r)   r*   )r:   r   r=   s     €r   r*   ÚSubgraphTemplate.__init__ê   s   ø€ ô 	‰Ñ˜dÐÒ#r]   Nr"   r#   r%   .r$   r&   rY   r   c           	      óV   • [        U S[        [        R                  5       3UUUUUS9$ )a!  
Generate a SubgraphChoiceCaller instance for autotuning.

Args:
    name: The name for this subgraph choice
    input_nodes: List of input nodes to the subgraph
    layout: Memory layout information for the output
    make_fx_graph: Callable that creates the FX graph for this subgraph
    description: Optional description of this choice
    input_gen_fns: Optional dict mapping input indices to tensor generators
    **kwargs: Additional keyword arguments

Returns:
    SubgraphChoiceCaller: A callable object that can be used for autotuning
rf   )r   r"   r#   r$   r%   r&   )r    Únextr¸   Úindex_counter)r:   r   r"   r#   r%   r$   r&   rY   s           r   ÚgenerateÚSubgraphTemplate.generate÷   s;   € ô4 $Ø�6˜œ4Ô 0× >Ñ >Ó?Ð@ÐAØ#ØØ#Ø'Ø'ñ
ð 	
r]   ÚdecompositionsÚnon_tensor_argsÚdefault_implc                 ó€  ^• U(       d  / $ [        U5      [        U5      :X  d    S[        U5       S[        U5       S35       e[        X$5       VVs/ s H  u  pxU R                  X7X…U5      PM     n	nnU R                  XU	5        U	S   n
/ n[        X$5       H�  u  p|SSKmUUS.S[
        S[        S	[
        4   S
[        [        [
        4   S[
        4U4S jjjnU R                  X|5      nU R                  U SU 3UU
USUR                   3US9nUR                  X|5        UR                  U5        MŸ     U$ s  snnf )aÊ  
Generate multiple SubgraphChoiceCaller instances for custom op autotuning.

This method extends SubgraphTemplate to support custom op decompositions,
allowing multiple implementations to compete in autotuning.

Args:
    name: Base name for the choices
    decompositions: List of decomposition functions to compete in autotuning
    input_nodes: List of tensor inputs. All tensor arguments must be passed here.
    non_tensor_args: List of non-tensor kwargs only, one dict per corresponding decomposition.
    default_impl: Default implementation for layout inference
    input_gen_fns: Optional dict mapping input indices to tensor generators

Returns:
    List of SubgraphChoiceCaller instances for autotuning
z>decompositions and non_tensor_args must have same length, got z decompositions and z kwargsr   N)ÚdecompÚdecomp_kwargsr�   rÅ   .rÆ   r   c                 ó`   >• SSK Jn  SSKJn  U" 5       nU" TR                  " U 40 UD6US9" U6 $ )Nr   )Úmake_fxé   )Úselect_decomp_table)Údecomposition_table)Ú"torch.fx.experimental.proxy_tensorrÈ   r7   rÊ   Úpartial)rÅ   rÆ   r�   rÈ   rÊ   rË   Ú	functoolss         €r   r%   ÚBSubgraphTemplate.generate_custom_op_choices.<locals>.make_fx_graphM  sB   ø€ õ Gå?á&9Ó&;Ð#áØ×%Ò% fÑ>°Ñ>Ø(;òð ðð r]   rf   z	CustomOp )r   r"   r#   r%   r$   r&   )r.   rB   Ú_infer_custom_op_layoutÚ_validate_layout_equivalencerÎ   r   r   r²   rJ   Ú_generate_variant_namer¿   r¬   r[   r3   )r:   r   rÁ   r"   rÂ   rÃ   r&   rÅ   rY   Úlayoutsr#   ÚchoicesrÆ   r%   Úvariant_nameÚchoicerÎ   s                   @r   Úgenerate_custom_op_choicesÚ+SubgraphTemplate.generate_custom_op_choices  s‰  ø€ ö4 ØˆIä�>Ó"¤c¨/Ó&:Ó:ð 	
ðÜ�~Ó&Ð'Ð';¼CÀÓ<PÐ;QÐQXðZó	
Ð:ô #& nÔ"Fô	
ò #G‘�ð ×(Ñ(Ø V¸=öñ #Gð	 	ñ 
ð 	×)Ñ)¨$ÀÔHØ˜‘ˆà.0ˆÜ%(¨Ö%IÑ!ˆFãð .4Ø0=òÜðä  ¤c Ñ*ðô  $¤C¬ H™~ðô ÷	ð ð$  ×6Ñ6°vÓMˆLà—]‘]Ø�v˜Q˜|˜nÐ-Ø'ØØ+Ø'¨¯©Ð'8Ð9Ø+ð #ð ˆFð ×&Ñ& vÔ=Ø�N‰N˜6Ö"ñE &JðH ˆùóa
s   ÁD:rÅ   c                 ó˜   • UR                   nU(       d  U$ SR                  S [        UR                  5       5       5       5      nU SU 3$ )zLGenerate a descriptive name for a decomposition variant with its parameters.rf   c              3   ó4   #   • U  H  u  pU S U 3v •  M     g7f)rf   Nr†   )Ú.0ÚkÚvs      r   Ú	<genexpr>Ú:SubgraphTemplate._generate_variant_name.<locals>.<genexpr>v  s   é € ÐNÒ7M©t¨q 1 # Q q c¥
Ò7Mùs   ‚)r¬   r—   ÚsortedÚitems)r:   rÅ   rY   Ú	base_nameÚparam_suffixs        r   rÒ   Ú'SubgraphTemplate._generate_variant_nameo  sF   € ð —O‘Oˆ	ÞØÐØ—x‘xÑN´v¸f¿l¹l»nÔ7MÓNÓNˆØ�˜A˜l˜^Ð,Ð,r]   c                 ó®   • UR                  5        HA  u  p#[        U[        R                  [        45      (       d  M,   SU S[        U5       S35       e   g)z8Validate that kwargs contains only non-tensor arguments.zkwargs['z'] contains tensor zo. Tensor arguments should be in input_nodes, not kwargs. Only scalar/non-tensor parameters should be in kwargs.N)rá   rC   rD   rE   r   Útype)r:   rY   ÚkeyÚvalues       r   Ú_validate_non_tensor_kwargsÚ,SubgraphTemplate._validate_non_tensor_kwargsy  sV   € à Ÿ,™,ž.‰JˆCÜ! %¬%¯,©,¼Ð)?×@Ó@ð Ø˜3˜%Ð2´4¸³;°-ð @Ið JóÐ@ò )r]   Úop_namerÓ   c                 ó2  • U(       d  gUS   n[        USS SS9 Hù  u  pVUR                  UR                  UR                  UR                  4UR                  UR                  UR                  UR                  4:w  d  Me  [        SU SX%   R                   SUR                   SUR                   SUR                   SUR                   S	US   R                   SUR                   SUR                   SUR                   SUR                   S
35      e   g)zXEnsure all layouts have consistent stride, device, dtype, and sizes for fair autotuning.Nr   r@   )ÚstartzLayout mismatch in custom op 'z': decomposition 'z' produces (z, z) but 'r_   )r-   rŒ   ÚdtypeÚsizeÚstrideÚAssertionErrorr¬   )r:   rë   rÁ   rÓ   Ú	referencer;   r#   s          r   rÑ   Ú-SubgraphTemplate._validate_layout_equivalence‚  s  € ö Øà˜A‘Jˆ	Ü" 7¨1¨2 ;°aÔ8‰IˆAØ—‘˜vŸ|™|¨V¯[©[¸&¿-¹-ÐHØ× Ñ Ø—‘Ø—‘Ø× Ñ ð	Mõ ô %Ø4°W°Ið >&Ø&4Ñ&7×&@Ñ&@Ð%Að BØŸ™� b¨¯©¨°b¸¿¹¸ÀRÈÏÉÀð WØ*¨1Ñ-×6Ñ6Ð7ð 8Ø!×(Ñ(Ð)¨¨I¯O©OÐ+<¸B¸y¿~¹~Ð>NÈbÐQZ×QaÑQaÐPbÐbcð	eóð ò 9r]   Úfunction_decompositionc           	      óB  • SSK nSSKJn  U R                  U5        UR                     / n[        U5       HÊ  u  pšU(       a  X•;   a  XY   " U
5      nO�U
R                  5       nUR                  R                  R                  U5      nU
R                  5       nUR                  R                  R                  U5      n[        R                  " UUU
R                  5       U
R                  5       S9nUR                  U5        MÌ     UR                   " U40 UD6nU" U6 n[#        U[        R$                  5      (       d   S['        U5       S35       e[)        UR*                  UR,                  UR.                  UR1                  5       S9sSSS5        $ ! , (       d  f       g= f)zÒInfer output layout for custom ops using the default implementation when available.
Note that the Subgraph assumes custom ops return exactly one tensor output.
TODO: Add support for multiple output custom ops.
r   Nr   )rî   rŒ   z#Expected single tensor output, got z:. Multi-output custom ops not yet supported in autotuning.)rŒ   rî   rï   rð   )rÎ   Útorch._inductor.virtualizedr   ré   r,   r-   r/   r   rK   Úoptimization_hintsr0   rD   Úempty_stridedÚ	get_dtypeÚ
get_devicer3   rÍ   rC   rE   ræ   r   rŒ   rî   rF   rð   )r:   r"   rô   rY   rÃ   r&   rÎ   r   r+   r;   r<   Úfake_tensorÚ	raw_shapeÚconcrete_shapeÚ
raw_strideÚconcrete_strideÚfnÚoutputs                     r   rÐ   Ú(SubgraphTemplate._infer_custom_op_layoutœ  s\  € ó 	å1ð 	×(Ñ(¨Ô0à�[‹[ØˆNÜ# KÖ0‘�Þ  QÓ%7Ø"/Ò"2°3Ó"7‘Kà #§¡£�IØ%&§W¡W×%5Ñ%5×%HÑ%HÈÓ%S�NØ!$§¡Ó!1�JØ&'§g¡g×&6Ñ&6×&IÑ&IÈ*Ó&U�OÜ"'×"5Ò"5Ø&Ø'Ø!Ÿm™m›oØ"Ÿ~™~Ó/ñ	#�Kð ×%Ñ% kÖ2ñ 1ð  ×"Ò"Ð#9ÑD¸VÑDˆBÙ˜Ð(ˆFô ˜f¤e§l¡l×3Ñ3ð Ø5´d¸6³l°^ð DKð LóÐ3ô
 Ø—}‘}Ø—l‘lØ—\‘\Ø—}‘}“ñ	÷7 �[�[ús   ¨EFÆ
Fr†   )Ú N)NN)r¬   r­   r®   r¯   r°   Ú	itertoolsÚcountr¾   rJ   r*   r±   r   r   r   r   r²   rI   rD   rE   r    r¿   r×   rÒ   ré   rÑ   rÐ   r´   rµ   r¶   s   @r   r¸   r¸   ß   sk  ø† ñð —O’OÓ%€Mð$à÷$ð& ØIMñ!
àð!
ð ˜&‘\ð!
ð ð	!
ð
    S Ñ)ð!
ð ð!
ð ˜C ¨3¨%°·±Ð*=Ñ!>Ð>Ñ?À$ÑFð!
ð ð!
ð 
õ!
ðR 37ØIMñSàðSð ˜X c¨3 hÑ/Ñ0ðSð ˜&‘\ð	Sð
 ˜d 3¨ 8™nÑ-ðSð ˜s C˜xÑ(¨4Ñ/ðSð ˜C ¨3¨%°·±Ð*=Ñ!>Ð>Ñ?À$ÑFðSð 
Ð"Ñ	#õSðj-Ø˜s C˜xÑ(ð-Ø26°s¸C°x±.ð-à	ô-ð°$°s¸C°x±.ð ÀTô ðàðð ˜X c¨3 hÑ/Ñ0ðð �f‘ð	ð
 
ôð> 37ØIMñ3à˜&‘\ð3ð !)¨¨c¨Ñ 2ð3ð �S˜#�X‘ð	3ð
 ˜s C˜xÑ(¨4Ñ/ð3ð ˜C ¨3¨%°·±Ð*=Ñ!>Ð>Ñ?À$ÑFð3ð 
÷3ó 3r]   r¸   )*r  ÚloggingÚcollections.abcr   Útypingr   rG   rD   Útorch._inductor.configÚ	_inductorrx   Útorch._inductorr   Útorch._inductor.codegen.commonr   Útorch._inductor.irr   r   r	   r
   r   r   r   Ú$torch._inductor.runtime.benchmarkingr   Útorch._inductor.utilsr   rö   r   Útorch.utils._ordered_setr   Ú	getLoggerr¬   ÚlogÚfxÚGraphModuler±   rJ   r   ÚChoiceCallerr    r¸   r†   r]   r   Ú<module>r     s¦   ðÛ Û Ý $Ý ã ã ß 'Ð 'Ý Ý 9÷÷ ñ õ =Ý :Ý )Ý /ð ×Ò˜Ó!€ð)Ø�‰×Ñð)Ø&*¨3¡ið)Ø7:ð)àô)ô,h'˜2Ÿ?™?ô h'ôVp�~õ pr]   