-
Notifications
You must be signed in to change notification settings - Fork 59
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
Improve performance of Euclidean distance transform #406
Merged
rapids-bot
merged 4 commits into
rapidsai:branch-22.12
from
grlee77:perf-distance-transform
Nov 23, 2022
Merged
Improve performance of Euclidean distance transform #406
rapids-bot
merged 4 commits into
rapidsai:branch-22.12
from
grlee77:perf-distance-transform
Nov 23, 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
grlee77
added
improvement
Improves an existing functionality
non-breaking
Introduces a non-breaking change
labels
Sep 6, 2022
grlee77
force-pushed
the
perf-distance-transform
branch
from
September 6, 2022 15:25
e98982c
to
b189722
Compare
gigony
approved these changes
Nov 15, 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.
Thanks @grlee77 , it looks good to me!
@gpucibot merge |
rapids-bot bot
pushed a commit
that referenced
this pull request
Nov 28, 2022
…el sizes into account) (#407) Please review/merge #406 before this one as those changes are also present here. This PR adds support for anisotropic pixel/voxel shape to `distance_transform_edt` via the `sampling` kwarg. The changes involve just making variants of the kernels involving distance computations that do floating-point instead of integer-valued computations so that scaling by the sample spacings can be taken into account. Authors: - Gregory Lee (https://github.com/grlee77) Approvers: - Gigon Bae (https://github.com/gigony) URL: #407
rapids-bot bot
pushed a commit
that referenced
this pull request
Nov 29, 2022
related to #419 These are based on the distance transform and are a faster way of computing binary morphological operations for large diameter disk or ball footprints. Unlike the sequence footprint decomposition methods, the footprint is exactly circular (spherical). One test case `test_isotropic_erosion_spacing` will require #407 to be merged first. #406 will also improve the performance of this implementation Authors: - Gregory Lee (https://github.com/grlee77) Approvers: - Gigon Bae (https://github.com/gigony) URL: #421
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
This PR gives a further 2-4x speedup to the 2D and 3D distance transform functions by creating dedicated elementwise CUDA kernels for the pre- and post-processing steps. These include, for example, packing and upacking the 3D coordinates into a single integer. This resolves various "TODO" comments that were in the source, but I don't think we have an issue open for this.
Aside from the performance benefit there is also a substantial reduction in memory usage for the default case of
return_distance=True, return_indices=False
as in this case the explicit arrays of indices never need to be created.Benchmarks
Implementation from release 22.08.01
Proposed Implementation