-
Notifications
You must be signed in to change notification settings - Fork 418
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IFRT] Extend Sharding disassembly operations to distinguish between …
…addressable-shards and all-shards 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 focuses on extending `Sharding` interface and implementing addressable-shards processing. The default behavior remains to be processing all shards. Using this new capability for `Array` assembly and disassembly is a separate change that will be sent out soon. It will also be done as subsequent changes to make the IFRT user code to request only addressable devices. PiperOrigin-RevId: 685822245
- Loading branch information
1 parent
63311bd
commit 032b62e
Showing
7 changed files
with
1,329 additions
and
281 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
Oops, something went wrong.