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

Ensure synchronization by adding cuda.synchronize() #8058

Merged
merged 3 commits into from
Aug 30, 2024

Conversation

KumoLiu
Copy link
Contributor

@KumoLiu KumoLiu commented Aug 30, 2024

Fixes #8054

Description

Add cuda sync after invoke cuda

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.

Signed-off-by: YunLiu <[email protected]>
Signed-off-by: YunLiu <[email protected]>
@ericspod
Copy link
Member

Will this be fine if we don't have CUDA installed, ie. CPU-only Pytorch? If not we may have to wrap the call in a function which checks if CUDA is present. It looks fine to me otherwise.

Signed-off-by: YunLiu <[email protected]>
@KumoLiu
Copy link
Contributor Author

KumoLiu commented Aug 30, 2024

Will this be fine if we don't have CUDA installed, ie. CPU-only Pytorch? If not we may have to wrap the call in a function which checks if CUDA is present. It looks fine to me otherwise.

Hi @ericspod, I add cuda check for the filter one, for the distance culculate one should be fine since it will check cupy before move data to the cuda.

@KumoLiu KumoLiu mentioned this pull request Aug 30, 2024
7 tasks
@ericspod
Copy link
Member

Hi @ericspod, I add cuda check for the filter one, for the distance culculate one should be fine since it will check cupy before move data to the cuda

Thanks, looks good!

@KumoLiu
Copy link
Contributor Author

KumoLiu commented Aug 30, 2024

/build

@KumoLiu KumoLiu merged commit b209347 into Project-MONAI:dev Aug 30, 2024
28 checks passed
@KumoLiu KumoLiu deleted the cuda-sync branch August 30, 2024 16:46
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.

Cuda sync issue after update base image
3 participants