What is the strategy for tensor->memref conversion? (bufferization)

As Nicolas mentioned, I’ve been doing some significant refactoring here. If you wait a week, this will all be much easier. I will present at ODM soon (just signed up for Nov 19 ODM “Type conversions the not-so-hard way: MLIR’s new composable Bufferize passes”)

The thing that isn’t bufferized there is the absf op, because there is no buffer equivalent. I’m waiting on review of some patches that make it work. The short answer is that you need ⚙ D90731 Add ElementwiseMappable trait and apply it to std elementwise ops. and ⚙ D90354 [mlir] Add pass to convert elementwise ops to linalg. and run -convert-elementwise-to-linalg -linalg-bufferize -func-bufferize. See mlir/integration_test/Dialect/Linalg/CPU/test-elementwise.mlir in ⚙ D90354 [mlir] Add pass to convert elementwise ops to linalg.

2 Likes