-
Notifications
You must be signed in to change notification settings - Fork 352
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
add non_blocking feature to BaseDataPreprocessor #618
Merged
ZwwWayne
merged 5 commits into
open-mmlab:main
from
shenmishajing:add_non_blocking_feature_to_data_preprocessor
Oct 18, 2022
Merged
add non_blocking feature to BaseDataPreprocessor #618
ZwwWayne
merged 5 commits into
open-mmlab:main
from
shenmishajing:add_non_blocking_feature_to_data_preprocessor
Oct 18, 2022
Conversation
This file contains 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
shenmishajing
requested review from
zhouzaida,
HAOCHENYE and
C1rN09
as code owners
October 16, 2022 07:36
zhouzaida
reviewed
Oct 16, 2022
zhouzaida
reviewed
Oct 16, 2022
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
zhouzaida
reviewed
Oct 16, 2022
zhouzaida
reviewed
Oct 16, 2022
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
zhouzaida
approved these changes
Oct 17, 2022
HAOCHENYE
approved these changes
Oct 17, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
C1rN09
approved these changes
Oct 17, 2022
Hi, @zhouzaida @HAOCHENYE @C1rN09 , the check failed because pip can not upgrade it self. Can you give a see to it? |
Since this PR is approved by all reviewers, it is merged first. The issue of CI can be solved in another PR. |
shenmishajing
deleted the
add_non_blocking_feature_to_data_preprocessor
branch
October 19, 2022 01:41
C1rN09
pushed a commit
to C1rN09/mmengine
that referenced
this pull request
Nov 1, 2022
…#618) * add non_blocking feature to BaseDataPreprocessor * Update mmengine/model/base_model/data_preprocessor.py Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com> * move new parameters to the last to avoid bc issue * Update mmengine/model/base_model/data_preprocessor.py Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com> * Update mmengine/model/base_model/data_preprocessor.py Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com> Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
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.
Motivation
add non_blocking param to BaseDataPreprocessor, which transfer tensor to device asynchronously. See https://pytorch.org/docs/stable/generated/torch.Tensor.to.html#torch.Tensor.to for detail.
Modification
add non_blocking param to BaseDataPreprocessor.
BC-breaking (Optional)
Every DataPreprocessor should add non_blocking param.
Use cases (Optional)
User can set pin_memory and non_blocking to True to transfer tensor from cpu to gpu asynchronously, instead of blocking the process when transfer data.
Checklist