Skip to content

[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
merged 1 commit into from
Sep 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions mlir/python/mlir/dialects/_structured_transform_ops_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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:
Expand Down Expand Up @@ -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,
Expand Down