Skip to content

Commit e8ccad1

Browse files
committed
added sharding exmpample
1 parent ec4a18e commit e8ccad1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

mlir/lib/Dialect/Arith/Transforms/ShardingInterfaceImpl.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ using namespace mlir::mesh;
2020
namespace {
2121

2222
// Sharding of arith.constant
23+
// RankedTensor constants can be sharded like any other tensor.
24+
// %cst = arith.constant dense<0.000000e+00> : tensor<1024x1024xf32>
25+
// %sharding = mesh.sharding @mesh4x4 split_axes = [[0]] : !mesh.sharding
26+
// Scalar constants are always replicated and need no sharding annotation.
27+
2328
struct ConstantShardingInterface
2429
: public ShardingInterface::ExternalModel<ConstantShardingInterface,
2530
ConstantOp> {

0 commit comments

Comments
 (0)