+
    –°³j,  ã                  ó¾   € ^ RI Ht ^ RIHtHt ^ RIHtHt ^ RIt^ RI	t^ RI
Ht ^ RIHt ^RIHtHtHt ]'       d   ^ RIHt ^ RIt ! R	 R
]4      t ! R R]4      tR# )é    )Úannotations)ÚABCÚabstractmethod)ÚAnyÚTYPE_CHECKINGN)Úir)ÚV)ÚFixedLayoutÚFlexibleLayoutÚLayout)ÚSequencec                  ó  € ] tR t^tRtR"R R lltR#R R llt]R R l4       t]R	 R
 l4       t	R R lt
R R ltR R ltR R ltR R ltR R ltR R ltR$R R llt]R R l4       tR R lt]R%R R  ll4       tR!tR# )&ÚKernelInputszÎ
Class to store and provide access to input nodes for kernels.
This class takes in a tuple of input nodes and provides methods to access
information about these nodes, such as their device type and device.
Nc               ó$   € V ^8„  d   QhRRRRRR/# )é   Úinput_nodesú	list[Any]Úscalarsúdict[str, float | int] | NoneÚ	out_dtypeútorch.dtype | None© )Úformats   "Ú^/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torch/_inductor/kernel_inputs.pyÚ__annotate__ÚKernelInputs.__annotate__   s-   € ÷ Eñ EàðEð /ðEð &ñ	Eó    c                ó|   € Wn         RV n        Ve   TM/ V n        W0n        \	        V4      ^ 8:  d   \        R4      hR# )z�
Initialize with a tuple of input nodes.

Args:
    input_nodes: A tuple of input nodes to store
    out_dtype: Optional output dtype to store
Nz Expected at least one input node)Ú_input_nodesÚ_device_nameÚ_scalarsÚ
_out_dtypeÚlenÚAssertionError)Úselfr   r   r   s   &&&&r   Ú__init__ÚKernelInputs.__init__   sC   € ð (ÔØ(,ˆÔØ#*Ò#6™¸BˆŒØ#ŒÜˆ{Ó˜qÔ Ü Ð!CÓDÐDñ !r   c               ó    € V ^8„  d   QhRRRR/# )r   ÚreorderzSequence[int] | NoneÚreturnr   r   )r   s   "r   r   r   /   s   € ÷ 7ñ 7Ð1ð 7¸Yñ 7r   c                ó  € Vf   V P                   # \        V P                   4      \        V4      8w  d.   \        R\        V P                   4       R\        V4       24      hV Uu. uF  q P                   V,          NK  	  up# u upi )zÿ
Return the stored input nodes, optionally reordered.

Args:
    reorder: Optional sequence of indices to reorder the nodes.
            For example, (2, 0, 1) would return nodes in that order.

Returns:
    The tuple of input nodes, optionally reordered
zReorder length mismatch: ú vs )r   r#   r$   )r%   r)   Úis   && r   ÚnodesÚKernelInputs.nodes/   s   € ð Š?Ø×$Ñ$Ð$Üˆt× Ñ Ó!¤S¨£\Ô1Ü Ø+¬C°×0AÑ0AÓ,BÐ+CÀ4ÌÈGËÀ~ÐVóð ñ /6Ó6©g¨×!Ñ! !×$Ð$©gÑ6Ð6ùÒ6s   Á%Bc               ó   € V ^8„  d   QhRR/# ©r   r*   Úintr   )r   s   "r   r   r   C   s   € ÷ &ñ &�sñ &r   c                ó,   € \        V P                  4      # )zH
Get the number of input nodes.

Returns:
    The number of input nodes
)r#   r   ©r%   s   &r   ÚcountÚKernelInputs.countB   s   € ô �4×$Ñ$Ó%Ð%r   c               ó   € V ^8„  d   QhRR/# ©r   r*   z
str | Noner   )r   s   "r   r   r   M   s   € ÷ 8ñ 8˜Zñ 8r   c                óP   € \         P                  ! V P                  ^ ,          4      # )z\
Get the device type of the first node.

Returns:
    The device type (e.g., 'cuda', 'cpu')
)r   Úget_device_typer   r4   s   &r   Údevice_typeÚKernelInputs.device_typeL   s    € ô ×!Ò! $×"3Ñ"3°AÕ"6Ó7Ð7r   c               ó   € V ^8„  d   QhRR/# )r   r*   ztorch.devicer   )r   s   "r   r   r   W   s   € ÷ 1ñ 1˜ñ 1r   c                óD   € V P                   ^ ,          P                  4       # )zN
Get the device of the first node.

Returns:
    The device of the first node
)r   Ú
get_devicer4   s   &r   ÚdeviceÚKernelInputs.deviceW   s   € ð × Ñ  Õ#×.Ñ.Ó0Ð0r   c               ó   € V ^8„  d   QhRR/# r8   r   )r   s   "r   r   r   `   s   € ÷ !ñ !˜Zñ !r   c                óØ   € V P                   fR   V P                  4       pV P                  R8X  d1   \        P                  P                  V4      pVP                  V n         V P                   # )zU
Get the device name information.

Returns:
    A tuple of (gpu_name, vendor, model)
Úcuda)r    r@   r;   ÚtorchrD   Úget_device_propertiesÚgcnArchName)r%   r@   Údevice_propertiess   &  r   Údevice_nameÚKernelInputs.device_name`   sX   € ð ×ÑÒ$Ø—[‘[“]ˆFØ×Ñ 6Ô)Ü$)§J¡J×$DÑ$DÀVÓ$LÐ!Ø$5×$AÑ$A�Ô!Ø× Ñ Ð r   c               ó   € V ^8„  d   QhRR/# )r   r*   ztuple[tuple[Any, ...], ...]r   )r   s   "r   r   r   n   s   € ÷ Dñ DÐ!<ñ Dr   c                ó‚   € \         ;QJ d    . R V P                   4       F  NK  	  5# ! R V P                   4       4      # )zg
Get the symbolic shapes of all input nodes.

Returns:
    A tuple of shape tuples for each input node
c              3  ó@   "  € T F  qP                  4       x € K  	  R # 5i©N)Úget_size©Ú.0Únodes   & r   Ú	<genexpr>Ú/KernelInputs.shapes_symbolic.<locals>.<genexpr>u   s   é € ÐCÑ1B¨—]‘]—_�_Ó1Bùó   ‚©Útupler   r4   s   &r   Úshapes_symbolicÚKernelInputs.shapes_symbolicn   s2   € ÷ ŒuÑC°×1BÒ1BÓC�uÐCˆuÑC°×1BÒ1BÓCÓCÐCr   c               ó   € V ^8„  d   QhRR/# ©r   r*   ztuple[tuple[int, ...], ...]r   )r   s   "r   r   r   w   s   € ÷ 

ñ 

Ð:ñ 

r   c                ó‚   € \         ;QJ d    . R V P                   4       F  NK  	  5# ! R V P                   4       4      # )z€
Get the size hints for shapes of all input nodes.

Returns:
    A tuple of shape tuples with integer hints for each input node
c              3  ó�   "  € T F<  p\         P                  P                  P                  VP	                  4       4      x € K>  	  R # 5irN   )r	   ÚgraphÚsizevarsÚoptimization_hintsrO   rP   s   & r   rS   Ú-KernelInputs.shapes_hinted.<locals>.<genexpr>~   s5   é € ð 
á)�ô �G‰G×Ñ×/Ñ/°·±³×@Ð@Û)ùó   ‚AArV   r4   s   &r   Úshapes_hintedÚKernelInputs.shapes_hintedw   óB   € ÷ Œuñ 
à×)Ò)ó
�uð 	
ˆuñ 
à×)Ò)ó
ó 
ð 	
r   c               ó   € V ^8„  d   QhRR/# )r   r*   z%tuple[tuple[sympy.Integer, ...], ...]r   )r   s   "r   r   r   ƒ   s   € ÷ Fñ FÐ"Gñ Fr   c                ó‚   € \         ;QJ d    . R V P                   4       F  NK  	  5# ! R V P                   4       4      # )zi
Get the symbolic strides of all input nodes.

Returns:
    A tuple of stride tuples for each input node
c              3  ó@   "  € T F  qP                  4       x € K  	  R # 5irN   )Ú
get_striderP   s   & r   rS   Ú0KernelInputs.strides_symbolic.<locals>.<genexpr>Š   s   é € ÐEÑ3D¨4—_‘_×&Ð&Ó3DùrU   rV   r4   s   &r   Ústrides_symbolicÚKernelInputs.strides_symbolicƒ   s2   € ÷ ŒuÑE°4×3DÒ3DÓE�uÐEˆuÑE°4×3DÒ3DÓEÓEÐEr   c               ó   € V ^8„  d   QhRR/# r[   r   )r   s   "r   r   r   Œ   s   € ÷ 

ñ 

Ð ;ñ 

r   c                ó‚   € \         ;QJ d    . R V P                   4       F  NK  	  5# ! R V P                   4       4      # )z‚
Get the size hints for strides of all input nodes.

Returns:
    A tuple of stride tuples with integer hints for each input node
c              3  ó�   "  € T F<  p\         P                  P                  P                  VP	                  4       4      x € K>  	  R # 5irN   )r	   r^   r_   r`   ri   rP   s   & r   rS   Ú.KernelInputs.strides_hinted.<locals>.<genexpr>“   s6   é € ð 
á)�ô �G‰G×Ñ×/Ñ/°·±Ó0A×BÐBÛ)ùrb   rV   r4   s   &r   Ústrides_hintedÚKernelInputs.strides_hintedŒ   re   r   c               ó   € V ^8„  d   QhRR/# )r   r*   ztuple[torch.dtype, ...]r   )r   s   "r   r   r   ˜   s   € ÷ Eñ EÐ/ñ Er   c                ó‚   € \         ;QJ d    . R V P                   4       F  NK  	  5# ! R V P                   4       4      # )zX
Get the dtypes of all input nodes.

Returns:
    A tuple of dtypes for each input node
c              3  ó@   "  € T F  qP                  4       x € K  	  R # 5irN   )Ú	get_dtyperP   s   & r   rS   Ú&KernelInputs.dtypes.<locals>.<genexpr>Ÿ   s   é € ÐDÑ2C¨$—^‘^×%Ð%Ó2CùrU   rV   r4   s   &r   ÚdtypesÚKernelInputs.dtypes˜   s2   € ÷ ŒuÑD°$×2CÒ2CÓD�uÐDˆuÑD°$×2CÒ2CÓDÓDÐDr   c               ó    € V ^8„  d   QhRRRR/# )r   Úidxr2   r*   útorch.dtyper   )r   s   "r   r   r   ¡   s   € ÷ 
2ñ 
2˜ð 
2 [ñ 
2r   c                óD   € V P                   V,          P                  4       # )z¢
Get the dtype of a specific input node.

Args:
    idx: Index of the node to get the dtype from (default: 0)

Returns:
    The dtype of the specified input node
)r   rv   )r%   r{   s   &&r   ÚdtypeÚKernelInputs.dtype¡   s   € ð × Ñ  Õ%×/Ñ/Ó1Ð1r   c               ó   € V ^8„  d   QhRR/# ©r   r*   r|   r   )r   s   "r   r   r   ®   s   € ÷ ñ ˜;ñ r   c                ó   € R# )úc
Get the output dtype, whether passed in or inferred from the nodes

Returns:
    The output dtype
Nr   r4   s   &r   r   ÚKernelInputs.out_dtype­   ó   ‚ r   c               ó    € V ^8„  d   QhRRRR/# )r   ÚnameÚstrr*   zfloat | intr   )r   s   "r   r   r   ¶   s   € ÷ #ñ #˜sð # {ñ #r   c                óf   € WP                   9  d   \        RV R24      hV P                   V,          # )zr
Get the scalar value for a given name.

Args:
    name: Name of the scalar to get

Returns:
    The scalar value
zScalar z not found, but required)r!   r$   )r%   r‡   s   &&r   Ú
get_scalarÚKernelInputs.get_scalar¶   s2   € ð —}‘}Ô$Ü  7¨4¨&Ð0HÐ!IÓJÐJØ�}‰}˜TÕ"Ð"r   c               ó    € V ^8„  d   QhRRRR/# ©r   ÚflexibleÚboolr*   r   r   )r   s   "r   r   r   Å   s   € ÷ ñ  dð °fñ r   c                ó   € R# )zÉ
Abstract method to handle output layout generation.

Args:
    out_dtype: Optional output dtype. If not provided, infer from inputs
    flexible: If True, return FlexibleLayout, otherwise FixedLayout
Nr   )r%   rŽ   s   &&r   Úoutput_layoutÚKernelInputs.output_layoutÄ   r…   r   )r    r   r"   r!   )NNrN   )r   ©T)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r&   r.   Úpropertyr5   r;   r@   rI   rX   rc   rk   rq   rx   r~   r   r   rŠ   r‘   Ú__static_attributes__r   r   r   r   r      s’   † ñ÷E÷(7ð& ô&ó ð&ð ô8ó ð8õ1õ!õDõ

õFõ

õE÷
2ð ôó ðõ#ð öó ôr   r   c                  ó‚   a € ] tR t^ÏtRtRR V 3R llltR R ltR R ltRR R	 lltR
 R lt	R R lt
R R ltRtV ;t# )ÚMMKernelInputszz
Specialized KernelInputs for matrix multiplication operations.
Provides additional methods to access M, N, K dimensions.
c          
     ó,   € V ^8„  d   QhRRRRRRRRR	R/# )
r   r   r   r   r   r   r   Úmat1_idxr2   Úmat2_idxr   )r   s   "r   r   ÚMMKernelInputs.__annotate__Õ   s<   € ÷ ""ñ ""àð""ð /ð""ð &ð	""ð
 ð""ð ñ""r   c                ó’  <€ \         SV `  WV4       \        V P                  4      ^8  d   \	        R4      hYErvV^ 8  d   V\        V4      ,          pV^ 8  d   V\        V4      ,          p^ Tu;8:  d   \        V4      8  g   M \	        RV 24      h^ Tu;8:  d   \        V4      8  g   M \	        RV 24      hW@n        WPn        R# )z“
Initialize with a tuple of input nodes.

By default, we assume the last 2 input nodes are mat1 and mat2, but
the caller can adjust when necessary
zExpected at least 2 input nodeszInvalid mat1_idx: zInvalid mat2_idx: N)Úsuperr&   r#   r   r$   Ú	_mat1_idxÚ	_mat2_idx)	r%   r   r   r   rž   rŸ   Úm1_idxÚm2_idxÚ	__class__s	   &&&&&&  €r   r&   ÚMMKernelInputs.__init__Õ   s¼   ø€ ô 	‰Ñ˜¨yÔ9ô ˆt× Ñ Ó! AÔ%Ü Ð!BÓCÐCð "�Ø�aŒ<Ø”c˜+Ó&Õ&ˆFØ�aŒ<Ø”c˜+Ó&Õ&ˆFà�VÖ.œc +Ó.Ö.Ü Ð#5°h°ZÐ!@ÓAÐAØ�VÖ.œc +Ó.Ö.Ü Ð#5°h°ZÐ!@ÓAÐAà!ŒØ!Žr   c               ó   € V ^8„  d   QhRR/# )r   r*   z2tuple[sympy.Integer, sympy.Integer, sympy.Integer]r   )r   s   "r   r   r    ù   s   € ÷ ñ à	;ñr   c                ó˜  € V P                  4       V P                  ,          pV P                  4       V P                  ,          pVP                  4       R,          pVP                  4       R,          pVP                  4       R,          pVP                  4       R,          p\        P
                  P                  P                  WF4       W5V3# )aq  
Get the symbolic M, N, K dimensions for matrix multiplication.
Handles both 2D (MM) and 3D (BMM) tensors.

M is extracted from the second-to-last dimension of the first operand (mat1).
N is extracted from the last dimension of the second operand (mat2).
K is extracted from the last dimension of the first operand (mat1).

Returns:
    A tuple of (M, N, K) dimensions
éþÿÿÿéÿÿÿÿ)r.   r£   r¤   rO   r	   r^   r_   Úcheck_equals)r%   Úmat1Úmat2ÚmÚkÚnÚk0s   &      r   Úmnk_symbolicÚMMKernelInputs.mnk_symbolicù   s�   € ð �z‰z‹|˜DŸN™NÕ+ˆØ�z‰z‹|˜DŸN™NÕ+ˆà�M‰M‹O˜BÕˆØ�M‰M‹O˜BÕˆØ�M‰M‹O˜BÕˆð �]‰]‹_˜RÕ ˆÜ	�‰×Ñ×%Ñ% aÔ,Ø�aˆyÐr   c               ó   € V ^8„  d   QhRR/# r�   r   )r   s   "r   r   r      s   € ÷ 	.ñ 	.˜;ñ 	.r   c                ó€   € V P                   e   V P                   # V P                  4       ^ ,          P                  4       # )rƒ   )r"   Úmat1mat2rv   r4   s   &r   r   ÚMMKernelInputs.out_dtype  s2   € ð �?‰?Ò&Ø—?‘?Ð"Ø�}‰}‹˜qÕ!×+Ñ+Ó-Ð-r   c               ó    € V ^8„  d   QhRRRR/# r�   r   )r   s   "r   r   r      s   € ÷ ?ñ ? dð ?°fñ ?r   c                ó²  € V P                  4       w  r#V P                  4       pVP                  4       Ev rVpVP                  4       Ev r‰p
\        WX4       UUu. uF.  w  r¼\        P
                  P                  P                  W¼4      NK0  	  uppp. VOVNV
NpV'       d   \        V P                  4       WM4      # \        V P                  4       WM4      # u uppi )zÐ
Handle output layout generation for matrix multiplication.

Args:
    out_dtype: Optional output dtype. If not provided, infer from inputs
    flexible: If True, return FlexibleLayout, otherwise FixedLayout
)r¸   r   rO   Úzipr	   r^   r_   Úcheck_equals_and_simplifyr   r@   r
   )r%   rŽ   r®   r¯   r   Úb1r°   Úk1Úb2Úk2r²   ÚaÚbÚsizes   &&            r   r‘   ÚMMKernelInputs.output_layout  sª   € ð —]‘]“_‰
ˆØ—N‘NÓ$ˆ	à—]‘]“_‰
ˆ�Ø—]‘]“_‰
ˆ�ÜJMÈbÌ+ÔVÉ+Á$À!ŒQ�W‰W×Ñ×7Ñ7¸Ö=É+ÒVˆØ�ˆz�Aˆz�qˆzˆßÜ! $§+¡+£-°ÓAÐAä˜tŸ{™{›}¨iÓ>Ð>ùó Ws   Á4Cc               ó   € V ^8„  d   QhRR/# )r   r*   ztuple[Any, Any]r   )r   s   "r   r   r    2  s   € ÷ <ñ <˜/ñ <r   c                ój   € V P                  4       pWP                  ,          WP                  ,          3# )zJ
Get the mat1 and mat2 nodes.

Returns:
    A tuple of (mat1, mat2) nodes
)r.   r£   r¤   )r%   r.   s   & r   r¸   ÚMMKernelInputs.mat1mat22  s(   € ð —
‘
“ˆØ—^‘^Õ$ e¯N©NÕ&;Ð;Ð;r   c               ó   € V ^8„  d   QhRR/# )r   r*   ztuple[int, int, int]r   )r   s   "r   r   r    <  s   € ÷ ñ Ð0ñ r   c                óè   € V P                  4       pWP                  ,          pWP                  ,          pVR,          pVR,          pVR,          pVR,          pWW8w  d   \        RV RV 24      hWFV3# )zð
Get the hinted M, N, K dimensions for matrix multiplication.
Handles both 2D (MM) and 3D (BMM) tensors.

Uses shapes_hinted from the base class to get integer hints for dimensions.

Returns:
    A tuple of (M, N, K) dimensions as integers
zK dimensions don't match: r,   r«   r¬   )rc   r£   r¤   r$   )r%   Úhinted_shapesÚ
mat1_shapeÚ
mat2_shaper°   r±   r²   Úk_checks   &       r   Ú
mnk_hintedÚMMKernelInputs.mnk_hinted<  sx   € ð ×*Ñ*Ó,ˆØ"§>¡>Õ2ˆ
Ø"§>¡>Õ2ˆ
à�r�NˆØ�r�NˆØ�r�Nˆð ˜R•.ˆØŒ<Ü Ð#=¸a¸SÀÀWÀIÐ!NÓOÐOà�aˆyÐr   c               ó   € V ^8„  d   QhRR/# r1   r   )r   s   "r   r   r    U  s   € ÷ ñ ˜cñ r   c                ó|   € V P                  4       pWP                  ,          p\        V4      ^8¼  d
   VR,          # ^# )z”
Get the hinted batch size for batched matrix multiplication.
Returns 1 for non-batched (2D) operations.

Returns:
    The batch size as an integer
éýÿÿÿ)rc   r£   r#   )r%   rË   rÌ   s   &  r   Úbatch_hintedÚMMKernelInputs.batch_hintedU  s7   € ð ×*Ñ*Ó,ˆØ"§>¡>Õ2ˆ
äˆz‹?˜aÔØ˜b•>Ð!Ùr   )r£   r¤   )NNr«   r¬   r“   )r”   r•   r–   r—   r˜   r&   r´   r   r‘   r¸   rÏ   rÔ   rš   Ú__classcell__)r§   s   @r   rœ   rœ   Ï   s6   ø† ñ÷
""ò ""õHõ4	.÷?õ(<õ÷2ó r   rœ   )Ú
__future__r   Úabcr   r   Útypingr   r   rE   Útorch._inductor.configÚtorch._inductorr   Útorch._inductor.virtualizedr	   r
   r   r   Úcollections.abcr   Úsympyr   rœ   r   r   r   Ú<module>rß      sH   ðÝ "ç #ß %ã Û Ý Ý )ç 3Ñ 3÷ Ý(ãôx�3ô xôvS�\ö Sr   