Skip to content

[TRITON] Select correct fp8_e4m3 type for gfx950#1433

Merged
lucas-santos-amd merged 2 commits intomainfrom
bmazzott/fix_fav3_fp8_dtype
Nov 28, 2025
Merged

[TRITON] Select correct fp8_e4m3 type for gfx950#1433
lucas-santos-amd merged 2 commits intomainfrom
bmazzott/fix_fav3_fp8_dtype

Conversation

@brunomazzottiamd
Copy link
Contributor

@brunomazzottiamd brunomazzottiamd commented Nov 18, 2025

Motivation

FA v3 API introduced by #1065 sets the FP8 data type as torch.float8_e4m3fnuz. However, this type isn't supported by gfx950 and some unit tests were failing with errors raised by Triton compiler. We should use torch.float8_e4m3fn data type for gfx950.

I believe this detail went unnoticed in the original PR because our CI runs on gfx942.

Technical Details

Replace hardcoded torch.float8_e4m3fnuz data type by call to get_fp8_e4m3_dtype() AITER utility function. This function selects the FP8 data type supported by the architecture.

Test Plan

Run op_tests/triton_tests/test_mha.py, the test suite for Triton MHA.

Test Result

Running op_tests/triton_tests/test_mha.py on gfx950:

  • main branch: 1344 failed, 6049 passed, 2112 skipped.
  • This branch: 2 failed, 7391 passed, 2112 skipped. There are still 2 FP8 assertion errors on:
    • test_mha_varlen[True-False-32-16-16-0.0-False-False-4-4-57]
    • test_mha_varlen[True-False-32-16-16-0.0-False-False-4-4-128]

Extra

This PR also fixes a CI security issue. It was possible to trigger remote code execution on CI hosts if PR title contained substrings enclosed between backticks, i.e. `evil_command`.

Submission Checklist

@brunomazzottiamd brunomazzottiamd self-assigned this Nov 18, 2025
@brunomazzottiamd brunomazzottiamd added bug Something isn't working triton labels Nov 18, 2025
@brunomazzottiamd brunomazzottiamd changed the title [TRITON] Select correct fp8_e4m3 type for gfx950 [TRITON] Select correct 'fp8_e4m3' type for 'gfx950' Nov 18, 2025
@brunomazzottiamd brunomazzottiamd changed the title [TRITON] Select correct 'fp8_e4m3' type for 'gfx950' [TRITON] Select correct fp8_e4m3 type for gfx950 Nov 18, 2025
@brunomazzottiamd brunomazzottiamd marked this pull request as ready for review November 18, 2025 17:33
micmelesse
micmelesse previously approved these changes Nov 18, 2025
@brunomazzottiamd brunomazzottiamd changed the title [TRITON] Select correct fp8_e4m3 type for gfx950 [TRITON] Select correct fp8_e4m3 type for gfx950 Nov 18, 2025
@brunomazzottiamd brunomazzottiamd force-pushed the bmazzott/fix_fav3_fp8_dtype branch 2 times, most recently from 3b303e1 to ef1dacb Compare November 19, 2025 12:02
gyohuangxin
gyohuangxin previously approved these changes Nov 19, 2025
Copy link
Member

@gyohuangxin gyohuangxin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for improving the CI.

@brunomazzottiamd brunomazzottiamd force-pushed the bmazzott/fix_fav3_fp8_dtype branch from ef1dacb to f10a0a4 Compare November 19, 2025 18:36
micmelesse
micmelesse previously approved these changes Nov 19, 2025
@brunomazzottiamd brunomazzottiamd force-pushed the bmazzott/fix_fav3_fp8_dtype branch from f10a0a4 to cd90382 Compare November 21, 2025 12:51
@brunomazzottiamd brunomazzottiamd force-pushed the bmazzott/fix_fav3_fp8_dtype branch 3 times, most recently from d5085d5 to 3002754 Compare November 26, 2025 12:33
@brunomazzottiamd brunomazzottiamd force-pushed the bmazzott/fix_fav3_fp8_dtype branch from 3002754 to 12093b9 Compare November 27, 2025 12:36
Following GitHub Actions security recommendations available at
<https://docs.github.com/en/actions/reference/security/
secure-use#use-an-intermediate-environment-variable>.
@lucas-santos-amd lucas-santos-amd merged commit aa7d4b5 into main Nov 28, 2025
20 of 22 checks passed
@lucas-santos-amd lucas-santos-amd deleted the bmazzott/fix_fav3_fp8_dtype branch November 28, 2025 11:57
@brunomazzottiamd
Copy link
Contributor Author

Michael Melesse approved the changes related to MHA Triton kernel and Xin Huang approved the changes related to CI. Their approvals were dismissed due to some rebases, but the diff content that was merged is the same.

farlukas pushed a commit that referenced this pull request Dec 4, 2025
* Select correct `fp8_e4m3` type for `gfx950`

* Avoid shell command substitution in PR title

Following GitHub Actions security recommendations available at
<https://docs.github.com/en/actions/reference/security/
secure-use#use-an-intermediate-environment-variable>.
nsusanto pushed a commit that referenced this pull request Dec 4, 2025
* Select correct `fp8_e4m3` type for `gfx950`

* Avoid shell command substitution in PR title

Following GitHub Actions security recommendations available at
<https://docs.github.com/en/actions/reference/security/
secure-use#use-an-intermediate-environment-variable>.
zhuyuhua-v pushed a commit that referenced this pull request Dec 17, 2025
* Select correct `fp8_e4m3` type for `gfx950`

* Avoid shell command substitution in PR title

Following GitHub Actions security recommendations available at
<https://docs.github.com/en/actions/reference/security/
secure-use#use-an-intermediate-environment-variable>.
valarLip pushed a commit that referenced this pull request Mar 18, 2026
* Select correct `fp8_e4m3` type for `gfx950`

* Avoid shell command substitution in PR title

Following GitHub Actions security recommendations available at
<https://docs.github.com/en/actions/reference/security/
secure-use#use-an-intermediate-environment-variable>.
valarLip pushed a commit that referenced this pull request Mar 18, 2026
* Select correct `fp8_e4m3` type for `gfx950`

* Avoid shell command substitution in PR title

Following GitHub Actions security recommendations available at
<https://docs.github.com/en/actions/reference/security/
secure-use#use-an-intermediate-environment-variable>.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working triton

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants