-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[mlir][vector] Update ApplyVectorReductionToContractPatternsOp #136699
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
[mlir][vector] Update ApplyVectorReductionToContractPatternsOp #136699
Conversation
This PR removes the use of `populateSinkVectorOpsPatterns` from the definition of: * `transform.apply_patterns.vector.reduction_to_contract` As of llvm#131462, there is now a dedicated transform op for this pattern: * `transform.apply_patterns.vector.sink_op` Given that, we should now use the new TD op directly instead of relying on unrelated TD ops to include it. NOTE TO DOWNSTREAM USERS: Please add the following to your TD scripts: * `transform.apply_patterns.vector.sink_op` See the updated test for an example.
@llvm/pr-subscribers-mlir-sme @llvm/pr-subscribers-mlir-vector Author: Andrzej Warzyński (banach-space) ChangesThis PR removes the use of
As of #131462, there is now a dedicated transform op for this pattern:
Given that, we should now use the new TD op directly instead of relying NOTE TO DOWNSTREAM USERS:
See the updated test for an example. Full diff: https://github.com/llvm/llvm-project/pull/136699.diff 3 Files Affected:
diff --git a/mlir/lib/Dialect/Vector/TransformOps/VectorTransformOps.cpp b/mlir/lib/Dialect/Vector/TransformOps/VectorTransformOps.cpp
index 12dcf768dd928..adc1dd437326f 100644
--- a/mlir/lib/Dialect/Vector/TransformOps/VectorTransformOps.cpp
+++ b/mlir/lib/Dialect/Vector/TransformOps/VectorTransformOps.cpp
@@ -67,10 +67,6 @@ void transform::ApplyFoldElementwiseToVectorPatternsOp::populatePatterns(
void transform::ApplyVectorReductionToContractPatternsOp::populatePatterns(
RewritePatternSet &patterns) {
vector::populateVectorReductionToContractPatterns(patterns);
-
- // TODO: As we now have a dedicated transform for
- // `populateSinkVectorOpsPatterns` we can remove it from here.
- vector::populateSinkVectorOpsPatterns(patterns);
}
void transform::ApplyLowerCreateMaskPatternsOp::populatePatterns(
diff --git a/mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/matmul.mlir b/mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/matmul.mlir
index 29b0bc0c19606..ad7dbb9f7e126 100644
--- a/mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/matmul.mlir
+++ b/mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/matmul.mlir
@@ -79,6 +79,7 @@ module attributes {transform.with_named_sequence} {
transform.apply_patterns.vector.lower_masked_transfers
transform.apply_patterns.vector.transfer_permutation_patterns
transform.apply_patterns.vector.reduction_to_contract
+ transform.apply_patterns.vector.sink_ops
} : !transform.any_op
// Step 5: Lower vector.contract to vector.outerproduct. Also drop unit
diff --git a/mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/multi-tile-matmul-mixed-types.mlir b/mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/multi-tile-matmul-mixed-types.mlir
index 78815a38612e9..71798a6affbbc 100644
--- a/mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/multi-tile-matmul-mixed-types.mlir
+++ b/mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/multi-tile-matmul-mixed-types.mlir
@@ -94,6 +94,7 @@ module attributes {transform.with_named_sequence} {
transform.apply_patterns.vector.lower_masked_transfers
transform.apply_patterns.vector.transfer_permutation_patterns
transform.apply_patterns.vector.reduction_to_contract
+ transform.apply_patterns.vector.sink_ops
} : !transform.any_op
// Step 5: Lower vector.contract to vector.outerproduct. Also drop unit
|
@llvm/pr-subscribers-mlir-linalg Author: Andrzej Warzyński (banach-space) ChangesThis PR removes the use of
As of #131462, there is now a dedicated transform op for this pattern:
Given that, we should now use the new TD op directly instead of relying NOTE TO DOWNSTREAM USERS:
See the updated test for an example. Full diff: https://github.com/llvm/llvm-project/pull/136699.diff 3 Files Affected:
diff --git a/mlir/lib/Dialect/Vector/TransformOps/VectorTransformOps.cpp b/mlir/lib/Dialect/Vector/TransformOps/VectorTransformOps.cpp
index 12dcf768dd928..adc1dd437326f 100644
--- a/mlir/lib/Dialect/Vector/TransformOps/VectorTransformOps.cpp
+++ b/mlir/lib/Dialect/Vector/TransformOps/VectorTransformOps.cpp
@@ -67,10 +67,6 @@ void transform::ApplyFoldElementwiseToVectorPatternsOp::populatePatterns(
void transform::ApplyVectorReductionToContractPatternsOp::populatePatterns(
RewritePatternSet &patterns) {
vector::populateVectorReductionToContractPatterns(patterns);
-
- // TODO: As we now have a dedicated transform for
- // `populateSinkVectorOpsPatterns` we can remove it from here.
- vector::populateSinkVectorOpsPatterns(patterns);
}
void transform::ApplyLowerCreateMaskPatternsOp::populatePatterns(
diff --git a/mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/matmul.mlir b/mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/matmul.mlir
index 29b0bc0c19606..ad7dbb9f7e126 100644
--- a/mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/matmul.mlir
+++ b/mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/matmul.mlir
@@ -79,6 +79,7 @@ module attributes {transform.with_named_sequence} {
transform.apply_patterns.vector.lower_masked_transfers
transform.apply_patterns.vector.transfer_permutation_patterns
transform.apply_patterns.vector.reduction_to_contract
+ transform.apply_patterns.vector.sink_ops
} : !transform.any_op
// Step 5: Lower vector.contract to vector.outerproduct. Also drop unit
diff --git a/mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/multi-tile-matmul-mixed-types.mlir b/mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/multi-tile-matmul-mixed-types.mlir
index 78815a38612e9..71798a6affbbc 100644
--- a/mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/multi-tile-matmul-mixed-types.mlir
+++ b/mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/multi-tile-matmul-mixed-types.mlir
@@ -94,6 +94,7 @@ module attributes {transform.with_named_sequence} {
transform.apply_patterns.vector.lower_masked_transfers
transform.apply_patterns.vector.transfer_permutation_patterns
transform.apply_patterns.vector.reduction_to_contract
+ transform.apply_patterns.vector.sink_ops
} : !transform.any_op
// Step 5: Lower vector.contract to vector.outerproduct. Also drop unit
|
Updates a test that I forgot to update in llvm#136699. Failing bot: * https://lab.llvm.org/buildbot/#/builders/143/builds/7166
Updates a test that I forgot to update in #136699. Failing bot: * https://lab.llvm.org/buildbot/#/builders/143/builds/7166
…136699) This PR removes the use of `populateSinkVectorOpsPatterns` from the definition of: * `transform.apply_patterns.vector.reduction_to_contract` As of llvm#131462, there is now a dedicated transform op for this pattern: * `transform.apply_patterns.vector.sink_op` Given that, we should now use the new TD op directly instead of relying on unrelated TD ops to include it. NOTE TO DOWNSTREAM USERS: Please add the following to your TD scripts: * `transform.apply_patterns.vector.sink_op` See the updated test for an example.
Updates a test that I forgot to update in llvm#136699. Failing bot: * https://lab.llvm.org/buildbot/#/builders/143/builds/7166
…136699) This PR removes the use of `populateSinkVectorOpsPatterns` from the definition of: * `transform.apply_patterns.vector.reduction_to_contract` As of llvm#131462, there is now a dedicated transform op for this pattern: * `transform.apply_patterns.vector.sink_op` Given that, we should now use the new TD op directly instead of relying on unrelated TD ops to include it. NOTE TO DOWNSTREAM USERS: Please add the following to your TD scripts: * `transform.apply_patterns.vector.sink_op` See the updated test for an example.
Updates a test that I forgot to update in llvm#136699. Failing bot: * https://lab.llvm.org/buildbot/#/builders/143/builds/7166
…136699) This PR removes the use of `populateSinkVectorOpsPatterns` from the definition of: * `transform.apply_patterns.vector.reduction_to_contract` As of llvm#131462, there is now a dedicated transform op for this pattern: * `transform.apply_patterns.vector.sink_op` Given that, we should now use the new TD op directly instead of relying on unrelated TD ops to include it. NOTE TO DOWNSTREAM USERS: Please add the following to your TD scripts: * `transform.apply_patterns.vector.sink_op` See the updated test for an example.
Updates a test that I forgot to update in llvm#136699. Failing bot: * https://lab.llvm.org/buildbot/#/builders/143/builds/7166
This PR removes the use of
populateSinkVectorOpsPatterns
from thedefinition of:
transform.apply_patterns.vector.reduction_to_contract
As of #131462, there is now a dedicated transform op for this pattern:
transform.apply_patterns.vector.sink_op
Given that, we should now use the new TD op directly instead of relying
on unrelated TD ops to include it.
NOTE TO DOWNSTREAM USERS:
Please add the following to your TD scripts:
transform.apply_patterns.vector.sink_op
See the updated test for an example.