�
2��gP � � � d dl mZ ddlmZ ddlmZ dZeefdej fd�� � Zeefdej fd�� � Z eefdej fd �� � Z
eefdej fd
�� � Zed� � � Zeefdej fd�� � Z
eefdej fd
�� � Zed� � � Zeefdej fd�� � Zeefdej fd�� � ZdS )� )�jit� )�core)�math�
�n_roundsc �| � | j t j k r d}d}d} d}
n0t j | j t j k d� � d}d}d} d }
t j |� � D ]T}| }|
}
| |}}t
j |
|� � |z |z } t
j ||� � |z |z }|
|z }||z }||z }||z }�U| |||fS )
zV
Run `n_rounds` rounds of Philox for state (c0, c1, c2, c3) and key (k0, k1).
l �yn< l �.�v l S�$ l W
= z"dtype not supported in philox_impll |�~�f�q l ;'� :=[ l �l�B;:
l W$*� �R )�dtype�tl�uint32�
static_assert�uint64�static_ranger �umulhi)�c0�c1�c2�c3�k0�k1r �PHILOX_KEY_A�PHILOX_KEY_B�PHILOX_ROUND_A�PHILOX_ROUND_B�_�A�B�_c0�_c2s �f/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/triton/language/random.py�philox_implr! s� � �
�x�2�9���%/��%/��'1��'1���
����R�Y�.�0T�U�U�U�%7��%7��'9��'9��
�_�X�
&�
&� � ��
�����r�S��
�[��C�
�
�2�
%��
*��
�[��C�
�
�2�
%��
*��
��W��
��W��
�,�
��
�,�
���
�r�2�r�>�� c � � t j | � � } t j |� � }t j |� � }t j |� � }t j |� � }| � t j � � } t j |j j � � dk rTt j }| dz dz � t j � � }| dz � t j � � }nZt j t j |j j � � dk d� � t j }t j dd|�� � }| }|� |d� � � }|� |d� � � }|� |d� � � }|� |d� � � }t |||||||� � S )
N� l �� �@ z bitwidth not supported in philox)r � )r
T��bitcast)r � to_tensor�tor � constexprr
�primitive_bitwidthr r
�fullr! ) �seedr r r r r � int_dtype�seed_hi�seed_los r �philoxr2 - ss � �
�<����D� ��b� � �B� ��b� � �B� ��b� � �B� ��b� � �B��7�7�2�9���D� �|�B�H�/�0�0�B�6�6��I� ��B�J�*�,�0�0���;�;���*�$�(�(���3�3���
����b�h�&A�B�B�b�H�Jl�m�m�m��I� ��'�%��)�4�4�4���� ���y�$�� '� '�B� ���y�$�� '� '�B� ���y�$�� '� '�B� ���y�$�� '� '�B��r�2�r�2�w���B�B�Br"