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

Problem with pip and anaconda scipy versions due to MKL #39

Open
verginer opened this issue Feb 28, 2018 · 3 comments
Open

Problem with pip and anaconda scipy versions due to MKL #39

verginer opened this issue Feb 28, 2018 · 3 comments
Assignees
Labels
Milestone

Comments

@verginer
Copy link
Member

verginer commented Feb 28, 2018

The results of functions which rely on scipy linear algebra (e.g. scipy.sparse.linalg.eigen) can give significant different results depending on whether scipy was compiled with MKL (i.e. conda install) or without (i.e. pip install).

The differences in results are significant. For example from the tests:

test_eigen_centrality
...
1.7205880187995493 != 1.7461339874793727
2.007652443416882 != 2.030946758

Similarly convergence is inconsistent depending on MKL.

To make this more transparent it might be good to explicitely tell the user when using affected functions through a log message (i.e. INFO) that the results might be different if an other scipy version is used.

The following invocation will list any MKL compile time flags:

In [1]: import scipy
In [2]: scipy.show_config()

openblas_lapack_info:
  NOT AVAILABLE
mkl_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['anaconda3/envs/pathpy/lib']
    define_macros = [('SCIPY_MKL_H', None)]
    include_dirs = ['anaconda3/envs/pathpy/include']
lapack_mkl_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['/anaconda3/envs/pathpy/lib']
    define_macros = [('SCIPY_MKL_H', None)]
    include_dirs = ['/anaconda3/envs/pathpy/include']
lapack_opt_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['/anaconda3/envs/pathpy/lib']
    define_macros = [('SCIPY_MKL_H', None)]
    include_dirs = ['/anaconda3/envs/pathpy/include']
blas_mkl_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['/anaconda3/envs/pathpy/lib']
    define_macros = [('SCIPY_MKL_H', None)]
    include_dirs = ['/anaconda3/envs/pathpy/include']
blas_opt_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['/anaconda3/envs/pathpy/lib']
    define_macros = [('SCIPY_MKL_H', None)]
    include_dirs = ['/anaconda3/envs/pathpy/include']
@verginer verginer added the bug label Mar 16, 2018
@verginer verginer added this to the 2.0 milestone Mar 16, 2018
@verginer
Copy link
Member Author

Currently solved by setting the test to xfail(i.e. expected fail) and reduce the absolute accepted deviation from 1e-16 to 1e-3

@IngoScholtes
Copy link
Collaborator

now mentioned in list of known issues in Readme

@IngoScholtes
Copy link
Collaborator

Kamino cloned this issue to uzhdag/pathpy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants