[Mlir-commits] [mlir] [mlir][linalg] Extend Linalg elemwise named ops semantics (PR #122753)

Andrzej Warzyński llvmlistbot at llvm.org
Wed Jan 15 08:03:55 PST 2025


banach-space wrote:

High-level question for everyone: Please feel free to shut this thread down if you think this isn't worth discussing (to avoid bike-shedding).

To me, `func_type` feels somewhat confusing or counter-intuitive—does it refer to a programming language type? For example:
```mlir
func.func @unary_exp(%A : tensor<8x16x32xf32>, %B: tensor<8x16x32xf32>) ->  tensor<8x16x32xf32> {
  %r = linalg.elemwise
               func_type=#linalg.elemwise_fn<exp>
               ins(%A : tensor<8x16x32xf32>)
               outs(%B: tensor<8x16x32xf32>) -> tensor<8x16x32xf32>
  return %r : tensor<8x16x32xf32>
}
```
Would something like `math_op` or `body_op` be clearer (or even `op`)?

Ultimately, it seems to describe "a mathematical operation inside the Linalg Op body." Do these alternatives make sense, or do you feel `func_type` is already intuitive? WDYT?

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


More information about the Mlir-commits mailing list