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

Failing GPU test that isn't run by the gpuCI #327

Closed
m-albert opened this issue Jul 28, 2023 · 3 comments · Fixed by #329
Closed

Failing GPU test that isn't run by the gpuCI #327

m-albert opened this issue Jul 28, 2023 · 3 comments · Fixed by #329

Comments

@m-albert
Copy link
Collaborator

I just ran local tests with cupy installed and got a failing test:

>       out = threshold_local(self.image, block_size, method='gaussian')

tests/test_dask_image/test_ndfilters/test_cupy_threshold.py:37:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
dask_image/ndfilters/_threshold.py:87: in threshold_local
    thresh_image = _gaussian.gaussian_filter(image, sigma, mode=mode,
dask_image/ndfilters/_gaussian.py:65: in gaussian_filter
    sigma = _get_sigmas(image, sigma)
dask_image/ndfilters/_gaussian.py:25: in _get_sigmas
    nsigmas = np.array(sigma)
../../miniconda3/envs/test_dask_image/lib/python3.10/site-packages/dask/array/core.py:1703: in __array__
    x = np.array(x)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   ???
E   TypeError: Implicit conversion to a NumPy array is not allowed. Please use `.get()` to construct a NumPy array explicitly.

cupy/_core/core.pyx:1480: TypeError

I think the error makes sense, as sigma is passed as a cupy backed dask array by dask_image.ndfilters.threshold_local:

sigma = (da.asarray(block_size, like=image._meta) - 1) / 6.0

However, somehow the gpuCI doesn't pick it up.

tests.test_dask_image.test_ndfilters contains test_cupy_ndfilters.py and test_cupy_threshold.py. For some reason the tests in the former are run and the test defined in the latter is ignored... Why could this be?

@GenevieveBuckley
Copy link
Collaborator

I don't have good insight into the gpuCI. Perhaps @jakirkham or @charlesbluca might have a better idea about what might be going wrong here?

@jakirkham
Copy link
Member

jakirkham commented Aug 1, 2023

We seem to be using an old class-style setup in the threshold modules (with a decorator)

Maybe we should move away from this structure to something more similar to typical pytest usage (like functions maybe with a fixture)

@m-albert
Copy link
Collaborator Author

m-albert commented Aug 1, 2023

Think I found the problem. Trying to recreate the way the gpuci performs tests I realized that the ignored function is not marked with @pytest.mark.cupy. Marking it includes it in the tests, at least locally.

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 a pull request may close this issue.

3 participants