-
Notifications
You must be signed in to change notification settings - Fork 18.1k
[mlir][vector] Wrapping populateFlattenVectorTransferPatterns as a transform pass.
#178134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+59
−0
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a782e6f
Wrapping populateFlattenVectorTransferPatterns as a transform pass
arun-thmn 1887de8
fixing a clang-format error
arun-thmn 32eeea8
added an argument + one test-case for validation
arun-thmn ad9384d
added an argument + one test-case for validation
arun-thmn 3daa0e9
moving the schedule to vector dialect
arun-thmn 639724a
moved the unit-test into an existing test file
arun-thmn e642f24
minor formatting changes
arun-thmn 28ef063
moving the width size option
arun-thmn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
|
arun-thmn marked this conversation as resolved.
Outdated
|
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| // RUN: mlir-opt %s -transform-interpreter -cse -split-input-file | FileCheck %s | ||
|
|
||
| func.func @flatten_transfer_ops(%arg0: memref<16x16xf32>, %arg1: vector<8xf32>) -> vector<8xf32> { | ||
| %c0 = arith.constant 0 : index | ||
| %c8 = arith.constant 8 : index | ||
| %b0 = ub.poison : f32 | ||
| %0 = vector.transfer_read %arg0[%c0, %c0], %b0 {in_bounds = [true, true]} : memref<16x16xf32>, vector<1x8xf32> | ||
| %1 = vector.transfer_read %arg0[%c0, %c8], %b0 {in_bounds = [true, true]} : memref<16x16xf32>, vector<1x8xf32> | ||
| %2 = vector.shape_cast %0 : vector<1x8xf32> to vector<8xf32> | ||
| %3 = vector.shape_cast %1 : vector<1x8xf32> to vector<8xf32> | ||
| %4 = vector.fma %2, %3, %arg1 : vector<8xf32> | ||
| return %4 : vector<8xf32> | ||
| } | ||
|
|
||
| // CHECK-LABEL: @flatten_transfer_ops | ||
| // CHECK-NOT: vector.transfer_read {{.*}}, vector<1x8xf32> | ||
| // CHECK-NOT: vector.transfer_read {{.*}}, vector<1x8xf32> | ||
| // CHECK: vector.transfer_read {{.*}}, vector<8xf32> | ||
| // CHECK-NEXT: vector.transfer_read {{.*}}, vector<8xf32> | ||
| // CHECK-NOT: vector.shape_cast | ||
| // CHECK-NOT: vector.shape_cast | ||
|
|
||
| module attributes {transform.with_named_sequence} { | ||
| transform.named_sequence @__transform_main(%arg1: !transform.any_op {transform.readonly}) { | ||
| %func = transform.structured.match ops{["func.func"]} in %arg1 : (!transform.any_op) -> !transform.any_op | ||
| transform.apply_patterns to %func { | ||
| transform.apply_patterns.vector.flatten_vector_transfer_ops | ||
| } : !transform.any_op | ||
| transform.yield | ||
| } | ||
| } |
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
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.
Uh oh!
There was an error while loading. Please reload this page.