o
    ik                     @   s&   d dl Z d dlmZ e jdd ZdS )    Nc                 C   s   |t jkr
d}d}n'|t jkrd}d}n|t jkrd}d}n|t jkr(d}d}n	t d	d
|  t | t j| |||S )zScales a value and clamps it to the range of the target dtype.

    This function hard-wires the upper/lower bounds in order to be
    compatible with both `torch.compile` and `triton.jit`.
    g      |g      |@g      g      @g     g     @g     g     GFzUnsupported dtype: )	tl
float8e4nvfloat8e5float16bfloat16static_assertclamptofloat32)xscaledtype	clamp_min	clamp_max r   U/home/ubuntu/vllm_env/lib/python3.10/site-packages/flashinfer/triton/kernels/quant.pyscale_and_clamp   s   



 r   )tritontriton.languagelanguager   jitr   r   r   r   r   <module>   s    