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

Second prototype to do pre-sharding work in single process #555

Open
wants to merge 4 commits into
base: gh/VitalyFedyunin/7/base
Choose a base branch
from

Conversation

VitalyFedyunin
Copy link
Contributor

@VitalyFedyunin VitalyFedyunin commented Jun 27, 2022

VitalyFedyunin added a commit that referenced this pull request Jun 27, 2022
ghstack-source-id: fafd6c730b66fc093d98cfae2d4552db228aed08
Pull Request resolved: #555
@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 Jun 27, 2022
VitalyFedyunin added a commit that referenced this pull request Aug 24, 2022
ghstack-source-id: b95569ebc2149ffb8e9e3b8a0e8e3d9db9178c4e
Pull Request resolved: #555
VitalyFedyunin added a commit that referenced this pull request Aug 29, 2022
ghstack-source-id: 4de2dd31374439d6a5c2534aa5110fed8195788a
Pull Request resolved: #555
VitalyFedyunin added a commit that referenced this pull request Aug 29, 2022
ghstack-source-id: c1e83697fa33ab38a87654452cd4b0c4f2a2e0f4
Pull Request resolved: #555
@facebook-github-bot
Copy link
Contributor

Hi @VitalyFedyunin!

Thank you for your pull request.

We require contributors to sign our Contributor License Agreement, and yours needs attention.

You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

facebook-github-bot pushed a commit that referenced this pull request Dec 28, 2022
…processing (#919)

Summary:
This PR is created on top of #555. And, this PR extends `PrototypeMultiprocessingReadingService` to accept non-replicable DataPipe.

And, this PR depends on pytorch/pytorch#90769

### Main Changes
- Add a way to launch a process to fetch data from non-replicable DataPipes and send data to worker processes in a round-robin manner
  - Add `ShardingRoundRobinDispatcher` (functional name `sharding_round_robin_dispatch`) to indicate non-replicable DataPipe
  - Add `MultipleDataPipesToQueuesLoop` to connect non-sharding process to request/response queues
  - Add `find_lca_non_replicable_dp` as a graph function to determine the lowest common ancestor of all non-replicabble DataPipes. This would guarantee that all non-replicable DataPipes will be running in a single dispatching process
  - In each multiprocessing worker process,
    - If All datapipes are replicable, apply multiprocessing sharding to the graph
    - If not, worker would use `find_replicable_branches` to apply mp sharding to those replicable branches, because all non-replicable branches have been properly sharded by routing data round-robinly to worker processes.
- Properly get `ResetEpochResponse` from protocol via `get_response_reset_epoch`
- [x] Add tests for two graph functions
- [x] Add test to launch non-shardable DataPipe process
- Add documents
  - [x] Replicable DataPipe/Non-replicable DataPipe in multiprocessing
  - [x] How PrototypeMPRS handles the above two types of DataPipe
Please check the link for doc: https://ejguan.github.io/dataloader2.html#dynamic-sharding
## nit Changes
- Rename `Spawn` to `Create` as the process has not been started

Pull Request resolved: #919

Reviewed By: wenleix

Differential Revision: D42004034

Pulled By: ejguan

fbshipit-source-id: 5b0b1cb7c2781c4f45240d21f37d457b9729b9a4
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants