This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg] Add structured op builders from python opdsl.
ClosedPublic

Authored by stellaraccident on Mar 16 2021, 6:09 PM.

Details

Summary
  • Makes the wrapped functions of the @linalg_structured_op decorator callable such that they emit IR imperatively when invoked.
  • There are numerous TODOs that I will keep working through to achieve generality.
  • Will true up exception handling tests as the feature progresses (for things that are actually errors once everything is implemented).
  • Includes the addition of an isinstance method on concrete types in the Python API.

Diff Detail

Event Timeline

stellaraccident requested review of this revision.Mar 16 2021, 6:09 PM
nicolasvasilache accepted this revision.Mar 19 2021, 1:57 AM

Nice!

mlir/test/Bindings/Python/dialects/linalg/opdsl/emit_structured_generic.py
13

also, extending with these key attributes when you do, will be useful: https://github.com/google/iree/blob/main/experimental/ModelBuilder/ModelBuilder.h#L105

This revision is now accepted and ready to land.Mar 19 2021, 1:57 AM
stellaraccident marked an inline comment as done.Mar 19 2021, 11:10 AM
stellaraccident added inline comments.
mlir/test/Bindings/Python/dialects/linalg/opdsl/emit_structured_generic.py
13

Thanks, took a note for myself.

This revision was automatically updated to reflect the committed changes.
stellaraccident marked an inline comment as done.