[PSA] Removal of Linalg named elementwise named operations

As per the discussion in [RFC] Update semantics of Linalg named operations (unary/binary/ternary) - MLIR - LLVM Discussion Forums, we are moving forward with the removal of all elementwise named operations (unary/binary/ternary). The alternative is to use linalg.elementwise for all such cases, which are more generic and easier to match against on rewrites and transforms.

Here are three drafts I’m working on, which will become a stacked PR, with the additional cleanup at the end:

These three PRs have dealt with every upstream usage of those ops (there weren’t many) and replaced them with linalg.elementwise. Patterns matchers still work, forms still valid. This means whatever downstream user would likely suffer no greater penalty than to just replace their creation from linalg::AddOp to linalg::ElementwiseOp builders.

Timeframe

I don’t have a strict timeline, but I also don’t want to drag this for too long. In the other thread, downstream users responded that they either don’t use the ops or would be quick to move on, so I’m hoping we can do that in a couple of weeks, not months.

Next Steps

  1. I’ll create the stack and the cleanup, and make a stacked PR for the four stages.
  2. Upstream and downstream users review and approve. (1~2 weeks)
  3. We merge the stack and monitor the fallout.

We have plenty of time for fixups before the next release, so I’m not foreseeing complications and backports necessary.

@javedabsar @jpienaar @ftynse @sjarus @sayans @lhutton1 @AGindinson @banach-space @asiemien

5 Likes