The pip installation of MC2 is enforcing a version of numpy that doesn't point towards a conda-installed version of OpenBLAS. I am not sure this is a MC2 issue itself and I hope it is not a stupid dance between conda and pip.
I've noticed this while trying to solve issue #24. I am still very confused there since I might be hitting a problem like the one reported on any of these: numpy #17856, numpy #19145 and numpy #14474 ... but let's not get into that since that seem to be specific to my system and belongs to issue #24. I opened this new issue as it is somehow unrelated but it might be useful in the future or you might be interested to know that this can happen.
My assumption is that one would like numpy to sort its BLAS dependencies on its own, in a way that one can control. For example, to choose a certain alternative such as MKL or a specific version of BLAS using something like conda.
Here an example using (this yaml file as a conda recipe):
We can observe that numpy was downgraded in this step - which should be fine. The problem is that in this pip transaction numpy lost the communication with the conda environment in terms of where to look for the BLAS libraries that conda kindly installed, and I chose.
python
Python 3.10.4 | packaged by conda-forge | (main, Mar 24 2022, 17:39:04) [GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> np.show_config()
blas_mkl_info:
NOT AVAILABLE
blis_info:
NOT AVAILABLE
openblas_info:
libraries = ['openblas', 'openblas']
library_dirs = ['/usr/local/lib']
language = c
define_macros = [('HAVE_CBLAS', None)]
runtime_library_dirs = ['/usr/local/lib']
blas_opt_info:
libraries = ['openblas', 'openblas']
library_dirs = ['/usr/local/lib']
language = c
define_macros = [('HAVE_CBLAS', None)]
runtime_library_dirs = ['/usr/local/lib']
lapack_mkl_info:
NOT AVAILABLE
openblas_lapack_info:
libraries = ['openblas', 'openblas']
library_dirs = ['/usr/local/lib']
language = c
define_macros = [('HAVE_CBLAS', None)]
runtime_library_dirs = ['/usr/local/lib']
lapack_opt_info:
libraries = ['openblas', 'openblas']
library_dirs = ['/usr/local/lib']
language = c
define_macros = [('HAVE_CBLAS', None)]
runtime_library_dirs = ['/usr/local/lib']
Supported SIMD extensions in this NumPy install:
baseline = SSE,SSE2,SSE3
found = SSSE3,SSE41,POPCNT,SSE42,AVX,F16C,FMA3,AVX2
not found = AVX512F,AVX512CD,AVX512_KNL,AVX512_KNM,AVX512_SKX,AVX512_CLX,AVX512_CNL,AVX512_ICL
If I repeat all the steps shown above but anticipating the version that metacells enforces via pip (numpy-1.21.6), then the misdirection of the BLAS libraries doesn't happen. (I show now just the end result for simplicity).
Here we see that MC2 could be installed and numpy points to the 'right' (conda's) BLAS libraries.
Python 3.10.4 | packaged by conda-forge | (main, Mar 24 2022, 17:38:57) [GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> np.show_config()
blas_info:
libraries = ['cblas', 'blas', 'cblas', 'blas']
library_dirs = ['/local/users/polivar/miniconda3/envs/mc2b/lib']
include_dirs = ['/local/users/polivar/miniconda3/envs/mc2b/include']
language = c
define_macros = [('HAVE_CBLAS', None)]
blas_opt_info:
define_macros = [('NO_ATLAS_INFO', 1), ('HAVE_CBLAS', None)]
libraries = ['cblas', 'blas', 'cblas', 'blas']
library_dirs = ['/local/users/polivar/miniconda3/envs/mc2b/lib']
include_dirs = ['/local/users/polivar/miniconda3/envs/mc2b/include']
language = c
lapack_info:
libraries = ['lapack', 'blas', 'lapack', 'blas']
library_dirs = ['/local/users/polivar/miniconda3/envs/mc2b/lib']
language = f77
lapack_opt_info:
libraries = ['lapack', 'blas', 'lapack', 'blas', 'cblas', 'blas', 'cblas', 'blas']
library_dirs = ['/local/users/polivar/miniconda3/envs/mc2b/lib']
language = c
define_macros = [('NO_ATLAS_INFO', 1), ('HAVE_CBLAS', None)]
include_dirs = ['/local/users/polivar/miniconda3/envs/mc2b/include']
Supported SIMD extensions in this NumPy install:
baseline = SSE,SSE2,SSE3
found = SSSE3,SSE41,POPCNT,SSE42,AVX,F16C,FMA3,AVX2
not found = AVX512F,AVX512CD,AVX512_KNL,AVX512_KNM,AVX512_SKX,AVX512_CLX,AVX512_CNL,AVX512_ICL
>>> import metacells as mc
mc.utilities.parallel.get_processors_count()
56
I guess that for users who depend on conda and a scpecific version of BLAS this will be useful to know.
MC2 just requires "numpy", there's no version restriction anywhere in the MC2 package itself. I'm afraid this is actually "a stupid dance between conda and pip". This has been known to happen :-)
The
pip
installation of MC2 is enforcing a version of numpy that doesn't point towards a conda-installed version of OpenBLAS. I am not sure this is a MC2 issue itself and I hope it is not a stupid dance between conda and pip.I've noticed this while trying to solve issue #24. I am still very confused there since I might be hitting a problem like the one reported on any of these: numpy #17856, numpy #19145 and numpy #14474 ... but let's not get into that since that seem to be specific to my system and belongs to issue #24. I opened this new issue as it is somehow unrelated but it might be useful in the future or you might be interested to know that this can happen.
My assumption is that one would like numpy to sort its BLAS dependencies on its own, in a way that one can control. For example, to choose a certain alternative such as MKL or a specific version of BLAS using something like conda.
Here an example using (this yaml file as a conda recipe):
We can now activate the environment and verify numpy's configuration
We can see that this is doing what we would expect: numpy has found the correct libraries installed by conda.
Let's now install MC2 using pip.
We can observe that numpy was downgraded in this step - which should be fine. The problem is that in this
pip
transaction numpy lost the communication with the conda environment in terms of where to look for the BLAS libraries that conda kindly installed, and I chose.If I repeat all the steps shown above but anticipating the version that
metacells
enforces via pip (numpy-1.21.6
), then the misdirection of the BLAS libraries doesn't happen. (I show now just the end result for simplicity).Here we see that MC2 could be installed and numpy points to the 'right' (conda's) BLAS libraries.
I guess that for users who depend on conda and a scpecific version of BLAS this will be useful to know.
Unfortunately this has not yet solved issue #24
Thanks for your time