Skip to content

3961 fixes testing memory bug and revert the workaround#3978

Merged
wyli merged 6 commits intoProject-MONAI:devfrom
wyli:3961-testing-memory-issue
Mar 22, 2022
Merged

3961 fixes testing memory bug and revert the workaround#3978
wyli merged 6 commits intoProject-MONAI:devfrom
wyli:3961-testing-memory-issue

Conversation

@wyli
Copy link
Copy Markdown
Contributor

@wyli wyli commented Mar 22, 2022

Fixes #3961

Description

Multiprocessing in the 'spawn' mode would trigger the has_cupy evaluation for each subprocess. the evaluations will cause multple cuda context loading which takes a good amount of memory. The issue becomes obvious when 'num_workers' is large.

The solution here is to skip cupy check if it's in subprocess. (the main testing process is named by default "MainProcess"). A stress test is added to avoid this bug in the future.

Status

Ready

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests --disttests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

@wyli wyli force-pushed the 3961-testing-memory-issue branch from 0bb07fb to 4295969 Compare March 22, 2022 16:21
@wyli
Copy link
Copy Markdown
Contributor Author

wyli commented Mar 22, 2022

/integration-test

@wyli wyli marked this pull request as ready for review March 22, 2022 21:41
@wyli wyli requested a review from Nic-Ma March 22, 2022 21:42
Copy link
Copy Markdown
Contributor

@Nic-Ma Nic-Ma left a comment

Choose a reason for hiding this comment

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

Thanks for the deep investigation for the issue!
Looks good to me.

@wyli
Copy link
Copy Markdown
Contributor Author

wyli commented Mar 22, 2022

/build

@wyli wyli enabled auto-merge (squash) March 22, 2022 23:06
@wyli wyli merged commit 42159ff into Project-MONAI:dev Mar 22, 2022
@wyli wyli deleted the 3961-testing-memory-issue branch April 27, 2022 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Revert the workaround of base image downgrading (PR 3949)

2 participants