Ë
    P/æj  ã                  óZ  — d dl mZ d dlZd dlZd dlZd dlmZ ej                  j                  d«      dk(  r ed«      d„ «       Z	n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y)é    )ÚannotationsN)Ú	lru_cacheÚ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     úV/root/repos/pocs/video-evals/.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„ «       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)Ú__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   r,   z%MissingOperatorWithoutDecomp.__init__#   s0   ø€ Ü˜6Ô"Ü‰ÑÐ-¨d×.?Ñ.?ÀÈÈfÓ.UÐ-VÐWÕXr   ©ÚreturnÚNone©r$   r%   r&   r,   Ú__classcell__©r/   s   @r   r)   r)   "   s   ø„ ÷Yñ Yr   r)   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   r+   r,   r#   r   Údedentr-   s       €r   r,   z"MissingOperatorWithDecomp.__init__)   sX   ø€ Ü˜6Ô"Ü‰ÑØ% d×&7Ñ&7¸ÀÀfÓ&MÐ%NÐOÜ�o‰oð8à8>°xð @ðóñõ
	
r   r0   r3   r5   s   @r   r7   r7   (   s   ø„ ÷
ñ 
r   r7   c                  ó    ‡ — e Zd Zdˆ fd„Zˆ xZS )ÚLoweringExceptionc                ó|   •— t         ‰| �  t        |«      j                  › d|› d| j	                  |||«      › �«       y )Nz: r	   )r+   r,   Útyper$   r#   )r.   Úexcr   r   r   r/   s        €r   r,   zLoweringException.__init__9   s?   ø€ Ü‰ÑÜ�C‹y×!Ñ!Ð" " S E¨¨D×,=Ñ,=¸fÀdÈFÓ,SÐ+TÐUõ	
r   )r>   Ú	Exceptionr1   r2   r3   r5   s   @r   r;   r;   8   s   ø„ ÷
ñ 
r   r;   c                  ó   — e Zd Zy)ÚSubgraphLoweringExceptionN©r$   r%   r&   r   r   r   rA   rA   ?   ó   „ Ør   rA   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: )Ú rH   r+   r,   r$   ÚcppÚcxx)r.   rH   r/   s     €r   r,   zInvalidCxxCompiler.__init__D   s1   ø€ Ýä‰ÑØ/°·±Ð/@À
È6Ï:É:Ï>É>ÐJZÐ[õ	
r   r0   r3   r5   s   @r   rE   rE   C   s   ø„ ÷
ñ 
r   rE   c                  ó    ‡ — e Zd Zdˆ fd„Zˆ xZS )ÚCppWrapperCodeGenErrorc                ó*   •— t         ‰| �  d|› �«       y )NzC++ wrapper codegen error: )r+   r,   )r.   Úmsgr/   s     €r   r,   zCppWrapperCodeGenError.__init__M   s   ø€ Ü‰ÑÐ6°s°eÐ<Õ=r   )rO   r   r1   r2   r3   r5   s   @r   rM   rM   L   s   ø„ ÷>ñ >r   rM   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Údecoder+   r,   r   r9   ÚstripÚformatr   )r.   rT   rU   r/   s      €r   r,   zCppCompileError.__init__R   sX   ø€ Ü�fœeÔ$Ø—]‘] 7Ó+ˆFä‰ÑÜ�O‰Oðó
÷ ‰U‹Wß‰V˜Ÿ™ ›¨fˆVÓ5õ	
r   )rT   z	list[str]rU   r   r1   r2   r3   r5   s   @r   rQ   rQ   Q   s   ø„ ÷
ñ 
r   rQ   c                  ó   — e Zd Zy)ÚCUDACompileErrorNrB   r   r   r   r\   r\   g   rC   r   r\   )Ú
__future__r   Úosr   r   Ú	functoolsr   ÚenvironÚgetr   ÚRuntimeErrorr   r)   r7   r;   rA   rE   rM   rQ   r\   r   r   r   ú<module>rc      sµ   ðå "ã 	Û Û Ý ð ‡:�:‡>�>Ð3Ó4¸Ò;áˆtƒ_ñ)ó ñ)òô7�Lô 7ôY =ô Yô
 ô 
ô 
˜ô 
ô	 ô 	ô
˜ô 
ô>˜\ô >ô

�lô 
ô,	�õ 	r   