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

tracking issue topics Smit #36

Closed
16 of 19 tasks
rgommers opened this issue Jul 6, 2021 · 10 comments
Closed
16 of 19 tasks

tracking issue topics Smit #36

rgommers opened this issue Jul 6, 2021 · 10 comments

Comments

@rgommers
Copy link
Owner

rgommers commented Jul 6, 2021

Hi @Smit-create, as we talked about on the weekend, let's keep a list of topics and ideas that would be interesting to work on.

@Smit-create
Copy link

Hi Ralf,
I was trying to work on the benchmark part. I am getting the following error:

numpy.distutils.system_info.NotFoundError: No BLAS/LAPACK libraries found.
   To build Scipy from sources, BLAS & LAPACK libraries need to be installed.
   See site.cfg.example in the Scipy source directory and
   https://docs.scipy.org/doc/scipy/reference/building/index.html for details.

I followed the steps mentioned here: https://docs.scipy.org/doc/scipy/reference/building/linux.html#debian-ubuntu to install BLAS/LAPACK

I got this error while running: $asv run

@rgommers
Copy link
Owner Author

Do you have libopenblas-dev installed? If so, it looks like the build cannot find it. There's a way to make it find it by using a site.cfg file (https://github.com/scipy/scipy/blob/master/site.cfg.example).

If you're using conda then this should never be needed, but if you installed Python some other way than it's possible that libopenblas and libopenblas-dev got installed in some nonstandard location that numpy.distutils has trouble with.

Please let me know if that didn't fix it!

@Smit-create
Copy link

Smit-create commented Aug 27, 2021

Please let me know if that didn't fix it!

The whole traceback looks like this:

Details

·· Error running /home/smit/Smitlunagariya/scipy/benchmarks/env/9774801ae38aac7b90590412a25793ef/bin/python setup.py build (exit status 1)
   STDOUT -------->
   Running scipy/stats/_generate_pyx.py
   Running scipy/linalg/_generate_pyx.py
   Running scipy/special/_generate_pyx.py
   Processing scipy/interpolate/_bspl.pyx
   Processing scipy/interpolate/interpnd.pyx
   Processing scipy/interpolate/_ppoly.pyx
   Processing scipy/spatial/ckdtree.pyx
   Processing scipy/spatial/_hausdorff.pyx
   Processing scipy/spatial/qhull.pyx
   Processing scipy/spatial/_voronoi.pyx
   Processing scipy/spatial/transform/rotation.pyx
   Processing scipy/stats/_sobol.pyx
   Processing scipy/stats/_qmc_cy.pyx
   Processing scipy/stats/biasedurn.pyx
   Processing scipy/stats/_stats.pyx
   Processing scipy/stats/_boost/src/hypergeom_ufunc.pyx
   Processing scipy/stats/_boost/src/binom_ufunc.pyx
   Processing scipy/stats/_boost/src/nbinom_ufunc.pyx
   Processing scipy/stats/_boost/src/beta_ufunc.pyx
   Processing scipy/signal/_peak_finding_utils.pyx
   Processing scipy/signal/_sosfilt.pyx
   Processing scipy/signal/_spectral.pyx
   Processing scipy/signal/_upfirdn_apply.pyx
   Processing scipy/signal/_max_len_seq_inner.pyx
   Processing scipy/linalg/_solve_toeplitz.pyx
   Processing scipy/linalg/_decomp_update.pyx.in
   Processing scipy/linalg/cython_blas.pyx
   Processing scipy/linalg/_matfuncs_sqrtm_triu.pyx
   Processing scipy/linalg/cython_lapack.pyx
   Processing scipy/sparse/_csparsetools.pyx.in
   Processing scipy/sparse/csgraph/_traversal.pyx
   Processing scipy/sparse/csgraph/_tools.pyx
   Processing scipy/sparse/csgraph/_flow.pyx
   Processing scipy/sparse/csgraph/_min_spanning_tree.pyx
   Processing scipy/sparse/csgraph/_matching.pyx
   Processing scipy/sparse/csgraph/_shortest_path.pyx
   Processing scipy/sparse/csgraph/_reordering.pyx
   Processing scipy/_lib/messagestream.pyx
   Processing scipy/_lib/_test_deprecation_call.pyx
   Processing scipy/_lib/_test_deprecation_def.pyx
   Processing scipy/_lib/_ccallback_c.pyx
   Processing scipy/io/matlab/mio5_utils.pyx
   Processing scipy/io/matlab/mio_utils.pyx
   Processing scipy/io/matlab/streams.pyx
   Processing scipy/special/_ellip_harm_2.pyx
   Processing scipy/special/_comb.pyx
   Processing scipy/special/cython_special.pyx
   Processing scipy/special/_ufuncs_cxx.pyx
   Processing scipy/special/_ufuncs.pyx
   Processing scipy/special/_test_round.pyx
   Processing scipy/fftpack/convolve.pyx
   Processing scipy/cluster/_vq.pyx
   Processing scipy/cluster/_optimal_leaf_ordering.pyx
   Processing scipy/cluster/_hierarchy.pyx
   Processing scipy/ndimage/src/_cytest.pyx
   Processing scipy/ndimage/src/_ni_label.pyx
   Processing scipy/optimize/_bglu_dense.pyx
   Processing scipy/optimize/_group_columns.pyx
   Processing scipy/optimize/_highs/cython/src/_highs_wrapper.pyx
   Processing scipy/optimize/_highs/cython/src/_highs_constants.pyx
   Processing scipy/optimize/_lsq/givens_elimination.pyx
   Processing scipy/optimize/_trlib/_trlib.pyx
   Processing scipy/optimize/cython_optimize/_zeros.pyx.in
   Cythonizing sources
   lapack_opt_info:
   lapack_mkl_info:
   customize UnixCCompiler
   C compiler: /home/smit/anaconda3/envs/scipy-dev/bin/x86_64-conda-linux-gnu-cc -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/smit/anaconda3/envs/scipy-dev/include -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/smit/anaconda3/envs/scipy-dev/include -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/smit/anaconda3/envs/scipy-dev/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/smit/anaconda3/envs/scipy-dev/include -fPIC
   
   creating /tmp/tmpizdjdiu3/tmp
   creating /tmp/tmpizdjdiu3/tmp/tmpizdjdiu3
   compile options: '-MMD -MF /tmp/tmpizdjdiu3/file.c.d -c'
   x86_64-conda-linux-gnu-cc: /tmp/tmpizdjdiu3/file.c
     libraries mkl_rt not found in ['/home/smit/Smitlunagariya/scipy/benchmarks/env/9774801ae38aac7b90590412a25793ef/lib', '/usr/local/lib', '/usr/lib', '/usr/lib/']
     NOT AVAILABLE
   
   openblas_lapack_info:
     libraries openblas not found in ['/home/smit/Smitlunagariya/scipy/benchmarks/env/9774801ae38aac7b90590412a25793ef/lib', '/usr/local/lib', '/usr/lib', '/usr/lib/']
     NOT AVAILABLE
   
   openblas_clapack_info:
     libraries openblas,lapack not found in ['/home/smit/Smitlunagariya/scipy/benchmarks/env/9774801ae38aac7b90590412a25793ef/lib', '/usr/local/lib', '/usr/lib', '/usr/lib/']
     NOT AVAILABLE
   
   flame_info:
     libraries flame not found in ['/home/smit/Smitlunagariya/scipy/benchmarks/env/9774801ae38aac7b90590412a25793ef/lib', '/usr/local/lib', '/usr/lib', '/usr/lib/']
     NOT AVAILABLE
   
   accelerate_info:
     NOT AVAILABLE
   
   atlas_3_10_threads_info:
   Setting PTATLAS=ATLAS
     libraries lapack_atlas not found in /home/smit/Smitlunagariya/scipy/benchmarks/env/9774801ae38aac7b90590412a25793ef/lib
     libraries tatlas,tatlas not found in /home/smit/Smitlunagariya/scipy/benchmarks/env/9774801ae38aac7b90590412a25793ef/lib
     libraries lapack_atlas not found in /usr/local/lib
     libraries tatlas,tatlas not found in /usr/local/lib
     libraries lapack_atlas not found in /usr/lib
     libraries tatlas,tatlas not found in /usr/lib
     libraries lapack_atlas not found in /usr/lib/
     libraries tatlas,tatlas not found in /usr/lib/
   <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
     NOT AVAILABLE
   
   atlas_3_10_info:
     libraries lapack_atlas not found in /home/smit/Smitlunagariya/scipy/benchmarks/env/9774801ae38aac7b90590412a25793ef/lib
     libraries satlas,satlas not found in /home/smit/Smitlunagariya/scipy/benchmarks/env/9774801ae38aac7b90590412a25793ef/lib
     libraries lapack_atlas not found in /usr/local/lib
     libraries satlas,satlas not found in /usr/local/lib
     libraries lapack_atlas not found in /usr/lib
     libraries satlas,satlas not found in /usr/lib
     libraries lapack_atlas not found in /usr/lib/
     libraries satlas,satlas not found in /usr/lib/
   <class 'numpy.distutils.system_info.atlas_3_10_info'>
     NOT AVAILABLE
   
   atlas_threads_info:
   Setting PTATLAS=ATLAS
     libraries lapack_atlas not found in /home/smit/Smitlunagariya/scipy/benchmarks/env/9774801ae38aac7b90590412a25793ef/lib
     libraries ptf77blas,ptcblas,atlas not found in /home/smit/Smitlunagariya/scipy/benchmarks/env/9774801ae38aac7b90590412a25793ef/lib
     libraries lapack_atlas not found in /usr/local/lib
     libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
     libraries lapack_atlas not found in /usr/lib
     libraries ptf77blas,ptcblas,atlas not found in /usr/lib
     libraries lapack_atlas not found in /usr/lib/
     libraries ptf77blas,ptcblas,atlas not found in /usr/lib/
   <class 'numpy.distutils.system_info.atlas_threads_info'>
     NOT AVAILABLE
   
   atlas_info:
     libraries lapack_atlas not found in /home/smit/Smitlunagariya/scipy/benchmarks/env/9774801ae38aac7b90590412a25793ef/lib
     libraries f77blas,cblas,atlas not found in /home/smit/Smitlunagariya/scipy/benchmarks/env/9774801ae38aac7b90590412a25793ef/lib
     libraries lapack_atlas not found in /usr/local/lib
     libraries f77blas,cblas,atlas not found in /usr/local/lib
     libraries lapack_atlas not found in /usr/lib
     libraries f77blas,cblas,atlas not found in /usr/lib
     libraries lapack_atlas not found in /usr/lib/
     libraries f77blas,cblas,atlas not found in /usr/lib/
   <class 'numpy.distutils.system_info.atlas_info'>
     NOT AVAILABLE
   
   lapack_info:
     libraries lapack not found in ['/home/smit/Smitlunagariya/scipy/benchmarks/env/9774801ae38aac7b90590412a25793ef/lib', '/usr/local/lib', '/usr/lib', '/usr/lib/']
     NOT AVAILABLE
   
   lapack_src_info:
     NOT AVAILABLE
   
     NOT AVAILABLE
   
   STDERR -------->
   Running from SciPy source directory.
   /home/smit/Smitlunagariya/scipy/benchmarks/env/9774801ae38aac7b90590412a25793ef/lib/python3.9/site-packages/numpy/distutils/system_info.py:1858: UserWarning: 
       Lapack (http://www.netlib.org/lapack/) libraries not found.
       Directories to search for the libraries can be specified in the
       numpy/distutils/site.cfg file (section [lapack]) or by setting
       the LAPACK environment variable.
     return getattr(self, '_calc_info_{}'.format(name))()
   /home/smit/Smitlunagariya/scipy/benchmarks/env/9774801ae38aac7b90590412a25793ef/lib/python3.9/site-packages/numpy/distutils/system_info.py:1858: UserWarning: 
       Lapack (http://www.netlib.org/lapack/) sources not found.
       Directories to search for the sources can be specified in the
       numpy/distutils/site.cfg file (section [lapack_src]) or by setting
       the LAPACK_SRC environment variable.
     return getattr(self, '_calc_info_{}'.format(name))()
   Traceback (most recent call last):
     File "/home/smit/Smitlunagariya/scipy/benchmarks/env/9774801ae38aac7b90590412a25793ef/project/setup.py", line 631, in <module>
       setup_package()
     File "/home/smit/Smitlunagariya/scipy/benchmarks/env/9774801ae38aac7b90590412a25793ef/project/setup.py", line 627, in setup_package
       setup(**metadata)
     File "/home/smit/Smitlunagariya/scipy/benchmarks/env/9774801ae38aac7b90590412a25793ef/lib/python3.9/site-packages/numpy/distutils/core.py", line 135, in setup
       config = configuration()
     File "/home/smit/Smitlunagariya/scipy/benchmarks/env/9774801ae38aac7b90590412a25793ef/project/setup.py", line 530, in configuration
       raise NotFoundError(msg)
   numpy.distutils.system_info.NotFoundError: No BLAS/LAPACK libraries found.
   To build Scipy from sources, BLAS & LAPACK libraries need to be installed.
   See site.cfg.example in the Scipy source directory and
   https://docs.scipy.org/doc/scipy/reference/building/index.html for details.

·· Failed to build the project and import the benchmark suite.

it's possible that libopenblas and libopenblas-dev got installed in some nonstandard location

I tried the following too(scipy#9481 (comment)):

$ export LAPACK=/usr/lib/openblas/lib/libopenblas.so
$ export ATLAS=/usr/lib/openblas/lib/libopenblas.so
$ asv run

EDIT:
$ python runtests.py --bench works for me locally.

Also, I edited https://github.com/Smit-create/scipy/blob/meson/.github/workflows/linux.yml and it works fine, see: https://github.com/Smit-create/scipy/runs/3446108473?check_suite_focus=true

@rgommers
Copy link
Owner Author

rgommers commented Sep 7, 2021

For comparing BLAS libraries on the same machine, here's how to easily switch them out with conda: https://conda-forge.org/docs/maintainer/knowledge_base.html#switching-blas-implementation

@Smit-create
Copy link

It produces the following error:

$ conda install "libblas=*=*mkl"
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - libblas[build=*mkl]

Current channels:

  - https://repo.anaconda.com/pkgs/main/linux-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/linux-64
  - https://repo.anaconda.com/pkgs/r/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

From $ conda list, I get:

# Name                    Version                   Build  Channel

libblas                   3.9.0                9_openblas    conda-forge
libcblas                  3.9.0                9_openblas    conda-forge
libopenblas               0.3.15          pthreads_h8fe5266_1    conda-forge
mkl                       2021.3.0           h06a4308_520  

Should there be something else to change the build type?

@rgommers
Copy link
Owner Author

Ah you're installing from defaults (see "Current channels" listed), this feature is specific to conda-forge.

@rgommers
Copy link
Owner Author

The solve is slow when done in an existing scipy-dev environment based on the environment.yml in SciPy master, but it does work:

$ conda install "libblas=*=*mkl"
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: done
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: done

## Package Plan ##

  environment location: /home/rgommers/anaconda3/envs/scipy-dev

  added / updated specs:
    - libblas[build=*mkl]


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    binutils_linux-64-2.36     |       hf3e587d_1          23 KB  conda-forge
    gcc_impl_linux-64-9.4.0    |       h03d3576_8        45.7 MB  conda-forge
    gcc_linux-64-9.4.0         |       h391b98a_1          24 KB  conda-forge
    gfortran_impl_linux-64-9.4.0|       h0003116_8        10.0 MB  conda-forge
    gfortran_linux-64-9.4.0    |       hf0ab688_1          23 KB  conda-forge
    gxx_impl_linux-64-9.4.0    |       h03d3576_8        10.6 MB  conda-forge
    gxx_linux-64-9.4.0         |       h0316aca_1          23 KB  conda-forge
    libblas-3.9.0              |   11_linux64_mkl          12 KB  conda-forge
    libcblas-3.9.0             |   11_linux64_mkl          11 KB  conda-forge
    libgcc-devel_linux-64-9.4.0|       hd854feb_8         4.0 MB  conda-forge
    liblapack-3.9.0            |   11_linux64_mkl          11 KB  conda-forge
    libsanitizer-9.4.0         |       h79bfe98_8         6.9 MB  conda-forge
    libstdcxx-devel_linux-64-9.4.0|       hd854feb_8         9.9 MB  conda-forge
    openssl-1.1.1l             |       h7f98852_0         2.1 MB  conda-forge
    ------------------------------------------------------------
                                           Total:        89.4 MB

The following NEW packages will be INSTALLED:

  libsanitizer       conda-forge/linux-64::libsanitizer-9.4.0-h79bfe98_8
  llvm-openmp        conda-forge/linux-64::llvm-openmp-12.0.1-h4bd325d_1
  mkl                conda-forge/linux-64::mkl-2021.3.0-h726a3e6_557
  tbb                conda-forge/linux-64::tbb-2021.3.0-h4bd325d_0

The following packages will be UPDATED:

  gcc_impl_linux-64                       9.3.0-h70c0ae5_19 --> 9.4.0-h03d3576_8
  gcc_linux-64                            9.3.0-hf25ea35_32 --> 9.4.0-h391b98a_1
  gfortran_impl_lin~                      9.3.0-hc4a2995_19 --> 9.4.0-h0003116_8
  gfortran_linux-64                       9.3.0-hdc58fab_32 --> 9.4.0-hf0ab688_1
  gxx_impl_linux-64                       9.3.0-hd87eabc_19 --> 9.4.0-h03d3576_8
  gxx_linux-64                            9.3.0-h3fbe746_32 --> 9.4.0-h0316aca_1
  libblas                                  3.9.0-9_openblas --> 3.9.0-11_linux64_mkl
  libcblas                                 3.9.0-9_openblas --> 3.9.0-11_linux64_mkl
  libgcc-devel_linu~                      9.3.0-h7864c58_19 --> 9.4.0-hd854feb_8
  libgcc-ng                               9.3.0-h2828fa1_19 --> 11.1.0-hc902ee8_8
  libgfortran-ng                          9.3.0-hff62375_19 --> 11.1.0-h69a702a_8
  libgfortran5                            9.3.0-hff62375_19 --> 11.1.0-h6c583b3_8
  libgomp                                 9.3.0-h2828fa1_19 --> 11.1.0-hc902ee8_8
  liblapack                                3.9.0-9_openblas --> 3.9.0-11_linux64_mkl
  libstdcxx-devel_l~                      9.3.0-hb016644_19 --> 9.4.0-hd854feb_8
  libstdcxx-ng                            9.3.0-h6de172a_19 --> 11.1.0-h56837e0_8
  openssl                                 1.1.1k-h7f98852_0 --> 1.1.1l-h7f98852_0

The following packages will be DOWNGRADED:

  _openmp_mutex                                   4.5-1_gnu --> 4.5-1_llvm
  binutils_linux-64                        2.36-hf3e587d_32 --> 2.36-hf3e587d_1

@Smit-create
Copy link

Smit-create commented Sep 18, 2021

Hi,
These are the results on my machine of linalg benchmarks:

Library                                           Real time                       user time              sys time
----------------------------------------------------------------------------------------------------------------------
openblas                                         10m 9.007s                      19m 14.320s            7m 5.249s
mkl                                              7m 46.486s                      10m 54.084s            0m 28.639s
blis                                             12m 2.356s                      17m 40.777s            7m 2.029s
netlib                                           12m 45.545s                     20m 10.659s            7m 47.239s

My CPU details are:

"arch": "x86_64",
"cpu": "Intel(R) Core(TM) i3-4005U CPU @ 1.70GHz",
"num_cpu": "4",
"os": "Linux 5.4.0-81-generic",
"ram": "3950024",

The python script which I used for obtaining the results can be found at: https://gist.github.com/Smit-create/99f7fb2b8781053c39c3f25215e26cbf

@rgommers
Copy link
Owner Author

rgommers commented Nov 2, 2021

The "deprecate private API in SciPy" issue is coming to an end, we discussed to after that update the meson branch in this fork to be up-to-date with SciPy master.

@rgommers
Copy link
Owner Author

rgommers commented Jan 7, 2023

Old issue, closing.

@rgommers rgommers closed this as completed Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants