Skip to content

Commit 4eb2bcd

Browse files
author
tenstorrent
committed
Add support for custom sharding rules via ShardingRuleOpInterface
Allows custom ops to supply their own sharding rules when not covered by the default registry.
1 parent 360201a commit 4eb2bcd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

shardy/dialect/sdy/transforms/propagation/op_sharding_rule_registry.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,11 @@ OpShardingRuleAttr createOpShardingRule(Operation* op,
687687
}
688688
return OpShardingRuleBuilder::buildPointwise(customCall);
689689
}
690+
if (auto shardingRuleOp =
691+
llvm::dyn_cast<ShardingRuleOpInterface>(
692+
customCall.getOperation())) {
693+
return shardingRuleOp.getShardingRule();
694+
}
690695
// TODO(b/327191011): output unregistered op stats instead.
691696
static llvm::once_flag onceFlag;
692697
emitOpWarningOnce(

0 commit comments

Comments
 (0)