Skip to content

[mlir][py] fix option passing in transform interpreter #89922

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
Apr 24, 2024

Conversation

ftynse
Copy link
Member

@ftynse ftynse commented Apr 24, 2024

There was a typo in dispatch trampoline.

There was a typo in dispatch trampoline.
@llvmbot llvmbot added mlir:python MLIR Python bindings mlir labels Apr 24, 2024
@llvmbot
Copy link
Member

llvmbot commented Apr 24, 2024

@llvm/pr-subscribers-mlir

Author: Oleksandr "Alex" Zinenko (ftynse)

Changes

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 --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
 
 
+@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 } {}")

@ftynse ftynse merged commit ff57f40 into llvm:main Apr 24, 2024
@ftynse ftynse deleted the fix-options branch April 24, 2024 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mlir:python MLIR Python bindings mlir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants