-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[MLIR][Python] Add missing peel_front argument to LoopPeelOp's extension class #81424
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][Python] Add missing peel_front argument to LoopPeelOp's extension class #81424
Conversation
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write If you have received no comments on your PR for a week, you can request a review If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
@llvm/pr-subscribers-mlir Author: Rolf Morel (rolfmorel) ChangesWhile PR 74015 added support for peeling an iteration from the front of a loop, it did not update the (non-automatically generated) part of the Python interface that exposes the op. Full diff: https://github.com/llvm/llvm-project/pull/81424.diff 1 Files Affected:
diff --git a/mlir/python/mlir/dialects/transform/loop.py b/mlir/python/mlir/dialects/transform/loop.py
index 3bdd9ca3b22f07..c4770b1c4067e4 100644
--- a/mlir/python/mlir/dialects/transform/loop.py
+++ b/mlir/python/mlir/dialects/transform/loop.py
@@ -55,6 +55,7 @@ def __init__(
remainder_loop_type: Type,
target: Union[Operation, Value],
*,
+ peel_front: Union[bool, BoolAttr] = False,
fail_if_already_divisible: Union[bool, BoolAttr] = False,
ip=None,
loc=None,
@@ -63,6 +64,11 @@ def __init__(
main_loop_type,
remainder_loop_type,
_get_op_result_or_value(target),
+ peel_front=(
+ peel_front
+ if isinstance(peel_front, BoolAttr)
+ else BoolAttr.get(peel_front)
+ ),
fail_if_already_divisible=(
fail_if_already_divisible
if isinstance(fail_if_already_divisible, BoolAttr)
|
@ftynse, @makslevental, @matthias-springer, as you guys worked on this file, could you maybe help with review? Thanks. |
@rolfmorel can you add a test? |
96e778c
to
b3a1001
Compare
✅ With the latest revision this PR passed the Python code formatter. |
@makslevental Added a test. Note that this change is just about exposing an option in Python. Whether the implementation of the option works as intended is covered by tests for the C++ code. |
…ion class While PR 74015 added support for peeling an iteration from the front of a loop, it did not update the (non-automatically generated) part of the Python interface that exposes the op.
b3a1001
to
33a0c28
Compare
Yea sure I just wanted to make sure this option is kept in sync with ODS (currently there's no logical connection between these wrappers and the canonical ODS). If you need me to merge after the test passes, let me know. |
Thanks for the explanation, @makslevental I believe the tests have now passed. If you could merge the PR, that would be great! |
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.
LGTM - thanks for filling in a missing piece.
@rolfmorel Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested Please check whether problems have been caused by your change specifically, as How to do this, and the rest of the post-merge process, is covered in detail here. If your change does cause a problem, it may be reverted, or you can revert it yourself. If you don't get any reports, no action is required from you. Your changes are working as expected, well done! |
While PR 74015 added support for peeling an iteration from the front of a loop, it did not update the (non-automatically generated) part of the Python interface that exposes the op.