[Mlir-commits] [mlir] [mlir][linalg][conv] Flatten the channel dimension when vectorizing (PR #71918)

Nicolas Vasilache llvmlistbot at llvm.org
Mon Nov 13 05:35:53 PST 2023


https://github.com/nicolasvasilache commented:

I made a first pass with some minor restructuring comments.

However, as I dug deeper, I have the impression that you are doing a one-off manual implementation of a new `swap(vector.insert/extractStridedSlice, vector.shape_cast)` pattern.

It seems to me you could achieve the same benefits by rewriting:
```
        resVals[w] = depthwiseConv1dSliceAsMulAcc(rewriter, loc,
                                                  lhsVals[linearIndex(kw, w)],
                                                  rhsVals[kw], resVals[w]);
```

as `shape_cast + depthwiseConv1dSliceAsMulAcc + shape_cast` and applying such new swap/propagation patterns.

I think this would fit within what you refer to as option 2.

In the current form, I am afraid the manual one-off application of that pattern to your current use case is unappealing to me.

https://github.com/llvm/llvm-project/pull/71918


More information about the Mlir-commits mailing list