Skip to content

2 NumPy/MKL issues on CPU with tests/test_linalg.py::test_eig_arange #1005

Closed
@densmirn

Description

@densmirn

Test tests/test_linalg.py::test_eig_arange raises 2 issues on CPU.

  1. Call of const std::int64_t scratchpad_size = mkl_lapack::syevd_scratchpad_size<double>(DPNP_QUEUE, oneapi::mkl::job::vec, oneapi::mkl::uplo::upper, size, lda); in the function dpnp_eigvals_c returns wrong value that causes out of memory issue.
  2. Call of the function oneapi::mkl::lapack::syevd in dpnp_eigvals_c causes segfault.
event = mkl_lapack::syevd(DPNP_QUEUE,               // queue
                          oneapi::mkl::job::vec,    // jobz
                          oneapi::mkl::uplo::upper, // uplo
                          size,                     // The order of the matrix A (0 <= n)
                          result_vec_kern,
                          lda,
                          result_val_kern,
                          scratchpad,
                          scratchpad_size);
event.wait();

Example of the command to reproduce the issues:
SYCL_DEVICE_FILTER=cpu pytest tests/test_linalg.py::test_eig_arange[2-float64]

High-level reason of the issues is numpy is imported before dpnp in third party tests. E.g. change #1004 gets around the issue.
Low-level reason of the issues could be related to MKL runtime library loaded during numpy import that needs to be investigated.

DPNP was built from source on commit 61ae592 with below environment:

attrs                     21.2.0             pyhd3eb1b0_0    intel
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                        py_2    conda-forge
backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
bzip2                     1.0.8                hb9a14ef_8    intel
ca-certificates           2020.12.5                     0    intel
certifi                   2020.12.5        py38he139614_0    intel
cmake                     3.19.6               h973ab73_0
cython                    0.29.23          py38hb3b8d61_0    intel
decorator                 5.0.9              pyhd3eb1b0_0    intel
dpcpp-cpp-rt              2021.4.0             intel_3561    intel
dpcpp_cpp_rt              2021.4.0             intel_3561    intel
dpcpp_impl_linux-64       2021.4.0             intel_3561    intel
dpcpp_linux-64            2021.4.0             intel_3561    intel
dpctl                     0.11.0dev0      py38h2bc3f7f_34    dppy/label/dev
dpl-include               2021.4.0                intel_0    intel
expat                     2.4.1                h9c3ff4c_0    conda-forge
icc_rt                    2021.4.0             intel_3561    intel
iniconfig                 1.1.1              pyh9f0ad1d_0    conda-forge
intel-cmplr-lib-rt        2021.4.0             intel_3561    intel
intel-cmplr-lic-rt        2021.4.0             intel_3561    intel
intel-opencl-rt           2021.4.0             intel_3561    intel
intel-openmp              2021.4.0             intel_3561    intel
intelpython               2021.4.0                      0    intel
ipython                   7.27.0           py38hb070fc8_0
jedi                      0.18.0           py38h578d9bd_2    conda-forge
libcurl                   7.78.0               h471713a_2    intel
libffi                    3.3                          13    intel
libgcc-ng                 9.3.0              hdf63c60_101    intel
libssh2                   1.9.0                h4b1ad09_1    intel
libstdcxx-ng              9.3.0              hdf63c60_101    intel
libuv                     1.40.0               h7b6447c_0    intel
lz4-c                     1.9.3                h688b341_1    intel
matplotlib-inline         0.1.3              pyhd8ed1ab_0    conda-forge
mkl                       2021.4.0              intel_640    intel
mkl-devel                 2021.4.0              intel_640    intel
mkl-devel-dpcpp           2021.4.0              intel_640    intel
mkl-dpcpp                 2021.4.0              intel_640    intel
mkl-include               2021.4.0              intel_640    intel
mkl-service               2.4.0            py38h76adbe5_0    intel
mkl_fft                   1.3.0            py38h6d51d7b_1    intel
mkl_random                1.2.2            py38hd4cd407_1    intel
mkl_umath                 0.1.1            py38hff32f8b_9    intel
more-itertools            8.10.0             pyhd8ed1ab_0    conda-forge
ncurses                   6.2                  hf61fa16_1    intel
numpy                     1.20.3           py38h699e47d_1    intel
numpy-base                1.20.3           py38hf45626f_1    intel
openssl                   1.1.1k               h14c3975_3    intel
packaging                 21.0               pyhd8ed1ab_0    conda-forge
parso                     0.8.2              pyhd8ed1ab_0    conda-forge
pexpect                   4.8.0              pyh9f0ad1d_2    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pip                       21.1.1           py38ha59826b_0    intel
pluggy                    1.0.0            py38h578d9bd_1    conda-forge
prompt-toolkit            3.0.20             pyha770c72_0    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
py                        1.10.0             pyhd3deb0d_0    conda-forge
pygments                  2.10.0             pyhd8ed1ab_0    conda-forge
pyparsing                 2.4.7            py38h0618fa2_2    intel
pytest                    6.2.5            py38h578d9bd_0    conda-forge
python                    3.8.11               ha27d850_1    intel
python_abi                3.8                      2_cp38    conda-forge
rhash                     1.4.1                h7f98852_0    conda-forge
setuptools                52.0.0           py38h0d5a7d4_0    intel
six                       1.16.0           py38h7c2029b_0    intel
sqlite                    3.36.0               hb9a14ef_2    intel
tbb                       2021.4.0              intel_643    intel
tbb-devel                 2021.4.0              intel_643    intel
tbb4py                    2021.4.0         py38_intel_643    intel
tcl                       8.6.10                        1    intel
tk                        8.6.10               h8e2d9d6_3    intel
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
traitlets                 5.1.0              pyhd8ed1ab_0    conda-forge
wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
wheel                     0.36.2           py38ha11c92b_0    intel
xz                        5.2.5                h74280d8_2    intel
zlib                      1.2.11.1             h1e99aa7_4    intel
zstd                      1.4.5                h3f200d0_0    intel

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions