-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[mlir][transform][lingalg][python] Replace pdl.operation => transform.any_op. #66392
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
ingomueller-net
merged 1 commit into
llvm:main
from
ingomueller-net:transform-structured-pdl
Sep 15, 2023
Merged
[mlir][transform][lingalg][python] Replace pdl.operation => transform.any_op. #66392
ingomueller-net
merged 1 commit into
llvm:main
from
ingomueller-net:transform-structured-pdl
Sep 15, 2023
Conversation
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
….any_op. For some reason, the mix-ins of the Python bindings of this dialect used the PDL type for "any op". However, PDL isn't involved here, so it makes more sense to use the corresponding type of the transform dialect. This PR changes that.
ftynse
approved these changes
Sep 14, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Legacy is the reason :)
@llvm/pr-subscribers-mlir ChangesFor some reason, the mix-ins of the Python bindings of this dialect used the PDL type for "any op". However, PDL isn't involved here, so it makes more sense to use the corresponding type of the transform dialect. This PR changes that. -- Full diff: https://github.com//pull/66392.diff1 Files Affected:
diff --git a/mlir/python/mlir/dialects/_structured_transform_ops_ext.py b/mlir/python/mlir/dialects/_structured_transform_ops_ext.py index 212fbc5badcbce8..c5134b6e718f3b8 100644 --- a/mlir/python/mlir/dialects/_structured_transform_ops_ext.py +++ b/mlir/python/mlir/dialects/_structured_transform_ops_ext.py @@ -4,7 +4,7 @@ try: from ..ir import * - from ..dialects import pdl, transform + from ..dialects import transform except ImportError as e: raise RuntimeError("Error loading imports from extension module") from e @@ -203,7 +203,8 @@ class DecomposeOp: """Specialization for DecomposeOp class.""" def __init__(self, target: Union[Operation, Value], *, loc=None, ip=None): - super().__init__(pdl.OperationType.get(), target, loc=loc, ip=ip) + transformed_type = transform.AnyOpType.get() + super().__init__(transformed_type, target, loc=loc, ip=ip) class FuseIntoContainingOp: @@ -274,7 +275,8 @@ class GeneralizeOp: """Specialization for GeneralizeOp class.""" def __init__(self, target: Union[Operation, Value], *, loc=None, ip=None): - super().__init__(pdl.OperationType.get(), target, loc=loc, ip=ip) + transformed_type = transform.AnyOpType.get() + super().__init__(transformed_type, target, loc=loc, ip=ip) class InterchangeOp: @@ -288,9 +290,9 @@ def __init__( loc=None, ip=None, ): - pdl_operation_type = pdl.OperationType.get() + transformed_type = transform.AnyOpType.get() super().__init__( - pdl_operation_type, + transformed_type, target, iterator_interchange=iterator_interchange, loc=loc, @@ -503,11 +505,11 @@ def __init__( ): transpose_paddings = _get_int_array_array_attr(transpose_paddings) - pdl_operation_type = pdl.OperationType.get() + any_op_type = transform.AnyOpType.get() super().__init__( - pdl_operation_type, - pdl_operation_type, - pdl_operation_type, + any_op_type, + any_op_type, + any_op_type, target, padding_values=padding_values, padding_dimensions=padding_dimensions, @@ -524,8 +526,8 @@ class ScalarizeOp: """Specialization for ScalarizeOp class.""" def __init__(self, target: Union[Operation, Value], *, loc=None, ip=None): - pdl_operation_type = pdl.OperationType.get() - super().__init__(pdl_operation_type, target, loc=loc, ip=ip) + result_type = transform.AnyOpType.get() + super().__init__(result_type, target, loc=loc, ip=ip) class SplitOp: @@ -736,9 +738,9 @@ def __init__( loc=None, ip=None, ): - pdl_operation_type = pdl.OperationType.get() + transformed_type = transform.AnyOpType.get() super().__init__( - pdl_operation_type, + transformed_type, target, disable_multi_reduction_to_contract_patterns=disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns=disable_transfer_permutation_map_lowering_patterns, |
We should keep at least one test exercising different types, but
otherwise I'd clean that up to.
…On Thu, Sep 14, 2023 at 5:45 PM Ingo Müller ***@***.***> wrote:
This came up in #65726 <#65726>.
BTW: How about the pdl.OperationType.get() occurrences in the unit tests
(e.g., here
<https://github.com/llvm/llvm-project/blob/74724902/mlir/test/python/dialects/transform_structured_ext.py#L24>
)?
—
Reply to this email directly, view it on GitHub
<#66392 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALRG244XUD6PWHGGK574X3X2MRA5ANCNFSM6AAAAAA4YKMGAE>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
--
Alex
|
ZijunZhaoCCK
pushed a commit
to ZijunZhaoCCK/llvm-project
that referenced
this pull request
Sep 19, 2023
….any_op. (llvm#66392) For some reason, the mix-ins of the Python bindings of this dialect used the PDL type for "any op". However, PDL isn't involved here, so it makes more sense to use the corresponding type of the transform dialect. This PR changes that.
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 some reason, the mix-ins of the Python bindings of this dialect used the PDL type for "any op". However, PDL isn't involved here, so it makes more sense to use the corresponding type of the transform dialect. This PR changes that.