This is an archive of the discontinued LLVM Phabricator instance.

[mlir][python] Remove PythonAttr mapping functionality
ClosedPublic

Authored by rkayaith on Jul 4 2023, 8:21 PM.

Details

Summary

This functionality has been replaced by TypeCasters (see D151840)

depends on D154468

Diff Detail

Event Timeline

rkayaith created this revision.Jul 4 2023, 8:21 PM
Herald added a reviewer: aartbik. · View Herald Transcript
Herald added a reviewer: ftynse. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
rkayaith published this revision for review.Jul 4 2023, 8:32 PM
ftynse added inline comments.Jul 10 2023, 1:44 AM
mlir/docs/Bindings/Python.md
1128–1130

The extra files under python/mlir/dialects where added specifically to include Attributes.td. Can we remove them entirely now that we don't need the other include?

lg for the sparse part, once other comment is addressed

rkayaith added inline comments.Jul 10 2023, 5:32 PM
mlir/docs/Bindings/Python.md
1128–1130

I had tried that initially, but the declare_mlir_dialect_python_bindings cmake function uses the .td file path to determine where to place the generated python file:

I could make relative_td_directory there an argument to declare_mlir_dialect_python_bindings though, let me try that.

1132–1138

Any particular reason the table-generated python file shouldn't be called <dialect-namespace>.py? While I'm at it I could try to get rid of the ones that are just from ._dialect_ops_gen import *.

ftynse accepted this revision.Jul 11 2023, 2:07 AM

LGTM. Cmake changes and file deletion can come in a separate patch. Please ping be on discord or some other chat channel if you need me to take another look at this.

mlir/docs/Bindings/Python.md
1128–1130

I see. No need to block this patch on cmake changes, those can come later as long as this patch has a TODO. Thanks!

1132–1138

Many dialect packages have more initialization than just importing the generated bindings. Furthermore, the mixin mechanism relies on the files being named _dialect_ops_gen and _dialect_ops_ext, respectively. I'd rather keep this as is and not introduce extra complexity in the build system (choosing whether to generate an _ops_gen file or directly a dialect files) to spare a dozen lines of boilerplate.

This revision is now accepted and ready to land.Jul 11 2023, 2:07 AM
This revision was automatically updated to reflect the committed changes.
rkayaith marked an inline comment as done.
mlir/docs/Bindings/Python.md