Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from

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