Fix worker_init_fn to update DataPipe graph and move worker prefetch to the end of Worker pipeline#1100
Closed
ejguan wants to merge 4 commits intometa-pytorch:mainfrom
Closed
Fix worker_init_fn to update DataPipe graph and move worker prefetch to the end of Worker pipeline#1100ejguan wants to merge 4 commits intometa-pytorch:mainfrom
worker_init_fn to update DataPipe graph and move worker prefetch to the end of Worker pipeline#1100ejguan wants to merge 4 commits intometa-pytorch:mainfrom
Conversation
Contributor
|
@ejguan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
NivekT
approved these changes
Mar 20, 2023
Comment on lines
+100
to
+101
| if worker_prefetch_cnt > 0: | ||
| datapipe = datapipe.prefetch(worker_prefetch_cnt) |
Contributor
There was a problem hiding this comment.
IIUC, this is still applied whether or not the DataPipe is replicable but now it is after transformation done by the init function?
Contributor
Author
There was a problem hiding this comment.
Yeah, for non-replicable DataPipe, there won't be this step anyway because it won't be sent to worker process.
052781f to
2ec8282
Compare
Contributor
|
@ejguan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Contributor
NivekT
pushed a commit
that referenced
this pull request
Apr 19, 2023
…h to the end of Worker pipeline (#1100) Summary: Fixes #1083 ### Changes - Fix worker loop to update the DataPipe graph with `worker_init_fn` - Add corresponding Tests - Since `worker_init_fn` function might attach new DataPipe to worker graph, guarantee `prefetch` in worker attached to the end of the pipeline in worker process Pull Request resolved: #1100 Reviewed By: NivekT Differential Revision: D44221216 Pulled By: ejguan fbshipit-source-id: dfcbaa3e8a0d82df6dd21d308cc94f6d06bcf8f4
ejguan
added a commit
that referenced
this pull request
Apr 20, 2023
…h to the end of Worker pipeline (#1100) Summary: Fixes #1083 ### Changes - Fix worker loop to update the DataPipe graph with `worker_init_fn` - Add corresponding Tests - Since `worker_init_fn` function might attach new DataPipe to worker graph, guarantee `prefetch` in worker attached to the end of the pipeline in worker process Pull Request resolved: #1100 Reviewed By: NivekT Differential Revision: D44221216 Pulled By: ejguan fbshipit-source-id: dfcbaa3e8a0d82df6dd21d308cc94f6d06bcf8f4
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1083
Changes
worker_init_fnworker_init_fnfunction might attach new DataPipe to worker graph, guaranteeprefetchin worker attached to the end of the pipeline in worker process