Repository navigation
Fix ImportError from vendored code - #252
Merged
rapids-bot[bot] merged 6 commits intoMar 31, 2022
Merged
rapids-bot[bot] merged 6 commits into
rapids-bot[bot] merged 6 commits into
Conversation
Member
|
Thanks Greg! 😄 Instead of vendoring what if we do a Agree in the medium term would be good to contribute upstream to avoid needing these internal bits. |
Contributor
Author
Do you mean modifying try:
import cupyx.scipy.ndimage
if hasattr(cupyx.scipy.ndimage, '_filters'):
# CuPy 11.x
from cupyx.scipy.ndimage._filters import _get_correlate_kernel
else:
from cupyx.scipy.ndimage.filters import _get_correlate_kernel
except ImportError:
import cupy
from cucim.skimage._vendored import _ndimage_filters_core as _filters_core
@cupy.memoize(for_each_device=True)
def _get_correlate_kernel(mode, w_shape, int_type, offsets, cval):
return _filters_core._generate_nd_kernel(
'correlate',
'W sum = (W)0;',
'sum += cast<W>({value}) * wval;',
'y = cast<Y>(sum);',
mode, w_shape, int_type, offsets, cval, ctype='W')That would let us potentially benefit from any upstream improvements or fixes to |
Member
|
Alright let's go with this as-is, but let's work on upstreaming the rest of what is needed for 22.06. Could you please file an issue to track this? |
jakirkham
approved these changes
Mar 31, 2022
Member
|
@gpucibot merge |
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.
closes #251 by avoiding imports from private CuPy code
The new files here are just subsets of files present in CuPy that are not part of its public API. Only a few functions use functionality from this
_vendoredfolder.The whole folder is mainly here in order to have a version of
cupyx.scipy.signal.fftconvolvewith a modifiedchoose_conv_mode. We should eventually just update the convolution selection code in CuPy so that we can remove these files.I think
fftconvolveitself was not present at all in CuPy 9.x, but even in the current development branch, the convolution choice function is still restricted to 1D