forked from pytorch/pytorch
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[shard] add back init_from_local_shard_and_global_metadata API (pytor…
…ch#69226) Summary: Pull Request resolved: pytorch#69226 This add back the previous init_from_local_shards API, but renamed it to init_from_local_shard_and_global_metadata. It's a partial revert of D32147888 (pytorch@35712a8). We now provide two APIs: 1. `init_from_local_shards`: user don't need to provide global metadata and we do all_gather under the hood, the other that 2. `init_from_local_shards_and_global_metadata`: user need to explicitly construct ShardedTensorMetadata to use this API, need to ensure correctness on all ranks, as there's no cross-rank communication/validations. All of these two APIs stay private until it stablizes and proof of UX. The second one can only be called on `ShardedTensor` class directly, not included as a package API for now. Test Plan: test_init_from_local_shards_and_global_metadata test_init_from_local_shards_and_global_metadata_invalid_shards Reviewed By: dstaay-fb, pritamdamania87 Differential Revision: D32746882 fbshipit-source-id: bafd26ce16c02e2095907f9e59984a5d775c7df5
- Loading branch information
Showing
2 changed files
with
282 additions
and
0 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