Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In a previous change, we throw an error if we encounter an unknown sharding 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. #17723

Merged
merged 1 commit into from
Sep 27, 2024
Merged
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
Loading