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

Use SciPy's KDTree instead of deprecated cKDTree #733

Merged
merged 4 commits into from
Apr 30, 2024

Conversation

grlee77
Copy link
Contributor

@grlee77 grlee77 commented Apr 27, 2024

Functionality is equivalent since SciPy 1.6 (see note here).

I pinned SciPy to >= 1.6 (released Dec 31, 2020)

This MR also adds some missing test cases for the _ensure_spacing helper function used by cucim.skimage.feature.peak_local_max. The new tests revealed a bug in that function in the case of non-scalar spacing which is now fixed.

Also, CuPy recently added KDTree so we can hopefully improve performance by moving to that in the future. I opened issue #732 as a reminder to investigate that.

@grlee77 grlee77 added bug Something isn't working maintenance labels Apr 27, 2024
@grlee77 grlee77 added this to the v24.06.00 milestone Apr 27, 2024
@grlee77 grlee77 requested review from a team as code owners April 27, 2024 15:39
@grlee77 grlee77 added the non-breaking Introduces a non-breaking change label Apr 27, 2024
@grlee77
Copy link
Contributor Author

grlee77 commented Apr 27, 2024

Some nvjitlink-related failure occurs in CuPy for the conda test cases. Not sure if it is related to the recent CuPy 13.1.0 release or some other cause.

Failures have the following form

2024-04-27T16:07:59.3287426Z =================================== FAILURES ===================================
2024-04-27T16:07:59.3289101Z _____________________________ test_2d_bf[float16] ______________________________
2024-04-27T16:07:59.3291152Z [gw4] linux -- Python 3.11.9 /opt/conda/envs/test/bin/python3.11
2024-04-27T16:07:59.3294929Z src/cucim/skimage/segmentation/tests/test_random_walker.py:84: in test_2d_bf
2024-04-27T16:07:59.3298859Z     labels_bf = random_walker(data, labels, beta=beta, mode="bf")
2024-04-27T16:07:59.3302302Z /opt/conda/envs/test/lib/python3.11/site-packages/cucim/skimage/_shared/utils.py:343: in fixed_func
2024-04-27T16:07:59.3305252Z     return func(*args, **kwargs)
2024-04-27T16:07:59.3308472Z /opt/conda/envs/test/lib/python3.11/site-packages/cucim/skimage/segmentation/random_walker_segmentation.py:523: in random_walker
2024-04-27T16:07:59.3311391Z     lap_sparse, B = _build_linear_system(
2024-04-27T16:07:59.3315377Z /opt/conda/envs/test/lib/python3.11/site-packages/cucim/skimage/segmentation/random_walker_segmentation.py:154: in _build_linear_system
2024-04-27T16:07:59.3318342Z     lap_sparse = _build_laplacian(
2024-04-27T16:07:59.3321328Z /opt/conda/envs/test/lib/python3.11/site-packages/cucim/skimage/segmentation/random_walker_segmentation.py:132: in _build_laplacian
2024-04-27T16:07:59.3324390Z     lap = lap.tocsr()
2024-04-27T16:07:59.3326431Z /opt/conda/envs/test/lib/python3.11/site-packages/cupyx/scipy/sparse/_coo.py:527: in tocsr
2024-04-27T16:07:59.3328453Z     from cupyx import cusparse
2024-04-27T16:07:59.3330416Z /opt/conda/envs/test/lib/python3.11/site-packages/cupyx/cusparse.py:9: in <module>
2024-04-27T16:07:59.3333594Z     from cupy_backends.cuda.libs import cusparse as _cusparse
2024-04-27T16:07:59.3337828Z E   ImportError: libnvJitLink.so.12: cannot open shared object file: No such file or directory

@jakirkham
Copy link
Member

After offline discussion, think this was an issue in the CuPy packages that was fixed recently with PR: conda-forge/cupy-feedstock#269

Restarting CI

@grlee77
Copy link
Contributor Author

grlee77 commented Apr 29, 2024

| After offline discussion, think this was an issue in the CuPy packages that was fixed recently with PR: conda-forge/cupy-feedstock#269

Was just going to ping you and ask, but saw you already resolved the issue. Thanks @jakirkham!

Copy link
Member

@raydouglass raydouglass left a comment

Choose a reason for hiding this comment

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

@jakirkham
Copy link
Member

Yes Greg could you please update these lines?

@grlee77
Copy link
Contributor Author

grlee77 commented Apr 30, 2024

@raydouglass , @jakirkham : Thanks, I have now updated the pinning in the conda recipe

@jakirkham
Copy link
Member

/merge

@rapids-bot rapids-bot bot merged commit fb94e16 into rapidsai:branch-24.06 Apr 30, 2024
45 checks passed
@jakirkham
Copy link
Member

Thanks Greg and Ray! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working maintenance non-breaking Introduces a non-breaking change
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants