[Mlir-commits] [mlir] mlir::mesh::shardingOp adding shard-size control (PR #98145)

Frank Schlimbach llvmlistbot at llvm.org
Wed Aug 7 00:49:48 PDT 2024


================
@@ -129,15 +328,28 @@ def Mesh_ShardOp : Mesh_Op<"shard", [
     as an operand in subsequent operations. If not, the sharding applies to the
     operation that defines the tensor value.
 
+    4. `force`: A unit attribute requesting an explicit sharding of the data,
+    therefore not allowing to be optimizied away. This is useful in the presence
+    of halos and inplace semantics.
----------------
fschlimb wrote:

Yes, `tensor.insert_slice` does have a return argument. Handling that is relatively straight forward. 
However, array semantics (like numpy) do have inplace semantics (tensors do not!). I was talking about such an inplace `insert_slice` operation which is guaranteed to reuse the existing allocation. The tensor dialect does not have such a thing because it is value-based.
I hope this will become more obvious with my next PR.

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


More information about the Mlir-commits mailing list