Skip to content

Commit

Permalink
In a previous change, we throw an error if we encounter an unknown sh…
Browse files Browse the repository at this point in the history
…arding when saving shardings for instructions. However, this ingored the fact that we deliberately replace some module parameter/root shardings with unknown sharding objects. This CL makes the condition tigher so we only throw an error when we encounter unknown sharding objects intended for shard_as or shard_like annotations, which was the original intention anyway.

PiperOrigin-RevId: 679676685
  • Loading branch information
Google-ML-Automation committed Sep 27, 2024
1 parent 175328a commit c988ae6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion xla/hlo/experimental/auto_sharding/auto_sharding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2572,7 +2572,8 @@ absl::Status SaveShardingForInstruction(
if (!inst->has_sharding()) {
return absl::OkStatus();
}
if (inst->sharding().IsUnknown()) {
if (inst->sharding().IsUnknown() &&
(inst->sharding().IsShardLike() || inst->sharding().IsShardAs())) {
return absl::UnimplementedError(
"Auto-sharding currently does not support shard_as/shard_like "
"sharding annotations");
Expand Down

0 comments on commit c988ae6

Please sign in to comment.