�
2��g� � �� � d dl mZ d dl mZ ddlmZ ddlmZ ej d� � Zdee defd �Z
d
e dej egef fd�Zd
e dej egef fd�Z
d
e dej egef fd
�Zej e
g d��� � e
d� � d6d�� � � � � � Zej e
ddg�� � ed� � ej d6d�� � � � � � � � Zej e
ddg�� � ed� � ej d6d�� � � � � � � � Zej e
ddg�� � ed� � ej d6d�� � � � � � � � Zej e
ddg�� � ed� � ej d6d�� � � � � � � � Zej e
ddg�� � ed� � ej d6d�� � � � � � � � Zej e
ddg�� � ed� � ej d6d �� � � � � � � � Zej e
ddg�� � ed!� � ej d6d"�� � � � � � � � Zej e
dg�� � ed#� � ej d6d$�� � � � � � � � Zej e
ddg�� � ed%� � ej d6d&�� � � � � � � � Zej ed'� � ej d6d(�� � � � � � Zej e
d)� � d7d+�� � � � Zej e
dg�� � e
d,� � d6d-�� � � � � � Zej e
ddg�� � ed.� � ej d6d/�� � � � � � � � Zej e
ddg�� � ed0� � ej d6d1�� � � � � � � � Zej e
ddg�� � ed2� � ej d6d3�� � � � � � � � Z ej ed4� � d6d5�� � � � Z!dS )8� )�core)�semantic� ��wraps)�List�T�dtypes�returnc � � � � fd�}|S )al
We're following libdevice's convention to check accepted data types for math functions.
It is not a good practice to support all data types as accelerators/GPUs don't support
many float16 and bfloat16 math operations.
We should let the users know that they are using and invoke explicit cast to convert
the data type to the supported one.
c �@ �� � t � � � �� fd�� � }|S )Nc � �� t | � � t |� � � � � z }d� |D � � D ]9}|j j j �vr$t d�� d|j j j � �� � ��: �| i |��S )Nc �F � g | ]}t |t j � � �|��S � )�
isinstancer �tensor)�.0�as �d/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/triton/language/math.py�
<listcomp>z@_check_dtype.<locals>.wrapper.<locals>.check.<locals>.<listcomp> s) � �J�J�J�a�z�!�T�[�/I�/I�J��J�J�J� zExpected dtype z but got )�list�values�type�scalar�name�
ValueError)�args�kwargs�all_args�argr
�fns ��r �checkz,_check_dtype.<locals>.wrapper.<locals>.check s� �� � �D�z�z�D������$9�$9�9�H�J�J�8�J�J�J�
`�
`���8�?�'�v�5�5�$�%^�v�%^�%^����H\�%^�%^�_�_�_� 6��2�t�&�v�&�&�&r r )r"