Skip to content

Optional dependency cupy is not tested normally #290

Closed

Description

@ericspod

Describe the bug
The cupy library is used to do zooming on GPU as an optional requirement, if not installed scipy is used. The requirements.txt doesn't mention it so the test setup doesn't install it, leading to a number of test cases to do nothing rather than test the functionality.

One bug that is present is the test_gpu_zoom test in tests/test_rand_zoomd.py where line 63 should be:

self.assertTrue(np.allclose(expected, zoomed[key]))

To Reproduce
Steps to reproduce the behavior:

  1. Setup the environment with Python 3.7 and the libraries in requirements.txt
  2. Install cupy
  3. Run ./runtests.sh

Expected behavior
This is the question:

  • Should the CI tests be setup to install cupy and run those tests, or
  • Should these test be left as optional?

Environment (please complete the following information):

  • Ubuntu 16.04
  • Python 3.7
  • MONAI 0.1.0
  • CUDA/cuDNN 10.1

Activity

  1. tvercaut commented on Apr 29, 2020

    @tvercaut
    Member

    As discussed in the weekly meetings, we should whenever feasible, favour pure pytorch implementations. Relying on cupy for such a function doesn't sound like it's worth it. See e.g. how rising does it (although taking care of aliasing issues is probably also needed if dezooming is being performed):
    https://github.com/PhoenixDL/rising/blob/874b9b83fb1a9bd3791e273d187a163cf100fc1c/rising/transforms/spatial.py#L144-L180

  2. hjmjohnson commented on May 29, 2020

    @hjmjohnson
    Contributor

    @wyli This is actually not fixed. The test is fixed, but the test only runs if cupy is installed. Currently, cupy is not installed on the CI machines, and @tvercaut suggests that it should not be used or depended upon. I would recommend re-opening this issue until a solution regarding the use of cupy is agreed upon.

  3. reopened this on May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions