Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use unified fp8 notation in FA #483

Merged
merged 1 commit into from
Mar 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions vllm/attention/ops/triton_flash_attention.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import triton
import triton.language as tl

from vllm.platforms import current_platform
from vllm.utils import is_navi

torch_dtype: tl.constexpr = torch.float16
Expand Down Expand Up @@ -391,7 +392,7 @@ def get_autotune_configs():

autotune_configs, autotune_keys = get_autotune_configs()

float8_info = torch.finfo(torch.float8_e4m3fnuz)
float8_info = torch.finfo(current_platform.fp8_dtype())


@triton.autotune(
Expand Down Expand Up @@ -834,7 +835,7 @@ def forward(
if fp8_scales is not None:
use_fp8 = True
(q_scale, k_scale, v_scale, p_scale, o_scale) = fp8_scales
float8 = torch.float8_e4m3fnuz
float8 = current_platform.fp8_dtype()

def check_and_convert(t, scale):
if t.dtype != float8:
Expand Down