[AIROCMLIR-537] Add fusion check for attention with splitKV > 1#2254
Merged
justinrosner merged 4 commits intodevelopfrom Feb 26, 2026
Merged
[AIROCMLIR-537] Add fusion check for attention with splitKV > 1#2254justinrosner merged 4 commits intodevelopfrom
justinrosner merged 4 commits intodevelopfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements fusion legality checks for attention operations with flash decoding (splitKV > 1) to ensure that fusions are properly disabled when partial results require LSE-based corrections in a subsequent stage.
Changes:
- Added a new fusion legality check function
testFusionLegalityAttentionSplitKVto prevent fusion for attention ops with splitKV > 1 - Integrated the new check into the
isModuleFusiblefunction to be evaluated alongside other fusion legality checks - Added test coverage to verify that fusion is disabled when attention operations use splitKV > 1
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| mlir/test/fusion/fusability-attention-splitkv-output-fusion.mlir | New test file that verifies fusion is disabled (fusible:0) for attention ops with splitKV = 4 |
| mlir/lib/Dialect/Rock/utility/fusionUtils.cpp | Implements testFusionLegalityAttentionSplitKV functions (FuncOp and ModuleOp overloads) following established patterns for fusion legality checks |
| mlir/lib/Dialect/Rock/Tuning/RockTuningImpl.cpp | Integrates the new attention splitKV check into the isModuleFusible function |
| mlir/include/mlir/Dialect/Rock/utility/fusionUtils.h | Declares the new fusion legality check functions with documentation explaining the constraint |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
umangyadav
approved these changes
Feb 25, 2026
5d51869 to
48ef22d
Compare
dhernandez0
reviewed
Feb 26, 2026
dhernandez0
reviewed
Feb 26, 2026
dhernandez0
reviewed
Feb 26, 2026
dhernandez0
approved these changes
Feb 26, 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.
Motivation
This PR adds some additional fusion checks to ensure that we always return a result of
fusible: 0for attention ops with splitKV > 1. This implements: https://amd-hub.atlassian.net/browse/AIROCMLIR-537Technical Details
Added a new function called
testFusionLegalityAttentionSplitKVthat make sure that fusions are disabled withsplitKV > 1Test Plan
Test Result
Submission Checklist