
    eTh`              	       "   % S SK JrJr  SSKJr   S SKJrJrJrJ	r	  S SKJ
r  SrS\" SS	S
90S\" SSS
90S\" SSSS90S\" SSS
90S.r\\\\\\4   \4   4   \S'   \" \5        S r
S r/ SQrg! \ a    S r
 " S S5      rS r	S rSr N%f = f)    )DictUnion   )is_torchdynamo_compiling)DeviceLayerRepositoryregister_kernel_mappingreplace_kernel_forward_from_hub)use_kernel_forward_from_hubTcudaz!kernels-community/deformable-detrMultiScaleDeformableAttention)repo_id
layer_namezkernels-community/moeLlama4TextMoez#kernels-community/triton-layer-normLlamaRMSNormzpure-layer-test)r   r   revisionzmedmekk/triton-llama-mlpTritonLlamaMLP)r   r   RMSNormMLP_KERNEL_MAPPINGc                     ^ ^ U U4S jnU$ )a  
Expands `kernels`' `use_kernel_forward_from_hub` to NOT use a kernel at compile time. This should be removed
when `kernels` supports `torch.compile`.

If the layer has a `config` attribute, we can also set `config.disable_custom_kernels = True` to disable the
kernel.
c                    >^ ^^ T R                   m[        T0 TD6nU" T 5      m T R                   mU UU4S jnUT l         T $ )Nc                     > [        TS5      =(       a    [        TR                  SS 5      n[        5       (       d  U(       a  T" U 0 UD6$ T" U 0 UD6$ )Nconfigdisable_custom_kernels)hasattrgetattrr   r   )forward_argsforward_kwargsr   clskernel_forwardoriginal_forwards      ]/var/www/auris/envauris/lib/python3.13/site-packages/transformers/integrations/hub_kernels.pyforward_with_compile_pathcuse_kernel_forward_from_hub.<locals>.decorator_with_compile_path.<locals>.forward_with_compile_pathS   sP    )0h)?)wGCJJXprvDw&+--1G+\L^LL)<J>JJ    )forward$original_use_kernel_forward_from_hub)r    	decoratorr$   r!   r"   argskwargss   `  @@r#   decorator_with_compile_path@use_kernel_forward_from_hub.<locals>.decorator_with_compile_pathH   sF    "{{ =dMfMIC.C ![[NK 4CKJr&    )r*   r+   r,   s   `` r#   r   r   ?   s    	, +*r&   c                      S nU$ )Nc                     U $ Nr.   )r    s    r#   r)   .use_kernel_forward_from_hub.<locals>.decoratore   s    Jr&   r.   )r*   r+   r)   s      r#   r   r   d   s    	 r&   c                       \ rS rSrS rSrg)r   j   c                     [        S5      e)NzNLayerRepository requires `kernels` to be installed. Run `pip install kernels`.RuntimeError)selfr*   r+   s      r#   __init__LayerRepository.__init__k   s    oppr&   r.   N)__name__
__module____qualname____firstlineno__r9   __static_attributes__r.   r&   r#   r   r   j   s    	qr&   r   c                      [        S5      e)Nz^replace_kernel_forward_from_hub requires `kernels` to be installed. Run `pip install kernels`.r6   r*   r+   s     r#   r
   r
   n   s    l
 	
r&   c                      [        S5      e)NzVregister_kernel_mapping requires `kernels` to be installed. Run `pip install kernels`.r6   rA   s     r#   r	   r	   s   s    sttr&   Fc                      [         $ r1   )_hub_kernels_availabler.   r&   r#   is_hub_kernels_availablerE   y   s    !!r&   )r   rE   r   r	   r
   N)typingr   r   utilsr   kernelsr   r   r	   r
   r   r(   rD   r   str__annotations__ImportErrorrE   __all__r.   r&   r#   <module>rM      s	     ,c#  " O;:*
 O/*
 O=)*
 O2+
+MOT#tE&#+$6$GHHI : O,+t"9  #q q

u #+#s   AA0 0BB