§
    9˜ºhC  ã            	      óÞ   — d dl mZ d dlZd dlmZ d dlmZ d dlmZ d dl	m
Z
mZmZmZmZ d dlmZ  e
d¦  «        Z G d	„ d
e¦  «        Z G d„ dee         ¦  «        Z	 dddddddddœdd„ZdS )é    )ÚannotationsN)Ú	ASTSource)ÚLanguage)ÚJITFunction)ÚTypeVarÚOptionalÚCallableÚIterableÚUnion)ÚirÚTc                  ó(   ‡ — e Zd Zddˆ fd„Zd„ Zˆ xZS )ÚGluonASTSourceNÚreturnÚNonec                ó€   •— t          ¦   «                              ||||¦  «         t          j        | _        d| _        d S )NÚttgir)ÚsuperÚ__init__r   ÚGLUONÚlanguageÚext)ÚselfÚfnÚ	signatureÚ
constexprsÚattrsÚ	__class__s        €új/var/www/html/services/rag-service/venv/lib/python3.11/site-packages/triton/experimental/gluon/_runtime.pyr   zGluonASTSource.__init__   s5   ø€ Ý‰Œ×Ò˜˜Y¨
°EÑ:Ô:Ð:Ý œˆŒØˆŒˆˆó    c           	     óò  — ddl m} ddlm} t	          j        |¦  «        }|                     ¦   «         }t          j        j	        j
                             ¦   «         }	 ||	¦  «        }
|
                     |¦  «        }	|                     d|                     |	¦  «        ¦  «         |                     d|                     |j        ¦  «        ¦  «         |                     d|                     |j        ¦  «        ¦  «         |                     d|                     d¦  «        ¦  «         |j        �.|                     d	|                     |j        ¦  «        ¦  «          || j        | |||||¬
¦  «        }|S )Nr   )Úmake_backend)Úast_to_ttirz
ttg.targetzttg.num-warpszttg.num-ctaszttg.threads-per-warpé    zttg.maxnreg)ÚcontextÚoptionsÚcodegen_fnsÚ
module_mapÚmodule)Útriton.compiler.compilerr"   Útriton.compiler.code_generatorr#   r   ÚbuilderÚcreate_moduleÚtritonÚruntimeÚdriverÚactiveÚget_current_targetÚget_target_nameÚset_attrÚget_string_attrÚget_int32_attrÚ	num_warpsÚnum_ctasÚmaxnregr   )r   r&   r'   r(   r%   r"   r#   r,   r)   ÚtargetÚbackends              r   Úmake_irzGluonASTSource.make_ir   sn  € Ø9Ð9Ð9Ð9Ð9Ð9Ø>Ð>Ð>Ð>Ð>Ð>å”*˜WÑ%Ô%ˆØ×&Ò&Ñ(Ô(ˆõ ”Ô&Ô-×@Ò@ÑBÔBˆØ�,˜vÑ&Ô&ˆØ×(Ò(¨Ñ1Ô1ˆØ�Š˜ g×&=Ò&=¸fÑ&EÔ&EÑFÔFÐFØ�Š˜¨×)?Ò)?ÀÔ@QÑ)RÔ)RÑSÔSÐSØ�Š˜¨×(>Ò(>¸wÔ?OÑ(PÔ(PÑQÔQÐQØ�ŠÐ.°×0FÒ0FÀrÑ0JÔ0JÑKÔKÐKØŒ?Ð&Ø�OŠO˜M¨7×+AÒ+AÀ'Ä/Ñ+RÔ+RÑSÔSÐSà�˜TœW d°GÀWÐZeØ(2¸6ðCñ Cô Cˆàˆr    )NN)r   r   )Ú__name__Ú
__module__Ú__qualname__r   r<   Ú__classcell__©r   s   @r   r   r      sQ   ø€ € € € € ðð ð ð ð ð ð ð
ð ð ð ð ð ð r    r   c                  ó$   ‡ — e Zd Zˆ fd„Zd„ Zˆ xZS )ÚGluonJITFunctionc                ó`   •— t          ¦   «                              ¦   «         }t          | _        |S ©N)r   Úcreate_binderr   r   )r   Úresultr   s     €r   rF   zGluonJITFunction.create_binder,   s$   ø€ Ý‘”×&Ò&Ñ(Ô(ˆÝ'ˆŒØˆr    c                ó   — dS )NT© )r   s    r   Úis_gluonzGluonJITFunction.is_gluon1   s   € Øˆtr    )r=   r>   r?   rF   rJ   r@   rA   s   @r   rC   rC   *   sG   ø€ € € € € ðð ð ð ð ð
ð ð ð ð ð ð r    rC   )ÚversionÚreprÚlaunch_metadataÚdo_not_specializeÚdo_not_specialize_on_alignmentÚdebugÚnoinliner   úOptional[T]rL   úOptional[Callable]rM   rN   úOptional[Iterable[int | str]]rO   rP   úOptional[bool]rQ   r   ú9Union[GluonJITFunction[T], Callable[[T], JITFunction[T]]]c               óF   ‡‡‡‡‡‡‡— dˆˆˆˆˆˆˆfd„}| � || ¦  «        S |S )a<  
    Decorator for JIT-compiling a function using the Triton compiler.

    :note: When a jit'd function is called, arguments are
        implicitly converted to pointers if they have a :code:`.data_ptr()` method
        and a `.dtype` attribute.

    :note: This function will be compiled and run on the GPU. It will only have access to:

           * python primitives,
           * builtins within the triton package,
           * arguments to this function,
           * other jit'd functions

    :param fn: the function to be jit-compiled
    :type fn: Callable
    r   r   r   úJITFunction[T]c           
     óT   •— t          | ¦  «        sJ ‚t          | ‰‰‰‰‰‰‰¬¦  «        S )N)rK   rN   rO   rP   rQ   rL   rM   )ÚcallablerC   )r   rP   rN   rO   rM   rQ   rL   rK   s    €€€€€€€r   Ú	decoratorzjit.<locals>.decoratorR   sD   ø€ Ý˜‰|Œ|ÐÐÐÝØØØ/Ø+IØØØØ+ð	
ñ 	
ô 	
ð 		
r    N)r   r   r   rX   rI   )	r   rK   rL   rM   rN   rO   rP   rQ   r[   s	    ``````` r   Újitr\   5   sb   øøøøøøø€ ð:
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
€~Øˆy˜‰}Œ}Ðð Ðr    rE   )r   rR   rL   rS   rM   rS   rN   rT   rO   rT   rP   rU   rQ   rU   r   rV   )Ú
__future__r   r.   r*   r   Útriton.backends.compilerr   Útriton.runtime.jitr   Útypingr   r   r	   r
   r   Útriton._C.libtritonr   r   r   rC   r\   rI   r    r   ú<module>rb      s@  ðØ "Ð "Ð "Ð "Ð "Ð "Ø €€€Ø .Ð .Ð .Ð .Ð .Ð .Ø -Ð -Ð -Ð -Ð -Ð -Ø *Ð *Ð *Ð *Ð *Ð *Ø ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ø "Ð "Ð "Ð "Ð "Ð "à€GˆC�L„L€ðð ð ð ð �Yñ ô ð ð<ð ð ð ð �{ 1”~ñ ô ð ð ð.ð Ø#Ø*.Ø7;ØDHØ Ø#ð.ð .ð .ð .ð .ð .ð .ð .r    