+
    &j                     >   ^ RI t ^ RIt^ RIt^ RIHt ] P
                  R R l4       t] P
                  RR R ll4       t] P
                  R R l4       t] P
                  R	 R
 l4       t	] P
                  R R l4       t
] P
                  R R l4       t] P
                  R R l4       t] P
                  R R l4       t] P                  ! R4      R R l4       t] P
                  R R l4       t] P
                  R R l4       tR R lt] P
                  R R l4       tR# )    NAnyc                $    V ^8  d   QhR\         /#    returnbool)formats   "k/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/torch/utils/_triton.py__annotate__r      s      D     c                  4     ^ RI p R#   \         d     R# i ; i)r   NTF)tritonImportError)r   s    r   has_triton_packager      s     s    c                t    V ^8  d   QhR\         \        \        3,          R\         \        \        3,          /# )r   fallbackr   )tupleint)r   s   "r   r   r      s*      sCx eCHo r   c                     ^ RI p\        ;QJ d4    . R VP                  P                  R4      R,           4       F  NK  	  5M-! R VP                  P                  R4      R,           4       4      w  r#W#3#   \         d    T u # i ; i)r   Nc              3   8   "   T F  p\        V4      x  K  	  R # 5iN)r   ).0vs   & r   	<genexpr>%get_triton_version.<locals>.<genexpr>   s     O-NSVV-Ns   .:Nr   N)r   r   __version__splitr   )r   r   majorminors   &   r   get_triton_versionr#      sr    uOV-?-?-E-Ec-J2-NOuuOV-?-?-E-Ec-J2-NOO~ s   A7 A%A7 7BBc                $    V ^8  d   QhR\         /# r   r	   )r   s   "r   r   r      s      d r   c                      ^ RI p V P                  P                  4       ;'       dA    V P                  P                  4       R8  ;'       d    V P                  P
                  '       * # )r   N	   r   )torchcudais_availableget_device_capabilityversionhipr(   s    r   _device_supports_tmar/      sU     	

! 	" 	"JJ,,.&8	" 	"!!!r   c                $    V ^8  d   QhR\         /# r   r	   )r   s   "r   r   r   (   s      $ r   c                      \        4       '       d(   \        4       '       d    ^ RIHp Hp  ^ RIHp V! 4       # R#   \         d     R# i ; i  \         d     R# i ; i)r   )create_1d_tma_descriptorcreate_2d_tma_descriptor)enable_in_pytorchTF)r   r/   $triton.tools.experimental_descriptorr2   r3   r4   r   )r2   r3   r4   s      r    has_triton_experimental_host_tmar6   '   s\    !!
 V,..  #    s,   A : A	A A		A AAc                $    V ^8  d   QhR\         /# r   r	   )r   s   "r   r   r   >   s      t r   c                  |    \        4       '       d   \        4       '       d
    ^ RIHp  R# R#   \         d     R# i ; i)r   TensorDescriptorTF)r   r/   triton.tools.tensor_descriptorr:   r   r9   s    r   %has_triton_tensor_descriptor_host_tmar<   =   s?    !!    s   , ;;c                $    V ^8  d   QhR\         /# r   r	   )r   s   "r   r   r   N   s     Y Y Yr   c                  :    \        4       ;'       g    \        4       # r   )r<   r6    r   r   has_triton_tmar@   M   s    02XX6V6XXr   c                $    V ^8  d   QhR\         /# r   r	   )r   s   "r   r   r   S   s      t r   c                     \        4       '       d   ^ RIp V P                  P                  4       '       d<   V P                  P	                  4       R8  d   V P
                  P                  '       d!   V P                  P                  4       '       d    ^ RIH	pH
p R# R#   \         d     Mi ; i ^ RIHp R#   \         d     R# i ; i)r   N)&experimental_device_tensormap_create1d&experimental_device_tensormap_create2dTmake_tensor_descriptorFr&   )r   r(   r)   r*   r+   r,   r-   xputriton.language.extra.cudarC   rD   r   triton.languagerF   )r(   rC   rD   rF   s       r   has_triton_tma_devicerJ   R   s     JJ##%%

002f<MM%%%YY##%%
    B s$   B B+*B+/B7 7CCc                $    V ^8  d   QhR\         /# r   r	   )r   s   "r   r   r   s   s      T r   c                  :   ^ RI p V P                  P                  4       '       dw   V P                  P                  4       R8  dX   V P                  P                  4       R8  d9   V P                  P
                  '       g   \        4       ;'       d    \        4       # R# )r   NF)
   r   )   r   )r(   r)   r*   r+   r,   r-   rJ   r<   r.   s    r   #has_datacenter_blackwell_tma_devicerO   r   sl     	

!!JJ,,.'9JJ,,.8!!!$&RR+P+RRr   c                $    V ^8  d   QhR\         /# r   r	   )r   s   "r   r   r      s      4 r   c                  Z   \        4       '       d   ^ RIp V P                  P                  4       '       d<   V P                  P	                  4       R8  d   V P
                  P                  '       d!   V P                  P                  4       '       d
    ^ RIH	p R# R#   \         d     R# i ; i)r   NrE   TFr&   )r   r(   r)   r*   r+   r,   r-   rG   rI   rF   r   )r(   rF   s     r   has_triton_stable_tma_apirR      s     JJ##%%

002f<MM%%%YY##%%B   s   B B*)B*c                $    V ^8  d   QhR\         /# r   r	   )r   s   "r   r   r      s     $. $.D $.r   c                     aa \        4       '       g   R # ^ RIHp  V '       d   R # ^ RIHo R R lpR R lpR R lpR	VR
VRVRV/oR VV3R llpV! 4       # )F)triton_disable_device_detection)get_interface_for_devicec                0    V ^8  d   QhR\         R\        /# r   device_interfacer   r   r
   )r   s   "r   r    has_triton.<locals>.__annotate__   s     J J3 J4 Jr   c                 P    V P                   P                  4       P                  ^8  # )   )Workerget_device_propertiesr!   rY   s   &r   cuda_extra_check$has_triton.<locals>.cuda_extra_check   s"    &&<<>DDIIr   c                0    V ^8  d   QhR\         R\        /# rX   rZ   )r   s   "r   r   r[      s     1 1# 1$ 1r   c                 <    ^ RI pRVP                  P                  9   # )r   Ncpu)triton.backendsbackends)rY   r   s   & r   cpu_extra_check#has_triton.<locals>.cpu_extra_check   s    0000r   c                0    V ^8  d   QhR\         R\        /# rX   rZ   )r   s   "r   r   r[      s      s t r   c                     R # )Tr?   r`   s   &r   _return_true has_triton.<locals>._return_true   s    r   r)   rG   re   mtiac                $    V ^8  d   QhR\         /# r   r	   )r   s   "r   r   r[      s      d r   c                     < SP                  4        F6  w  rS! V 4      pVP                  4       '       g   K%  V! V4      '       g   K5   R # 	  R# )TF)itemsr*   )deviceextra_checkrY   rV   triton_supported_devicess      r    is_device_compatible_with_triton4has_triton.<locals>.is_device_compatible_with_triton   sG    #;#A#A#CF7?,,..;?O3P3P $D r   )r   torch._inductor.configrU   torch._dynamo.device_interfacerV   )rU   ra   rh   rl   ru   rV   rt   s        @@r   
has_tritonry      s_    F&GJ1
 	 |	   ,--r   c                $    V ^8  d   QhR\         /# r   r   )r   s   "r   r   r      s          r   c                  ^    ^ RI Hp  ^ RIHp VP                  P                  4       pV ! V4      # )r   )make_backend)driver)triton.compiler.compilerr|   triton.runtime.driverr}   activeget_current_target)r|   r}   targets      r   triton_backendr      s%    5,]]--/Fr   c                0    V ^8  d   QhR\         R\        /# )r   backendr   )r   str)r   s   "r   r   r      s      c c r   c                   V P                  / 4      p\        VRR4      pV'       g   R# . p\        V4       F  w  rE\        P                  P                  V4      '       g   K,  \        VR4      ;_uu_ 4       pVP                  V R\        P                  ! VP                  4       4      P                  4        24       RRR4       K  	  RP                  V4      #   + '       g   i     K  ; i)zReturn a cache key fragment for extern libs (e.g. libdevice.10.bc).

These files affect codegen but are not covered by triton_key() (Python
sources only) or backend.hash() (ptxas version and arch only).
extern_libsN rb-)parse_optionsgetattrsortedospathisfileopenappendhashlibsha256read	hexdigestjoin)r   optsr   partsnamer   fs   &      r   _extern_libs_keyr      s       $D$t4KE[)
77>>$dD!!QvQw~~affh'?'I'I'K&LMN "! * 88E? "!!s   6ACC+c                $    V ^8  d   QhR\         /# r   )r   )r   s   "r   r   r      s     C C# Cr   c                      ^ RI Hp  \        4       pV ! 4        RVP                  4        2p\        P
                  ! VP                  R4      4      P                  4       P                  4       # )r   )
triton_keyr   zutf-8)	%torch._inductor.runtime.triton_compatr   r   hashr   r   encoder   upper)r   r   keys      r   triton_hash_with_backendr      sR    @G\N!GLLN+
,C >>#**W-.88:@@BBr   ))r   r   )	functoolsr   r   typingr   cacher   r#   r/   r6   r<   r@   rJ   rO   	lru_cacherR   ry   r   r   r   r?   r   r   <module>r      sB     	         *   Y Y  >   T $ $. $.N    $ C Cr   