Skip to content

Apply sharding based on priority & combine DistInfo and ExtraInfo#916

Closed
ejguan wants to merge 1 commit intometa-pytorch:mainfrom
ejguan:sharding_priority
Closed

Apply sharding based on priority & combine DistInfo and ExtraInfo#916
ejguan wants to merge 1 commit intometa-pytorch:mainfrom
ejguan:sharding_priority

Conversation

@ejguan
Copy link
Contributor

@ejguan ejguan commented Dec 6, 2022

After pytorch/pytorch#88424 is landed, we are able to invoke apply_sharding by sharding levels (distributed or multiprocessing). Then, we are able to give fine-control on sharding by ReadingService.

  • For DistributedReadingService, we will only set sharding on the distributed level
  • For PrototypeMPReadingService, we will set distributed sharding in the main process and set mp sharding in the worker processes. Previously, we set sharding in each worker process based on both distributed and mp information.
    • worker_init_fn doesn't need DistInfo anymore. As, the DataPipe has been distributed sharded in the main process.
    • Combine DistInfo and ExtraInfo for worker_reset_fn to synchronize the distributed seeds across distributed workers and set worker-local seeds based on both distributed and mp information.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 6, 2022
@facebook-github-bot
Copy link
Contributor

@ejguan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@NivekT
Copy link
Contributor

NivekT commented Dec 7, 2022

I did not know it was possible to land without GH stamp.

@ejguan
Copy link
Contributor Author

ejguan commented Dec 7, 2022

@NivekT It's only possible for TorchData. PyTorch doesn't allow this anymore due to the GH first project

@ejguan ejguan added the topic: improvements topic category label Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. topic: improvements topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants