[Mlir-commits] [mlir] [mlir][py] fix option passing in transform interpreter (PR #89922)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Apr 24 06:27:12 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir
Author: Oleksandr "Alex" Zinenko (ftynse)
<details>
<summary>Changes</summary>
There was a typo in dispatch trampoline.
---
Full diff: https://github.com/llvm/llvm-project/pull/89922.diff
2 Files Affected:
- (modified) mlir/python/mlir/dialects/transform/interpreter/__init__.py (+1-1)
- (modified) mlir/test/python/dialects/transform_interpreter.py (+15)
``````````diff
diff --git a/mlir/python/mlir/dialects/transform/interpreter/__init__.py b/mlir/python/mlir/dialects/transform/interpreter/__init__.py
index 34cdc43cb617fd..e69aa963038f23 100644
--- a/mlir/python/mlir/dialects/transform/interpreter/__init__.py
+++ b/mlir/python/mlir/dialects/transform/interpreter/__init__.py
@@ -29,7 +29,7 @@ def apply_named_sequence(
if transform_options is None:
_cextTransformInterpreter.apply_named_sequence(*args)
else:
- _cextTransformInterpreter(*args, transform_options)
+ _cextTransformInterpreter.apply_named_sequence(*args, transform_options)
def copy_symbols_and_merge_into(target, other):
diff --git a/mlir/test/python/dialects/transform_interpreter.py b/mlir/test/python/dialects/transform_interpreter.py
index 807a98c4932797..819a3be1db9d5a 100644
--- a/mlir/test/python/dialects/transform_interpreter.py
+++ b/mlir/test/python/dialects/transform_interpreter.py
@@ -45,6 +45,21 @@ def print_other():
# CHECK: this.is.payload
+ at test_in_context
+def transform_options():
+ options = interp.TransformOptions()
+ options.expensive_checks = False
+ options.enforce_single_top_level_transform_op = True
+ m = ir.Module.parse(
+ print_root_module.replace("from interpreter", "transform_options")
+ )
+ payload = ir.Module.parse("module attributes { this.is.payload } {}")
+ interp.apply_named_sequence(payload, m.body.operations[0], m, options)
+
+
+# CHECK-LABEL: transform_options
+
+
@test_in_context
def failed():
payload = ir.Module.parse("module attributes { this.is.payload } {}")
``````````
</details>
https://github.com/llvm/llvm-project/pull/89922
More information about the Mlir-commits
mailing list