| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[MLIR][Python] fix class name of powf and negf in linalg (#97696) The following logic can lead to a class name mismatch when using linalg.powf in Python. This PR fixed the issue and also renamed NegfOp to NegFOp in linalg to adhere to the naming convention, as exemplified by arith::NegFOp. https://github.com/llvm/llvm-project/blob/173514d58ec4e6166670f1e37a038df3865c8b96/mlir/python/mlir/dialects/linalg/opdsl/lang/dsl.py#L140-L143 # linalg.powf(arg0, arg1, outs=[init_result.result]) NotImplementedError: Unknown named op_name / op_class_name: powf / PowfOp | 1 年前 | |
[mlir][linalg] regionBuilder for transpose, broadcast (#69742) Currently, linalg.transpose and linalg.broadcast can't be emitted through either the C API or the python bindings (which of course go through the C API). See https://discourse.llvm.org/t/how-to-build-linalg-transposeop-in-mlir-pybind/73989/10. The reason is even though they're named ops, there is no opdsl @linalg_structured_op for them and thus while they can be instantiated they cannot be passed to [mlirLinalgFillBuiltinNamedOpRegion](https://github.com/llvm/llvm-project/blob/a7cccb9cbb2b9954684cbea37615303a59719973/mlir/lib/CAPI/Dialect/Linalg.cpp#L18). I believe the issue is they both take a IndexAttrDef but IndexAttrDef cannot represent dynamic rank. Note, if I'm mistaken and there is a way to write the @linalg_structured_op let me know. The solution here simply implements the regionBuilder interface which is then picked up by [LinalgDialect::addNamedOpBuilders](https://github.com/llvm/llvm-project/blob/7557530f428a2f226d8d925c33d527dfcfdcb0c5/mlir/lib/Dialect/Linalg/IR/LinalgDialect.cpp#L116). Extension classes are added "by hand" that mirror the API of the @linalg_structured_ops. Note, the extension classes are added to to dialects/linalg/__init__.py instead of dialects/linalg/opdsl/ops/core_named_ops.py in order that they're not confused for opdsl generators/emitters. | 2 年前 |