I could previously create a linalg.generic
op using the Python bindings
from mlir.dialects import linalg
generic_op = linalg.GenericOp(
[output_type],
[input_arg],
[output_arg],
ir.ArrayAttr.get([ir.AffineMapAttr.get(ir.AffineMap.get_permutation([0, 1])),
ir.AffineMapAttr.get(ir.AffineMap.get_permutation([0, 1]))]),
ir.ArrayAttr.get([ir.StringAttr.get("parallel")]*2),
)
However, after pulling the latest code on main, this no longer works. I get an error:
error: 'linalg.generic' op attribute 'iterator_types' failed to satisfy constraint: Iterator type should be an enum.
This appears to be related to changes made on 11/10 – Replace “string” iterator_types attr with enums in LinalgInterface. Instead of passing “parallel” as a string attr, it now wants an enum with the same meaning.
I see the object I need in C++ (mlir/include/mlir/Dialect/Utils/StructuredOpsUtils.td), but I can’t figure out how to create or access that in Python.
If this is simply missing from the Python bindings, I’m happy to improve things if someone is willing to lend some guidance.