-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[MLIR][Transform][Python] Sync derived classes and their wrappers #166871
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
Conversation
Updates the derived Op-classes for the main transform ops to have all the arguments, etc, from the auto-generated classes. Additionally updates and adds missing snake_case wrappers for the derived classes which shadow the snake_case wrappers which were exposed alongside the derived classes.
|
✅ With the latest revision this PR passed the Python code formatter. |
|
Meant to address: #166765 |
ftynse
left a comment
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.
Can we somehow automate generation of these wrappers? They are marginally more usable, but seem to have high maintenance cost.
|
Discussed it with @makslevental yesterday. In the case of these transform ops, the derived classes and wrappers really only serve two purposes: add type hints and add From my perspective, the main issue is the mapping from tablegen types, i.e. C++ types, to the type hints. I figure it would be something like llvm-project/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp Lines 492 to 556 in 3719c43
When I find some time, I can try implement something like that. If someone has a better idea of how to encode the mapping from MLIR/C++ types to Python type hints, please let me know! |
Updates the derived Op-classes for the main transform ops to have all the arguments, etc, from the auto-generated classes. Additionally updates and adds missing snake_case wrappers for the derived classes which shadow the snake_case wrappers of the auto-generated classes, which were hitherto exposed alongside the derived classes.