question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Test fails when using numpy with MKL backend

See original GitHub issue
% pytest -m 'not slow' -x tests/cupy_tests/fft_tests/test_fft.py                                                                                                                                                                                              
==================================================================================================================== test session starts =====================================================================================================================
platform linux -- Python 3.6.9, pytest-4.6.2, py-1.8.0, pluggy-0.12.0
rootdir: /path/to/cupy, inifile: setup.cfg
plugins: xdist-1.28.0, forked-1.0.2
collected 389 items / 1 deselected / 388 selected                                                                                                                                                                                                            

tests/cupy_tests/fft_tests/test_fft.py ......................................................................................F

========================================================================================================================== FAILURES ==========================================================================================================================
_________________________________________________________________________________________________________________ TestFft2_param_1.test_fft2 _________________________________________________________________________________________________________________

self = <cupy.testing.parameterized.TestFft2_param_1 testMethod=test_fft2>, args = (), kw = {'enable_nd': True}, planning_state = True, nd_planning = True

    @functools.wraps(impl)
    def test_func(self, *args, **kw):
        # get original global planning state
        planning_state = config.enable_nd_planning
        try:
            for nd_planning in states:
                try:
                    # enable or disable nd planning
                    config.enable_nd_planning = nd_planning
    
                    kw[name] = nd_planning
>                   impl(self, *args, **kw)

tests/cupy_tests/fft_tests/test_fft.py:41: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cupy/testing/helper.py:627: in test_func
    impl(self, *args, **kw)
cupy/testing/helper.py:156: in test_func
    accept_error=accept_error)
cupy/testing/helper.py:92: in _check_cupy_numpy_error
    self.fail('Only numpy raises error\n\n' + numpy_tb)
E   AssertionError: Parameterized test failed.
E   
E   Base test method: TestFft2.test_fft2
E   Test parameters:
E     shape: (3, 4)
E     s: (1, None)
E     axes: None
E     norm: None
E   
E   AssertionError: Only numpy raises error
E   
E   Traceback (most recent call last):
E     File "/path/to/cupy/cupy/testing/helper.py", line 28, in _call_func
E       result = impl(self, *args, **kw)
E     File "/path/to/cupy/tests/cupy_tests/fft_tests/test_fft.py", line 207, in test_fft2
E       out = xp.fft.fft2(a, s=self.s, norm=self.norm)
E     File "/some/path/lib/python3.6/site-packages/mkl_fft/_numpy_fft.py", line 875, in fft2
E       return fftn(x, s=s, axes=axes, norm=norm)
E     File "/some/path/lib/python3.6/site-packages/mkl_fft/_numpy_fft.py", line 683, in fftn
E       output = mkl_fft.fftn(x, s, axes)
E     File "mkl_fft/_pydfti.pyx", line 860, in mkl_fft._pydfti.fftn
E     File "mkl_fft/_pydfti.pyx", line 846, in mkl_fft._pydfti._fftnd_impl
E     File "mkl_fft/_pydfti.pyx", line 724, in mkl_fft._pydfti._iter_fftnd
E     File "mkl_fft/_pydfti.pyx", line 684, in mkl_fft._pydfti._init_nd_shape_and_axes
E   ValueError: when given, shape values must be integers
-------------------------------------------------------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------------------------------------------------------
dtype is <class 'numpy.float64'>
enable_nd is True
===================================================================================================== 1 failed, 86 passed, 1 deselected in 3.68 seconds ======================================================================================================

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
grlee77commented, Sep 17, 2019

But I am not sure if we are able to detect the NumPy’s backend in tests?

Even when MKL is present, non-MKL versions of the functions should still be available. For NumPy <1.17, these are numpy.fft.fftpack.*, etc. (for numpy >=1.17 numpy.fft.pocketfft.*)`.

0reactions
kmaehashicommented, Sep 17, 2019

We discussed and using numpy.fft.fftpack in unit tests sounds reasonable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Keras with Tensorflow backend on GPU. MKL ERROR
I installed Tensorflow with GPU support and Keras to an environment in Anaconda (v1.6.5) by using following commands ...
Read more >
Intel MKL 2018 update 2 freezes during numpy test
Newly released Intel MKL 2018 Update 2 freezes when running standard numpy (1.14.2) test suite. It stops running.
Read more >
Error installing NumPy via Pip on macOS Big Sur with python ...
Reproducing code example: Install Pandas with PIP after a clean install of macOS Big Sur and Python3.9 via Homebrew. pip install pandas pip3 ......
Read more >
Windows 64 and 32 bit fail the NumPy test suite - PyPy
be sure you have visual studio 2015 or later installed. I use 2019. · download a windows zipfile · clone the NumPy git...
Read more >
Building from source — NumPy v1.25.dev0 Manual
will prefer to use ATLAS, then BLIS, then OpenBLAS and as a last resort MKL. If neither of these exists the build will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found