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

support GPU tensor for GridPatch and GridPatchDataset #6246

Merged
merged 10 commits into from
Mar 29, 2023

Conversation

qingpeng9802
Copy link
Contributor

Fixes #6245 .

Description

support GPU tensor for

  • GridPatch, GridPatchd, RandGridPatch and RandGridPatchd
  • GridPatchDataset, PatchIter, PatchIterd and iter_patch

Changes

Need to Notice

  • Default padding mode of PatchIter, PatchIterd and iter_patch are kept as NumpyPadMode.WRAP. However, GridPatch defaults to None. (might be inconsistent?)

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.

qingpeng9802 and others added 2 commits March 27, 2023 21:56
* `GridPatch`, `GridPatchd`, `RandGridPatch` and `RandGridPatchd`
* `GridPatchDataset`, `PatchIter`, `PatchIterd` and `iter_patch`
@wyli
Copy link
Contributor

wyli commented Mar 28, 2023

/black

Signed-off-by: monai-bot <[email protected]>
@qingpeng9802
Copy link
Contributor Author

By checking the tests in CI, it seems torch.argwhere has some compatibility issues. From pytorch/pytorch#64257, would it be better to replace torch.argwhere with torch.nonzero or a version-specified solution?

@wyli
Copy link
Contributor

wyli commented Mar 28, 2023

By checking the tests in CI, it seems torch.argwhere has some compatibility issues. From pytorch/pytorch#64257, would it be better to replace torch.argwhere with torch.nonzero or a version-specified solution?

thanks, let me skip the tests for this new feature for torch<1.11...

Signed-off-by: Wenqi Li <[email protected]>
@wyli
Copy link
Contributor

wyli commented Mar 28, 2023

there are still some typing issues, I think you can debug with ./runtests.sh --mypy locally. also please follow this page to sign the commit https://github.com/Project-MONAI/MONAI/pull/6246/checks

qingpeng9802 and others added 2 commits March 29, 2023 18:16
DCO Remediation Commit for Qingpeng Li <[email protected]>

I, Qingpeng Li <[email protected]>, hereby add my Signed-off-by to this commit: 4d178e2

Signed-off-by: Qingpeng Li <[email protected]>
@qingpeng9802
Copy link
Contributor Author

/black

monai-bot and others added 2 commits March 29, 2023 10:33
Signed-off-by: monai-bot <[email protected]>
Signed-off-by: Qingpeng Li <[email protected]>
@wyli
Copy link
Contributor

wyli commented Mar 29, 2023

/build

1 similar comment
@wyli
Copy link
Contributor

wyli commented Mar 29, 2023

/build

Signed-off-by: Wenqi Li <[email protected]>
@wyli
Copy link
Contributor

wyli commented Mar 29, 2023

/build

Copy link
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

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

thanks, it looks good to me. @ericspod @Nic-Ma @KumoLiu if you have further comments I can create followup PRs.

@wyli wyli merged commit e2f9d51 into Project-MONAI:dev Mar 29, 2023
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.

GridPatchDataset does not support GPU tensor as the data source
3 participants