-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support shape transpose in
hlo_sharding_util::ReshapeSharding
.
Before this cl, `hlo_sharding_util::ReshapeSharding` can handle the cases where source and target shapes can be transformed to each other by merging and splitting dimension sizes. It returns `std::nullopt` if transpose is needed between source and target shapes. This cl extracts the gcd(source_sharding_tile_size, target_shape) when `source_shape % source_sharding_tile_size == 0` in the major dimensions. An example is shown below. ``` input_shape: [6, 4] output_shape: [2, 2, 3, 2] input_sharding: {devices=[6,1]<=[6]} ``` output_sharding is `{devices=[2,1,1,1,3]<=[6] last_tile_dim_replicate}`. Before this cl, the output_sharding is `{replicated}`. PiperOrigin-RevId: 621333803
- Loading branch information
1 parent
be5c637
commit d41671e
Showing
3 changed files
with
153 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters