Ë
    g^(h/  ã                  óÜ  — 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	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ÚOptionalÚ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     úQ/var/www/skyplay_api_hub/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                  ó4   ‡ — e Zd Z	 	 	 	 	 	 	 	 	 	 dˆ fd„Zˆ xZS )ÚLoweringExceptionc                ó|   •— t         ‰| �  t        |«      j                  › d|› d| j	                  |||«      › �«       y )Nú: r   )r4   r5   Útyper-   r)   )r7   Úexcr   r$   r%   r8   s        €r   r5   zLoweringException.__init__@   sA   ø€ ô 	‰ÑÜ�C‹y×!Ñ!Ð" " S E¨¨D×,=Ñ,=¸fÀdÈFÓ,SÐ+TÐUõ	
r   )
rG   Ú	Exceptionr   r   r$   r*   r%   r+   r,   r:   r;   r=   s   @r   rC   rC   ?   s5   ø„ ð
Øð
Ø&)ð
Ø1:ð
ØDRð
à	÷
ñ 
r   rC   c                  ó   — e Zd Zy)ÚSubgraphLoweringExceptionN©r-   r.   r/   r   r   r   rJ   rJ   H   ó   „ Ør   rJ   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: )Ú rQ   r4   r5   r-   ÚcppÚcxx)r7   rQ   r8   s     €r   r5   zInvalidCxxCompiler.__init__M   s1   ø€ Ýä‰ÑØ/°·±Ð/@À
È6Ï:É:Ï>É>ÐJZÐ[õ	
r   )r,   r:   r;   r=   s   @r   rN   rN   L   s   ø„ ÷
ñ 
r   rN   c                  ó    ‡ — e Zd Zdˆ fd„Zˆ xZS )ÚCppWrapperCodegenErrorc                ó*   •— t         ‰| �  d|› �«       y )NzC++ wrapper codegen error: ©r4   r5   )r7   Úmsgr8   s     €r   r5   zCppWrapperCodegenError.__init__V   s   ø€ Ü‰ÑÐ6°s°eÐ<Õ=r   )rY   r   r,   r:   r;   r=   s   @r   rV   rV   U   s   ø„ ÷>ñ >r   rV   c                  ó    ‡ — e Zd Zdˆ f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Údecoder4   r5   r!   rA   ÚstripÚformatr#   )r7   r^   r_   r8   s      €r   r5   zCppCompileError.__init__[   sX   ø€ Ü�fœeÔ$Ø—]‘] 7Ó+ˆFä‰ÑÜ�O‰Oðó
÷ ‰U‹Wß‰V˜Ÿ™ ›¨fˆVÓ5õ	
r   )r^   z	list[str]r_   r   r,   r:   r;   r=   s   @r   r[   r[   Z   s   ø„ ÷
ñ 
r   r[   c                  ó   — e Zd Zy)ÚCUDACompileErrorNrK   r   r   r   rf   rf   p   rL   r   rf   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_framerX   )r7   rk   r8   s     €r   r5   zTritonMissing.__init__u   s    ø€ Ü‰Ñðkð  2ð	 	õ 	
r   )rk   úOptional[types.FrameType]r,   r:   r;   r=   s   @r   rh   rh   t   s   ø„ ÷
ñ 
r   rh   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 ú.rj   )r4   r5   ÚnameÚmajorÚminor)r7   Údevice_propsrk   r8   s      €r   r5   zGPUTooOldForTriton.__init__   sN   ø€ ô
 	‰ÑØ�\×&Ñ&Ð'ð (5à5A×5GÑ5GÐ4HÈÈ,×J\ÑJ\ÐI]ð_ð  2ð	 	õ 	
r   )rt   r
   rk   rl   r,   r:   r;   r=   s   @r   rn   rn   ~   s)   ø„ ð

à+ð

ð 6ð

ð 
÷	

ñ 

r   rn   c                  ó$   — e Zd ZdZ	 	 	 	 	 	 dd„Zy)ÚInductorErrorÚinductorc                ór   — || _         t        j                  | t        |«      j                  › d|› �|¬«       y )NrE   rj   )Úinner_exceptionr	   r5   rF   r-   )r7   ry   rk   s      r   r5   zInductorError.__init__�   s;   € ð
  /ˆÔÜ×!Ñ!ØÜ�OÓ$×-Ñ-Ð.¨b°Ð0AÐBØ1ö	
r   N)ry   rH   rk   rl   r,   r:   )r-   r.   r/   Úbackend_namer5   r   r   r   rv   rv   Œ   s(   „ Ø€Lð

à"ð

ð 6ð

ð 
ô	

r   rv   )r   r   r,   r:   )!Ú
__future__r   Úosr   r!   Ú	functoolsr   Útypingr   r   r   Útorch._dynamo.excr   r	   ÚtypesÚ
torch.cudar
   ÚenvironÚgetr   ÚRuntimeErrorr   r2   r?   rC   rJ   rN   rV   r[   rf   rh   rn   rv   r   r   r   ú<module>r…      sî   ðÝ "ã 	Û Û Ý ß /Ñ /ç Eñ Ûå0à‡:�:‡>�>Ð3Ó4¸Ò;áˆtƒ_ò)ó ñ)óô7�Lô 7ôY =ô Yô
 ô 
ô 
˜ô 
ô	 ô 	ô
˜ô 
ô>˜\ô >ô

�lô 
ô,	�ô 	ô
Ð$ô 
ô
Ð)ô 
ô
Ð)õ 
r   