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

Update Prefetcher and Implement PinMemory IterDataPipe (#1014) #1035

Merged
merged 1 commit into from
Feb 21, 2023

Conversation

ejguan
Copy link
Contributor

@ejguan ejguan commented Feb 21, 2023

Cherry-pick #1014

Summary:
Fixes #1013

Changes

  • Simplify the control flow of prefetcher
    • Delay Exception raised from thread worker to main thread in __iter__
    • Stop prefetching whenever Exception is received
    • As long as stop_iteration is not turned on or buffer is not empty, continue yielding data from __iter__.
    • Add serialization test
  • Add PinMemory DataPipe
    • is_replciable() -> False to keep it in the main process
    • Add unit tests
  • Update test_proto_multi_rs.py to test_mprs.py

Pull Request resolved: #1014

Reviewed By: NivekT

Differential Revision: D43329696

Pulled By: ejguan

fbshipit-source-id: da4326dbe2388f4e23b9a1a3a5c43da09d29185a

Summary:
Fixes pytorch#1013

## Changes

- Simplify the control flow of prefetcher
  - Delay Exception raised from thread worker to main thread in `__iter__`
  - Stop prefetching whenever Exception is received
  - As long as `stop_iteration` is not turned on or `buffer` is not empty, continue yielding data from `__iter__`.
  - Add serialization test
- Add `PinMemory` DataPipe
  -  `is_replciable() -> False` to keep it in the main process
  - Add unit tests
- Update `test_proto_multi_rs.py` to `test_mprs.py`

Pull Request resolved: pytorch#1014

Reviewed By: NivekT

Differential Revision: D43329696

Pulled By: ejguan

fbshipit-source-id: da4326dbe2388f4e23b9a1a3a5c43da09d29185a
@ejguan ejguan requested a review from NivekT February 21, 2023 15:28
@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 Feb 21, 2023
@ejguan ejguan closed this Feb 21, 2023
@NivekT NivekT mentioned this pull request Feb 21, 2023
10 tasks
@NivekT
Copy link
Contributor

NivekT commented Feb 21, 2023

@ejguan This was not merged. Do you plan to merge this?

@ejguan
Copy link
Contributor Author

ejguan commented Feb 21, 2023

Let's merge it then. I thought we want to merge multiple commits in a single PR

@ejguan ejguan reopened this Feb 21, 2023
Copy link
Contributor

@NivekT NivekT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine either way (individual vs weekly merge) as long as we keep track. Thanks!

@ejguan ejguan merged commit 6c4e23d into pytorch:release/0.6 Feb 21, 2023
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.

3 participants