[Mlir-commits] [mlir] [MLIR][Linalg] Remove/update failing obsolete OpDSL tests for linalg.matmul. (PR #115319)
Maksim Levental
llvmlistbot at llvm.org
Tue Nov 12 04:24:50 PST 2024
makslevental wrote:
> It seems obvious to me that Python should be able to call other ODS operations. If so, we need to tie the same mechanism to `matmul`, and then the follow up operations. This seems like a mechanical solution would work here.
It can - there are "binded" builders for every op in every dialect - eg `linalg.MatMulOp` or `linalg.FillOp` etc. The snippet above shows that it can be done (I landed exactly this ["fix" in mlir-python-wheels](https://github.com/makslevental/mlir-python-extras/pull/105)).
What makes the current state onerous is that for whatever reason (no doubt due to changes going on in this stream), suddenly you need to explicitly pass the indexing maps even for `linalg.MatMulOp` whereas before you did not. Thus you have to build the `indexing_maps_attr` by [hand](https://github.com/llvm/llvm-project/blob/5dd9867e2d1e698fee980e31da114a37e4c7f612/mlir/python/mlir/dialects/linalg/opdsl/lang/emitter.py#L40-L111) and then call the binded builder.
But like I said: I highly doubt anyone is using Python to emit `linalg` other than me so I wouldn't call this a catastrophe. Just an FYI. And I agree with you @rengolin, I don't think introducing overlapping names (`matmul_op_dsl`, `matmul_non_op_dsl`) is a good idea and I also agree that OpDSL should go.
https://github.com/llvm/llvm-project/pull/115319
More information about the Mlir-commits
mailing list