Ë
    L²jŠ  ã                  óØ  — d dl mZ d dlZd dlZd dlZd dlmZ d dlmZm	Z	 d dl
mZmZ e	r
d dlZd dlmZ ej                   j#                  d«      dk(  r ed«      d#d	„«       Znd#d
„Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ d e«      Z G d!„ d"e«      Zy)$é    )ÚannotationsN)Ú	lru_cache)ÚAnyÚTYPE_CHECKING)ÚBackendCompilerFailedÚShortenTraceback)Ú_CudaDevicePropertiesÚTORCHINDUCTOR_WRITE_MISSING_OPSÚ1c                óª   — t        t        j                  «       › d�d«      5 }|j                  t	        | «      dz   «       d d d «       y # 1 sw Y   y xY w)Nz/missing_ops.txtÚaú
)ÚopenÚtempfileÚ
gettempdirÚwriteÚstr)ÚtargetÚfds     úR/var/www/html/ia-enhanced/venv/lib/python3.12/site-packages/torch/_inductor/exc.pyÚ_record_missing_opr      sJ   € ä”X×(Ñ(Ó*Ð+Ð+;Ð<¸cÓBð 	)ÀbØ�H‰H”S˜“[ 4Ñ'Ô(÷	)÷ 	)ñ 	)ús   ¢A	Á	Ac                 ó   — y ©N© )r   s    r   r   r      s   € Øó    c                  ó   — e Zd Zedd„«       Zy)ÚOperatorIssuec           	     óÚ   — d| › �gt        |«      D ��cg c]  \  }}d|› d|› �‘Œ c}}z   }|r|j                  d|› �«       t        j                  dj	                  |«      d«      S c c}}w )Nztarget: zargs[z]: zkwargs: r   z  )Ú	enumerateÚappendÚtextwrapÚindentÚjoin)r   ÚargsÚkwargsÚiÚargÚliness         r   Úoperator_strzOperatorIssue.operator_str   su   € à˜F˜8Ð$Ð%Ü.7¸«o÷)
Ù$* A sˆe�A�3�c˜#˜Òó)
ñ 
ˆñ Ø�L‰L˜8 F 8Ð,Ô-Ü�‰˜tŸy™y¨Ó/°Ó6Ð6ùó)
s   ”A'N)r   r   r$   ú	list[Any]r%   údict[str, Any]Úreturnr   )Ú__name__Ú
__module__Ú__qualname__Ústaticmethodr)   r   r   r   r   r      s   „ Øò7ó ñ7r   r   c                  ó    ‡ — e Zd Zdˆ fd„Zˆ xZS )ÚMissingOperatorWithoutDecompc                ób   •— t        |«       t        ‰| �	  d| j                  |||«      › �«       y )Nzmissing lowering
)r   ÚsuperÚ__init__r)   ©Úselfr   r$   r%   Ú	__class__s       €r   r5   z%MissingOperatorWithoutDecomp.__init__*   s0   ø€ Ü˜6Ô"Ü‰ÑÐ-¨d×.?Ñ.?ÀÈÈfÓ.UÐ-VÐWÕXr   ©r   r   r$   r*   r%   r+   r,   ÚNone©r-   r.   r/   r5   Ú__classcell__©r8   s   @r   r2   r2   )   s   ø„ ÷Yñ Yr   r2   c                  ó    ‡ — e Zd Zdˆ fd„Zˆ xZS )ÚMissingOperatorWithDecompc                ó–   •— t        |«       t        ‰| �	  d| j                  |||«      › �t	        j
                  d|› d�«      z   «       y )Nzmissing decomposition
z9

                There is a decomposition available for z° in
                torch._decomp.get_decompositions().  Please add this operator to the
                `decompositions` list in torch._inductor.decomposition
                )r   r4   r5   r)   r!   Údedentr6   s       €r   r5   z"MissingOperatorWithDecomp.__init__0   sX   ø€ Ü˜6Ô"Ü‰ÑØ% d×&7Ñ&7¸ÀÀfÓ&MÐ%NÐOÜ�o‰oð8à8>°xð @ðóñõ
	
r   r9   r;   r=   s   @r   r?   r?   /   s   ø„ ÷
ñ 
r   r?   c                  ó:   ‡ — e Zd Z	 d	 	 	 	 	 	 	 	 	 	 	 dˆ fd„Zˆ xZS )ÚLoweringExceptionc           	     ó˜   •— t        |«      j                  › d|› d| j                  |||«      › �}|r
||› d|› �z  }t        ‰| �  |«       y )Nú: r   z
Found from : 
 )Útyper-   r)   r4   r5   )r7   Úexcr   r$   r%   Ústack_traceÚmsgr8   s          €r   r5   zLoweringException.__init__@   s\   ø€ ô �c“×#Ñ#Ð$ B s e¨2¨d×.?Ñ.?ÀÈÈfÓ.UÐ-VÐWˆÙØ�c�UÐ,¨[¨MÐ:Ñ:ˆCÜ‰Ñ˜Õr   r   )rG   Ú	Exceptionr   r   r$   r*   r%   r+   rH   z
str | Noner,   r:   r;   r=   s   @r   rC   rC   ?   sL   ø„ ð #'ðàðð ðð ð	ð
 ðð  ðð 
÷ñ r   rC   c                  ó   — e Zd Zy)ÚSubgraphLoweringExceptionN©r-   r.   r/   r   r   r   rL   rL   N   ó   „ Ør   rL   c                  ó    ‡ — e Zd Zdˆ fd„Zˆ xZS )ÚInvalidCxxCompilerc                óx   •— ddl m} t        ‰| �  d|j                  › d|j
                  j                  › �«       y )Né   )Úconfigz!No working C++ compiler found in z
.cpp.cxx: )Ú rS   r4   r5   r-   ÚcppÚcxx)r7   rS   r8   s     €r   r5   zInvalidCxxCompiler.__init__S   s1   ø€ Ýä‰ÑØ/°·±Ð/@À
È6Ï:É:Ï>É>ÐJZÐ[õ	
r   )r,   r:   r;   r=   s   @r   rP   rP   R   s   ø„ ÷
ñ 
r   rP   c                  ó    ‡ — e Zd Zdˆ fd„Zˆ xZS )ÚCppWrapperCodegenErrorc                ó*   •— t         ‰| �  d|› �«       y )NzC++ wrapper codegen error: ©r4   r5   )r7   rI   r8   s     €r   r5   zCppWrapperCodegenError.__init__\   s   ø€ Ü‰ÑÐ6°s°eÐ<Õ=r   )rI   r   r,   r:   r;   r=   s   @r   rX   rX   [   s   ø„ ÷>ñ >r   rX   c                  ó(   ‡ — e Zd Zdˆ fd„Zdd„Zˆ xZS )ÚCppCompileErrorc                ó  •— t        |t        «      r|j                  d«      }|| _        || _        t
        ‰| �  t        j                  d«      j                  «       j                  dj                  |«      |¬«      «       y )Nzutf-8z©
                    C++ compile error

                    Command:
                    {cmd}

                    Output:
                    {output}
                ú )ÚcmdÚoutput)Ú
isinstanceÚbytesÚdecoder_   r`   r4   r5   r!   rA   ÚstripÚformatr#   )r7   r_   r`   r8   s      €r   r5   zCppCompileError.__init__a   sf   ø€ Ü�fœeÔ$Ø—]‘] 7Ó+ˆFàˆŒØˆŒä‰ÑÜ�O‰Oðó
÷ ‰U‹Wß‰V˜Ÿ™ ›¨fˆVÓ5õ	
r   c                óJ   — | j                   | j                  | j                  ffS r   )r8   r_   r`   )r7   s    r   Ú
__reduce__zCppCompileError.__reduce__x   s   € Ø—‘ §¡¨4¯;©;Ð 7Ð8Ð8r   )r_   z	list[str]r`   r   r,   r:   )r,   z"tuple[type, tuple[list[str], str]])r-   r.   r/   r5   rg   r<   r=   s   @r   r\   r\   `   s   ø„ õ
÷.9r   r\   c                  ó   — e Zd Zy)ÚCUDACompileErrorNrM   r   r   r   ri   ri   |   rN   r   ri   c                  ó    ‡ — e Zd Zdˆ fd„Zˆ xZS )ÚTritonMissingc                ó(   •— t         ‰| �  d|¬«       y )Nz½Cannot find a working triton installation. Either the package is not installed or it is too old. More information on installing Triton can be found at: https://github.com/triton-lang/triton©Úfirst_useful_framerZ   )r7   rn   r8   s     €r   r5   zTritonMissing.__init__�   s    ø€ Ü‰Ñðkð  2ð	 	õ 	
r   )rn   útypes.FrameType | Noner,   r:   r;   r=   s   @r   rk   rk   €   s   ø„ ÷
ñ 
r   rk   c                  ó,   ‡ — e Zd Z	 	 	 	 	 	 dˆ fd„Zˆ xZS )ÚGPUTooOldForTritonc                óv   •— t         ‰| �  d|j                  › d|j                  › d|j                  › �|¬«       y )NzFound zº which is too old to be supported by the triton GPU compiler, which is used as the backend. Triton only supports devices of CUDA Capability >= 7.0, but your device is of CUDA capability ú.rm   )r4   r5   ÚnameÚmajorÚminor)r7   Údevice_propsrn   r8   s      €r   r5   zGPUTooOldForTriton.__init__‹   sN   ø€ ô 	‰ÑØ�\×&Ñ&Ð'ð (5à5A×5GÑ5GÐ4HÈÈ,×J\ÑJ\ÐI]ð_ð  2ð	 	õ 	
r   )rw   r	   rn   ro   r,   r:   r;   r=   s   @r   rq   rq   Š   s+   ø„ ð
ð ,ð
ð 3ð	
ð
 
÷
ñ 
r   rq   c                  ó$   — e Zd ZdZ	 	 	 	 	 	 dd„Zy)ÚInductorErrorÚinductorc                ór   — || _         t        j                  | t        |«      j                  › d|› �|¬«       y )NrE   rm   )Úinner_exceptionr   r5   rF   r-   )r7   r|   rn   s      r   r5   zInductorError.__init__œ   s;   € ð
  /ˆÔÜ×!Ñ!ØÜ�OÓ$×-Ñ-Ð.¨b°Ð0AÐBØ1ö	
r   N)r|   rJ   rn   ro   r,   r:   )r-   r.   r/   Úbackend_namer5   r   r   r   ry   ry   ™   s(   „ Ø€Lð

à"ð

ð 3ð

ð 
ô	

r   ry   )r   r   r,   r:   ) Ú
__future__r   Úosr   r!   Ú	functoolsr   Útypingr   r   Útorch._dynamo.excr   r   ÚtypesÚ
torch.cudar	   ÚenvironÚgetr   ÚRuntimeErrorr   r2   r?   rC   rL   rP   rX   r\   ri   rk   rq   ry   r   r   r   ú<module>rˆ      së   ðÝ "ã 	Û Û Ý ß %ç Eñ Ûå0à‡:�:‡>�>Ð3Ó4¸Ò;áˆtƒ_ò)ó ñ)óô7�Lô 7ôY =ô Yô
 ô 
ô ˜ô ô	 ô 	ô
˜ô 
ô>˜\ô >ô
9�lô 9ô8	�ô 	ô
Ð$ô 
ô
Ð)ô 
ô
Ð)õ 
r   