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

Boian Petkantchin llvmlistbot at llvm.org
Wed Jul 10 13:21:35 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.
----------------
sogartar wrote:

Could you add explanation in the doc with an example?
I still don't understand. It would be desirable to avoid the complexity of another attribute.
Shouldn't `insert_slice` know how to handle its spmdization? It would have requirements that the destination-passing style operand and the result are related and that they need to have the same sharding. If this constraint can not be satisfied then resharding will be inserted during sharding propagation.

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


More information about the Mlir-commits mailing list