Repository navigation
[ASM] mla_decode_fwd: wire is_causal through Python and C++ dispatch - #3993
Merged
Merged
Conversation
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
alexioslyrakis-amd
force-pushed
the
alyr/mla-is-causal-bugfix
branch
from
June 29, 2026 09:53
e5cb9e6 to
f25961f
Compare
Contributor
|
No activity for 15 days, so this is now labelled |
Register the unmasked GQA=8, qseqlen=2 kernel with causal=0 so it no longer competes with the masked variant for causal=1 dispatch. Enable the existing BF16 op test for this non-causal gfx950 case.
alexioslyrakis-amd
force-pushed
the
alyr/mla-is-causal-bugfix
branch
from
October 7, 2026 09:12
33149d5 to
d77199e
Compare
amd-ruitang3
approved these changes
Oct 21, 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.
For gfx950 BF16 decode with 8 query heads and 2 query tokens, both the masked and unmasked kernels are registered with
causal=1. This gives causal dispatch two matching kernels (the current C++ heuristic selected the unmasked kernel in a CPU reproduction), whilecausal=Falsehas no matching kernel.Register the unmasked kernel with
causal=0, leaving one correct match for each mode. Also allow the existing BF16 op test to exercise this non-causal gfx950 case instead of skipping it.The Python-to-C++ causal parameter forwarding is already present on
mainvia #4565. This patch uses the existingcausalAPI and fixes the remaining dispatch regression for the original two-token case.Validation:
Compiled the current
get_heuristic_kernel_mlafunction in a CPU harness against the config header produced byhsa/codegen.py. Before the fix: zero non-causal matches and two causal matches. After the fix: one match per mode, selectingmla_a16w16_qh8_qseqlen2_gqaratio8.cofor non-causal andmla_a16w16_qh8_qseqlen2_gqaratio8_causal.cofor causal.Evaluated the test support predicate over 600 architecture/dtype/head/query-length/causal combinations; only the intended gfx950 BF16 non-causal two-token case becomes enabled.
python3 -m black --check op_tests/test_mla.py,python3 -m ruff check op_tests/test_mla.py, andgit diff --checkpass.On gfx950, run: