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

Do not set the sharding of the sharding group op during import, and emit a warning instead of error if the group has a conflicting initial sharding. #388

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

copybara-service[bot]
Copy link

Do not set the sharding of the sharding group op during import, and emit a warning instead of error if the group has a conflicting initial sharding.

What we should do instead is let propagation resolve what sharding to use. Note this will be a bit arbitrary based on propagation order. We should still at least emit a warning to the user since this is a bit of a weird use of sharding group:

/tmp/bug.mlir:9:3: warning: Inconsistent shardings prior to propagation for ShardingGroupOps with canonicalized groupId: 0 due to the operand %1 = sdy.sharding_constraint %arg0 <@mesh, [{"a"}, {?}]> : tensor<8x8xf32>. Inserting an open sharding constraint to all constrained  values
  sdy.sharding_group %1 group_id=1183 : tensor<8x8xf32>
  ^
/tmp/bug.mlir:9:3: note: see current operation: sdy.sharding_group %1 group_id=0 : tensor<8x8xf32>

This also matches the behavior in GSPMD.

…mit a warning instead of error if the group has a conflicting initial sharding.

What we should do instead is let propagation resolve what sharding to use. Note this will be a bit arbitrary based on propagation order. We should still at least emit a warning to the user since this is a bit of a weird use of sharding group:

```mlir
/tmp/bug.mlir:9:3: warning: Inconsistent shardings prior to propagation for ShardingGroupOps with canonicalized groupId: 0 due to the operand %1 = sdy.sharding_constraint %arg0 <@mesh, [{"a"}, {?}]> : tensor<8x8xf32>. Inserting an open sharding constraint to all constrained  values
  sdy.sharding_group %1 group_id=1183 : tensor<8x8xf32>
  ^
/tmp/bug.mlir:9:3: note: see current operation: sdy.sharding_group %1 group_id=0 : tensor<8x8xf32>
```

This also matches the behavior in GSPMD.

PiperOrigin-RevId: 727888959
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant