bf16 asm mha: enable doubleq and kv reverse to improve perf#4068
Open
tingchen988 wants to merge 1 commit into
Open
bf16 asm mha: enable doubleq and kv reverse to improve perf#4068tingchen988 wants to merge 1 commit into
tingchen988 wants to merge 1 commit into
Conversation
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
valarLip
reviewed
Jul 5, 2026
| // 6 = 0b110 -> reverse_kv=0, double_q=1, remap_xy=1. Must match how the | ||
| // shipped VARLEN .co was built. | ||
| args.opt = 4; | ||
| args.opt = 7; |
Contributor
Author
There was a problem hiding this comment.
tg num would be automatically changed according to args.opt in line 252.
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.
Motivation
[gfx1250] fmha fwd bf16 hdim128/64 support per tensor bf16 for gfx1250: enable doubleq and kv reverse to improve perf
Technical Details
change a runtime arg in csrc/py_itfs_cu/asm_fmha_fwd_with_sink_varlen.cu
Test Plan
python3 op_tests/test_fmha_fwd_with_sink_varlen_asm.py
Test Result
Function test:
pytest op_tests/test_fmha_fwd_with_sink_varlen_asm.py::test_fmha_fwd_with_sink_varlen_asm_correctness -v -s
test pass
Perf test:
pytest op_tests/test_fmha_fwd_with_sink_varlen_asm.py::test_fmha_fwd_with_sink_varlen_asm_perf -v -s
perf would be improved by ~2% with doubleq and kv reverse
Submission Checklist