[Codegen] Add matmul and batched matmul to list of ops to generalize#21720
Merged
Conversation
08feaad to
c07b891
Compare
kuhar
reviewed
Aug 17, 2025
kuhar
left a comment
Member
There was a problem hiding this comment.
This PR includes a workaround option for SPIRV which still matches on MatMulOp
Could you open an issue for this and add it as a TODO in a code comment in this PR?
Contributor
Author
|
In light of #21344 it makes sense to do this properly (i.e. get rid of the flag for SPIRV to optionally not generalize matmul)... coming soon |
78d5278 to
eb1aa2b
Compare
Signed-off-by: James Newling <james.newling@gmail.com>
Signed-off-by: James Newling <james.newling@gmail.com>
eb1aa2b to
21ee0d4
Compare
Signed-off-by: James Newling <james.newling@gmail.com>
Signed-off-by: James Newling <james.newling@gmail.com>
Signed-off-by: James Newling <james.newling@gmail.com>
Signed-off-by: James Newling <james.newling@gmail.com>
Signed-off-by: James Newling <james.newling@gmail.com>
kuhar
reviewed
Aug 18, 2025
Signed-off-by: James Newling <james.newling@gmail.com>
5764481 to
7e0daa7
Compare
Signed-off-by: James Newling <james.newling@gmail.com>
Contributor
Author
|
@kuhar I think I've addressed your comments |
Contributor
Author
|
ping |
kuhar
approved these changes
Aug 21, 2025
AWoloszyn
pushed a commit
that referenced
this pull request
Dec 1, 2025
…21720) Changes in this PR are 1) carry 'compilation info' across from linalg.matmul (or other named op) to linalg.generic when running the generalize pass. See for example the test `lowering_matmul_promotion.mlir` 2) Refactoring the SPIRV configuration selection. This now fails if a matmul/batch_matmul appears in specialized form. 3) One nvidia test now uses a different pipeline. It matches earlier in the selection process for something more specialized. Looking at the history of the config selected, it looks like it used to choose a more specialised config anyway: https://github.com/iree-org/iree/blame/80af7ac6546a9d6975f2c5dbbb1d68e3c640565a/compiler/src/iree/compiler/Codegen/SPIRV/test/config_nvidia_matmul.mlir#L61 --------- Signed-off-by: James Newling <james.newling@gmail.com>
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.
Changes in this PR are
carry 'compilation info' across from linalg.matmul (or other named op) to linalg.generic when running the generalize pass. See for example the test
lowering_matmul_promotion.mlirRefactoring the SPIRV configuration selection. This now fails if a matmul/batch_matmul appears in specialized form.
One nvidia test now uses a different pipeline. It matches earlier in the selection process for something more specialized. Looking at the history of the config selected, it looks like it used to choose a more specialised config anyway: https://github.com/iree-org/iree/blame/80af7ac6546a9d6975f2c5dbbb1d68e3c640565a/compiler/src/iree/compiler/Codegen/SPIRV/test/config_nvidia_matmul.mlir#L61