Repository navigation
Fix FA3 being selected on ROCm devices - #4778
Merged
Merged
Conversation
get_cuda_flash_attention_impl() gates on has_cuda_capability(), which is
torch.cuda.get_device_capability() >= (major, minor) with no vendor check.
AMD devices report a capability through that same API, and gfx950 (MI350X)
reports (9, 5) -- so the (9, 0) test passes and FA3 is selected on hardware
that has no FA3 to select. torch's flash_attn_interface is CUDA-only, so
activate_flash_attention_impl("FA3") then fails.
Return None on a ROCm build, which is what the rest of the function already
does for architectures with no supported implementation, leaving torch's
default attention path in place.
Reproduced on 8x MI350X (gfx950) with the llama3 varlen attention backend.
Johnsonms
requested review from
fegin,
tianyu-l,
wconstab and
wwwjn
as code owners
September 18, 2026 03:50
|
|
|
The following ciflow label(s) have been added but CI has not been triggered yet because the workflows are awaiting approval:
Once a maintainer approves the workflows (scroll to the bottom of the PR page), the corresponding CI jobs will be triggered automatically. Please ping one of the reviewers if you do not have access to approve and run workflows. |
tianyu-l
approved these changes
Sep 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
get_cuda_flash_attention_impl() gates on has_cuda_capability(), which is torch.cuda.get_device_capability() >= (major, minor) with no vendor check. AMD devices report a capability through that same API, and gfx950 (MI350X) reports (9, 5) -- so the (9, 0) test passes and FA3 is selected on hardware that has no FA3 to select. torch's flash_attn_interface is CUDA-only, so activate_flash_attention_impl("FA3") then fails.
Return None on a ROCm build, which is what the rest of the function already does for architectures with no supported implementation, leaving torch's default attention path in place.
Reproduced on 8x MI350X (gfx950) with the llama3 varlen attention backend.