1871 thread-safety for the cache-based datasets#2227
Merged
Conversation
Contributor
Author
|
/black |
5e50a9a to
702ab37
Compare
ericspod
reviewed
May 21, 2021
ericspod
approved these changes
May 21, 2021
Contributor
|
Thanks for the enhancement for CacheDataset, it's heavily used in NVIDIA Clara project, I will try to review this PR as soon as possible. |
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Nic-Ma
reviewed
May 21, 2021
Nic-Ma
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the enhancement, put several comments inline.
Others look good to me.
Thanks.
Signed-off-by: monai-bot <monai.miccai2019@gmail.com>
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
wyli
added a commit
that referenced
this pull request
May 26, 2021
* thread safety impl. Signed-off-by: Wenqi Li <wenqil@nvidia.com> * fixes croppad Signed-off-by: Wenqi Li <wenqil@nvidia.com> * fixed intensity Signed-off-by: Wenqi Li <wenqil@nvidia.com> * fixes spatial Signed-off-by: Wenqi Li <wenqil@nvidia.com> * fixes util Signed-off-by: Wenqi Li <wenqil@nvidia.com> * autofix Signed-off-by: Wenqi Li <wenqil@nvidia.com> * update docstring Signed-off-by: Wenqi Li <wenqil@nvidia.com> * update datastats Signed-off-by: Wenqi Li <wenqil@nvidia.com> * fixes docstring Signed-off-by: Wenqi Li <wenqil@nvidia.com> * fixes torch 1.7 issue Signed-off-by: Wenqi Li <wenqil@nvidia.com> * fixes mac/win n_workers Signed-off-by: Wenqi Li <wenqil@nvidia.com> * update based on comments Signed-off-by: Wenqi Li <wenqil@nvidia.com> * [MONAI] python code formatting Signed-off-by: monai-bot <monai.miccai2019@gmail.com> Co-authored-by: monai-bot <monai.miccai2019@gmail.com>
wyli
added a commit
that referenced
this pull request
May 26, 2021
* thread safety impl. Signed-off-by: Wenqi Li <wenqil@nvidia.com> * fixes croppad Signed-off-by: Wenqi Li <wenqil@nvidia.com> * fixed intensity Signed-off-by: Wenqi Li <wenqil@nvidia.com> * fixes spatial Signed-off-by: Wenqi Li <wenqil@nvidia.com> * fixes util Signed-off-by: Wenqi Li <wenqil@nvidia.com> * autofix Signed-off-by: Wenqi Li <wenqil@nvidia.com> * update docstring Signed-off-by: Wenqi Li <wenqil@nvidia.com> * update datastats Signed-off-by: Wenqi Li <wenqil@nvidia.com> * fixes docstring Signed-off-by: Wenqi Li <wenqil@nvidia.com> * fixes torch 1.7 issue Signed-off-by: Wenqi Li <wenqil@nvidia.com> * fixes mac/win n_workers Signed-off-by: Wenqi Li <wenqil@nvidia.com> * update based on comments Signed-off-by: Wenqi Li <wenqil@nvidia.com> * [MONAI] python code formatting Signed-off-by: monai-bot <monai.miccai2019@gmail.com> Co-authored-by: monai-bot <monai.miccai2019@gmail.com>
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 #1871
Description
this PR addresses cache-based dataset multi-thread preloading issues by:
monai.transforms.ThreadUnsafeAPI, the unsafe transforms will be deepcopied in the cache computation.ThreadUnsafeall the randomisables are not thread-safe, but we only use them with multi-process dataloader, there's no multi-thread issue.
Status
Ready
Types of changes
./runtests.sh -f -u --net --coverage../runtests.sh --quick --unittests.make htmlcommand in thedocs/folder.