[Mlir-commits] [mlir] [mlir][python] fix linalg.pack/unpack (PR #127729)
Maksim Levental
llvmlistbot at llvm.org
Wed Feb 19 07:54:12 PST 2025
================
@@ -193,3 +196,34 @@ def contract(
)
fill_builtin_region(op.operation)
return op
+
+
+def pack(
+ source,
+ dest,
+ inner_dims_pos,
+ inner_tiles,
+ *,
+ padding_value=None,
+ outer_dims_perm=None,
+ loc=None,
+ ip=None,
+) -> ir.Value:
+ (
+ dynamic_inner_tiles,
+ # packed here means %1:2 packing (results packing)
+ _inner_tiles,
+ static_inner_tiles,
+ ) = _dispatch_mixed_values(inner_tiles)
+
+ return PackOp(
+ source=source,
+ dest=dest,
+ inner_dims_pos=inner_dims_pos,
+ inner_tiles=dynamic_inner_tiles,
+ static_inner_tiles=static_inner_tiles,
+ padding_value=padding_value,
+ outer_dims_perm=outer_dims_perm,
+ loc=loc,
+ ip=ip,
+ ).result
----------------
makslevental wrote:
> a fix in this one would also be ok, if you're happy to do it.
sorry misread/misunderstood your question - yea no need for a revert (I'm probably the only person in the world using `linalg` as a frontend so I doubt it's BC). And I'll fix it up here.
https://github.com/llvm/llvm-project/pull/127729
More information about the Mlir-commits
mailing list