-
Notifications
You must be signed in to change notification settings - Fork 424
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IFRT] Extend Array assembly/disassembly operations to distinguish be…
…tween addressable-shard and all-shard processing IFRT's assembly/disassembly operations (`Client::AssembleArrayFromSingleDeviceArray`, `Array::DisassembleIntoSingleDeviceArrays`, and related methods in `Sharding`) treated all shards equally without distinguishing the addressability of the device of the shards. This had practical problems: * When the user only has single-device arrays for addressable devices, and asssemble them into a multi-shard array, the user is forced to use a `Sharding` that only contains addressable devices. However, with SPMD, it is common to use a `Sharding` that can express both adressable/non-addressable shards (e.g., `HloSharding`). * When the user has a multi-shard array that spans both addressable/non-addressable devices, disassembling the array into single-device arrays would create a single-device array with no addressable devices, which is often not well supported in the user code because the user code sometimes makes a strong assumption that any array contains at least one addressable device. On the other hand, making assembly/diassembly handle only addressable shards is not future proof. An MPMD setup (not all inputs use a single device mesh) can see an array with no addressable devices. Thus, changing assembly/diassembly sematics to handle only addressable shards is too restrictive. To resolve this single-device array addressability issue, this change makes it explicit whether only addressable shards will be processed or all shards will be processed in assembly/disassembly operations. This change extends `Client::AssembleArrayFromSingleDeviceArray` and `Array::DisassembleIntoSingleDeviceArrays` methods to be able to handle addressable shards only. It will be done in subsequent changes to make the IFRT user code to request only addressable devices. PiperOrigin-RevId: 686577669
- Loading branch information
1 parent
6244044
commit 1b13e93
Showing
27 changed files
with
369 additions
and
71 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
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
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
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
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
Oops, something went wrong.