
    [Th/                       S SK Jr  S SKrS SKrS SKrS SKJr  S SKJrJ	r	J
r
  S SKJrJr  \
(       a
  S SKrS SKJr  \R"                  R%                  S5      S:X  a  \" S5      S#S	 j5       rOS#S
 jr " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S \5      r " S! S"\5      r g)$    )annotationsN)	lru_cache)AnyOptionalTYPE_CHECKING)BackendCompilerFailedShortenTraceback)_CudaDevicePropertiesTORCHINDUCTOR_WRITE_MISSING_OPS1c                    [        [        R                  " 5        S3S5       nUR                  [	        U 5      S-   5        S S S 5        g ! , (       d  f       g = f)Nz/missing_ops.txta
)opentempfile
gettempdirwritestr)targetfds     K/var/www/auris/envauris/lib/python3.13/site-packages/torch/_inductor/exc.py_record_missing_opr      sB    X((*++;<cBbHHS[4'( CBBs   A


Ac                    g )N )r   s    r   r   r      s        c                  (    \ rS rSr\SS j5       rSrg)OperatorIssue   c           	         SU  3/[        U5       VVs/ s H  u  p4SU SU 3PM     snn-   nU(       a  UR                  SU 35        [        R                  " SR	                  U5      S5      $ s  snnf )Nztarget: zargs[z]: zkwargs: r   z  )	enumerateappendtextwrapindentjoin)r   argskwargsiargliness         r   operator_strOperatorIssue.operator_str   sw    F8$%.7o)
.=FAeA3c#o)
 
 LL8F8,-tyy/66)
s   A/r   N)r   r   r%   	list[Any]r&   dict[str, Any]returnr   )__name__
__module____qualname____firstlineno__staticmethodr*   __static_attributes__r   r   r   r   r      s    7 7r   r   c                  ,   ^  \ rS rSrSU 4S jjrSrU =r$ )MissingOperatorWithoutDecomp)   c                `   > [        U5        [        TU ]	  SU R                  XU5       35        g )Nzmissing lowering
)r   super__init__r*   selfr   r%   r&   	__class__s       r   r:   %MissingOperatorWithoutDecomp.__init__*   s.    6"-d.?.?f.U-VWXr   r   r   r   r%   r,   r&   r-   r.   Noner/   r0   r1   r2   r:   r4   __classcell__r=   s   @r   r6   r6   )   s    Y Yr   r6   c                  ,   ^  \ rS rSrSU 4S jjrSrU =r$ )MissingOperatorWithDecomp/   c                   > [        U5        [        TU ]	  SU R                  XU5       3[        R
                  " SU S35      -   5        g )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   r9   r:   r*   r"   dedentr;   s       r   r:   "MissingOperatorWithDecomp.__init__0   sV    6"%d&7&7f&M%NOoo88>x @
	
r   r   r?   rA   rC   s   @r   rE   rE   /   s    
 
r   rE   c                  @   ^  \ rS rSr          SU 4S jjrSrU =r$ )LoweringException?   c                z   > [         TU ]  [        U5      R                   SU SU R	                  X#U5       35        g )N: r   )r9   r:   typer/   r*   )r<   excr   r%   r&   r=   s        r   r:   LoweringException.__init__@   s?     	Cy!!""SED,=,=fF,S+TU	
r   r   )
rP   	Exceptionr   r   r%   r,   r&   r-   r.   r@   rA   rC   s   @r   rK   rK   ?   s5    

&)
1:
DR
	
 
r   rK   c                      \ rS rSrSrg)SubgraphLoweringExceptionH   r   Nr/   r0   r1   r2   r4   r   r   r   rT   rT   H       r   rT   c                  ,   ^  \ rS rSrSU 4S jjrSrU =r$ )InvalidCxxCompilerL   c                x   > SSK Jn  [        TU ]  SUR                   SUR
                  R                   35        g )N   )configz!No working C++ compiler found in z
.cpp.cxx: ) r]   r9   r:   r/   cppcxx)r<   r]   r=   s     r   r:   InvalidCxxCompiler.__init__M   s1    //@
6::>>JZ[	
r   r   )r.   r@   rA   rC   s   @r   rY   rY   L   s    
 
r   rY   c                  ,   ^  \ rS rSrSU 4S jjrSrU =r$ )CppWrapperCodegenErrorU   c                *   > [         TU ]  SU 35        g )NzC++ wrapper codegen error: r9   r:   )r<   msgr=   s     r   r:   CppWrapperCodegenError.__init__V   s    6se<=r   r   )rg   r   r.   r@   rA   rC   s   @r   rc   rc   U   s    > >r   rc   c                  ,   ^  \ rS rSrSU 4S jjrSrU =r$ )CppCompileErrorZ   c                   > [        U[        5      (       a  UR                  S5      n[        TU ]  [
        R                  " S5      R                  5       R                  SR                  U5      US95        g )Nzutf-8z
                    C++ compile error

                    Command:
                    {cmd}

                    Output:
                    {output}
                 )cmdoutput)

isinstancebytesdecoder9   r:   r"   rH   stripformatr$   )r<   rn   ro   r=   s      r   r:   CppCompileError.__init__[   s[    fe$$]]7+FOO
 UWVfV5	
r   r   )rn   z	list[str]ro   r   r.   r@   rA   rC   s   @r   rj   rj   Z   s    
 
r   rj   c                      \ rS rSrSrg)CUDACompileErrorp   r   NrV   r   r   r   rw   rw   p   rW   r   rw   c                  ,   ^  \ rS rSrSU 4S jjrSrU =r$ )TritonMissingt   c                "   > [         TU ]  SUS9  g )NzCannot 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_framerf   )r<   r~   r=   s     r   r:   TritonMissing.__init__u   s     k  2	 	 	
r   r   )r~   Optional[types.FrameType]r.   r@   rA   rC   s   @r   rz   rz   t   s    
 
r   rz   c                  8   ^  \ rS rSr      SU 4S jjrSrU =r$ )GPUTooOldForTriton~   c                p   > [         TU ]  SUR                   SUR                   SUR                   3US9  g )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 .r}   )r9   r:   namemajorminor)r<   device_propsr~   r=   s      r   r:   GPUTooOldForTriton.__init__   sN    
 	\&&' (55A5G5G4H,J\J\I]_  2	 	 	
r   r   )r   r
   r~   r   r.   r@   rA   rC   s   @r   r   r   ~   s)    

+

 6

 
	

 

r   r   c                  .    \ rS rSrSr      SS jrSrg)InductorError   inductorc                l    Xl         [        R                  " U [        U5      R                   SU 3US9  g )NrN   r}   )inner_exceptionr	   r:   rO   r/   )r<   r   r~   s      r   r:   InductorError.__init__   s9    
  /!!O$--.b0AB1	
r   )r   N)r   rR   r~   r   r.   r@   )r/   r0   r1   r2   backend_namer:   r4   r   r   r   r   r      s(    L

"

 6

 
	

r   r   )r   r   r.   r@   )!
__future__r   osr   r"   	functoolsr   typingr   r   r   torch._dynamo.excr   r	   types
torch.cudar
   environgetr   RuntimeErrorr   r6   rE   rK   rT   rY   rc   rj   rw   rz   r   r   r   r   r   <module>r      s    " 	    / / E 0::>>34;t_) )7L 7Y= Y
 
 
 
	 	
 
>\ >

l 
,	 	
$ 

) 

) 
r   