Skip to content

Remove libblas, mkl and m2w64-toolchain dependencies #4932

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

Merged
merged 2 commits into from
Oct 12, 2021
Merged

Conversation

twiecki
Copy link
Member

@twiecki twiecki commented Aug 13, 2021

As PyMC3 itself does not compile anything, it should not have these dependencies. Instead, it is aesaras job to specify its compile-chain dependencies. Closes #4715.

In addition to this change, we should make sure that aesara installs all required dependencies for compilation (aesara-devs/aesara#564) as well as update our installation instructions to tell people to use mkl if their processor supports it.

@codecov
Copy link

codecov bot commented Aug 13, 2021

Codecov Report

Merging #4932 (1466024) into main (9dcd216) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #4932   +/-   ##
=======================================
  Coverage   78.41%   78.41%           
=======================================
  Files         130      130           
  Lines       24461    24461           
=======================================
  Hits        19182    19182           
  Misses       5279     5279           
Impacted Files Coverage Δ
pymc/backends/report.py 89.51% <0.00%> (-2.10%) ⬇️
pymc/parallel_sampling.py 87.33% <0.00%> (+1.00%) ⬆️

@MarcoGorelli
Copy link
Contributor

Should the aesara change be done first, else some tests will fail here? The test failures here, at least, look relevant

@twiecki twiecki marked this pull request as draft August 14, 2021 19:08
@twiecki
Copy link
Member Author

twiecki commented Aug 14, 2021

@MarcoGorelli Yes, definitely.

@twiecki
Copy link
Member Author

twiecki commented Aug 16, 2021

@MarcoGorelli What is conda-envs/windows-environment-dev-py38.yml being used for? Just for GH actions?

@MarcoGorelli
Copy link
Contributor

@MarcoGorelli What is conda-envs/windows-environment-dev-py38.yml being used for? Just for GH actions?

That, and setting up a local dev environment

@twiecki
Copy link
Member Author

twiecki commented Aug 16, 2021

Presumably we should leave m2w64-toolchain then in there, yes?

@MarcoGorelli
Copy link
Contributor

Presumably we should leave m2w64-toolchain then in there, yes?

why, would that not become a dependency of aesara?

@twiecki
Copy link
Member Author

twiecki commented Aug 16, 2021

The recipe has

    - {{ compiler('c') }}
    - {{ compiler('cxx') }}

I wonder if that takes care of it.

@michaelosthege
Copy link
Member

why, would that not become a dependency of aesara?

Ideally yes, but right now the Aesara recipe doesn't even work.
I just tested it and the environment created with conda create -n aesara-testing -c conda-forge aesara -y is crap:

Conda create and activate output
Microsoft Windows [Version 10.0.19041.1110]
(c) Microsoft Corporation. Alle Rechte vorbehalten.

C:\Users\osthege>conda create -n aesara-testing -c conda-forge aesara -y
Collecting package metadata (repodata.json): done
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.10.1
  latest version: 4.10.3

Please update conda by running

    $ conda update -n base -c defaults conda



## Package Plan ##

  environment location: C:\Users\osthege\AppData\Local\Continuum\miniconda3\envs\aesara-testing

  added / updated specs:
    - aesara


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    aesara-2.1.3               |   py39h415ef7b_0         2.2 MB  conda-forge
    libblas-3.9.0              |     11_win64_mkl         4.5 MB  conda-forge
    libcblas-3.9.0             |     11_win64_mkl         4.5 MB  conda-forge
    liblapack-3.9.0            |     11_win64_mkl         4.5 MB  conda-forge
    mkl-2021.3.0               |     hb70f87d_564       179.7 MB  conda-forge
    numpy-1.21.2               |   py39h6635163_0         5.6 MB  conda-forge
    openssl-1.1.1k             |       h8ffe710_1         5.8 MB  conda-forge
    python-3.9.6               |h7840368_1_cpython        19.9 MB  conda-forge
    scipy-1.7.1                |   py39hc0c34ad_0        24.6 MB  conda-forge
    setuptools-57.4.0          |   py39hcbf5309_0         965 KB  conda-forge
    tzdata-2021a               |       he74cb21_1         121 KB  conda-forge
    wheel-0.37.0               |     pyhd8ed1ab_1          31 KB  conda-forge
    ------------------------------------------------------------
                                           Total:       252.4 MB

The following NEW packages will be INSTALLED:

  aesara             conda-forge/win-64::aesara-2.1.3-py39h415ef7b_0
  ca-certificates    conda-forge/win-64::ca-certificates-2021.5.30-h5b45459_0
  filelock           conda-forge/noarch::filelock-3.0.12-pyh9f0ad1d_0
  intel-openmp       conda-forge/win-64::intel-openmp-2021.3.0-h57928b3_3372
  libblas            conda-forge/win-64::libblas-3.9.0-11_win64_mkl
  libcblas           conda-forge/win-64::libcblas-3.9.0-11_win64_mkl
  libgpuarray        conda-forge/win-64::libgpuarray-0.7.6-h8ffe710_1003
  liblapack          conda-forge/win-64::liblapack-3.9.0-11_win64_mkl
  m2w64-gcc-libgfor~ conda-forge/win-64::m2w64-gcc-libgfortran-5.3.0-6
  m2w64-gcc-libs     conda-forge/win-64::m2w64-gcc-libs-5.3.0-7
  m2w64-gcc-libs-co~ conda-forge/win-64::m2w64-gcc-libs-core-5.3.0-7
  m2w64-gmp          conda-forge/win-64::m2w64-gmp-6.1.0-2
  m2w64-libwinpthre~ conda-forge/win-64::m2w64-libwinpthread-git-5.0.0.4634.697f757-2
  mako               conda-forge/noarch::mako-1.1.4-pyh44b312d_0
  markupsafe         conda-forge/win-64::markupsafe-2.0.1-py39hb82d6ee_0
  mkl                conda-forge/win-64::mkl-2021.3.0-hb70f87d_564
  msys2-conda-epoch  conda-forge/win-64::msys2-conda-epoch-20160418-1
  numpy              conda-forge/win-64::numpy-1.21.2-py39h6635163_0
  openssl            conda-forge/win-64::openssl-1.1.1k-h8ffe710_1
  pip                conda-forge/noarch::pip-21.2.4-pyhd8ed1ab_0
  pygpu              conda-forge/win-64::pygpu-0.7.6-py39h5d4886f_1002
  python             conda-forge/win-64::python-3.9.6-h7840368_1_cpython
  python_abi         conda-forge/win-64::python_abi-3.9-2_cp39
  scipy              conda-forge/win-64::scipy-1.7.1-py39hc0c34ad_0
  setuptools         conda-forge/win-64::setuptools-57.4.0-py39hcbf5309_0
  six                conda-forge/noarch::six-1.16.0-pyh6c4a22f_0
  sqlite             conda-forge/win-64::sqlite-3.36.0-h8ffe710_0
  tbb                conda-forge/win-64::tbb-2021.3.0-h2d74725_0
  tzdata             conda-forge/noarch::tzdata-2021a-he74cb21_1
  ucrt               conda-forge/win-64::ucrt-10.0.20348.0-h57928b3_0
  vc                 conda-forge/win-64::vc-14.2-hb210afc_5
  vs2015_runtime     conda-forge/win-64::vs2015_runtime-14.29.30037-h902a5da_5
  vs2017_win-64      conda-forge/win-64::vs2017_win-64-19.16.27038-h2e3bad8_2
  vswhere            conda-forge/win-64::vswhere-2.8.4-h57928b3_0
  wheel              conda-forge/noarch::wheel-0.37.0-pyhd8ed1ab_1



Downloading and Extracting Packages
tzdata-2021a         | 121 KB    | ################################################################################################################################################################################################# | 100%
mkl-2021.3.0         | 179.7 MB  | ################################################################################################################################################################################################# | 100%
aesara-2.1.3         | 2.2 MB    | ################################################################################################################################################################################################# | 100%
python-3.9.6         | 19.9 MB   | ################################################################################################################################################################################################# | 100%
openssl-1.1.1k       | 5.8 MB    | ################################################################################################################################################################################################# | 100%
scipy-1.7.1          | 24.6 MB   | ################################################################################################################################################################################################# | 100%
numpy-1.21.2         | 5.6 MB    | ################################################################################################################################################################################################# | 100%
setuptools-57.4.0    | 965 KB    | ################################################################################################################################################################################################# | 100%
libcblas-3.9.0       | 4.5 MB    | ################################################################################################################################################################################################# | 100%
wheel-0.37.0         | 31 KB     | ################################################################################################################################################################################################# | 100%
liblapack-3.9.0      | 4.5 MB    | ################################################################################################################################################################################################# | 100%
libblas-3.9.0        | 4.5 MB    | ################################################################################################################################################################################################# | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate aesara-testing
#
# To deactivate an active environment, use
#
#     $ conda deactivate


C:\Users\osthege>conda activate aesara-testing

C:\Users\osthege>SET DISTUTILS_USE_SDK=1

C:\Users\osthege>SET MSSdk=1

C:\Users\osthege>SET "VS_VERSION=15.0"

C:\Users\osthege>SET "VS_MAJOR=15"

C:\Users\osthege>SET "VS_YEAR=2017"

C:\Users\osthege>set "MSYS2_ARG_CONV_EXCL=/AI;/AL;/OUT;/out"

C:\Users\osthege>set "MSYS2_ENV_CONV_EXCL=CL"

C:\Users\osthege>set "PY_VCRUNTIME_REDIST=\bin\vcruntime140.dll"

C:\Users\osthege>set "CXX=cl.exe"

C:\Users\osthege>set "CC=cl.exe"

C:\Users\osthege>set "VSINSTALLDIR="

C:\Users\osthege>for /F "usebackq tokens=*" %i in (`vswhere.exe -nologo -products * -version [15.0,16.0) -property installationPath`) do (set "VSINSTALLDIR=%i\" )

C:\Users\osthege>(set "VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\" )

C:\Users\osthege>if not exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\" (for /F "usebackq tokens=*" %i in (`vswhere.exe -nologo -products * -requires Microsoft.VisualStudio.Component.VC.v141.x86.x64 -property installationPath`) do (set "VSINSTALLDIR=%i\" ) )

C:\Users\osthege>if not exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\" (set "VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\" )

C:\Users\osthege>if not exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\" (set "VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\" )

C:\Users\osthege>if not exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\" (set "VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\" )

C:\Users\osthege>if not exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\" (set "VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\" )

C:\Users\osthege>IF NOT "" == "" (
set "INCLUDE=;"
 set "LIB=;"
 set "CMAKE_PREFIX_PATH=;"
)

C:\Users\osthege>call :GetWin10SdkDir

C:\Users\osthege>call :GetWin10SdkDirHelper HKLM\SOFTWARE\Wow6432Node  1>nul 2>&1

C:\Users\osthege>if errorlevel 1 call :GetWin10SdkDirHelper HKCU\SOFTWARE\Wow6432Node  1>nul 2>&1

C:\Users\osthege>if errorlevel 1 call :GetWin10SdkDirHelper HKLM\SOFTWARE  1>nul 2>&1

C:\Users\osthege>if errorlevel 1 call :GetWin10SdkDirHelper HKCU\SOFTWARE  1>nul 2>&1

C:\Users\osthege>if errorlevel 1 exit /B 1

C:\Users\osthege>exit /B 0

C:\Users\osthege>for /F %i in ('dir /ON /B "C:\Program Files (x86)\Windows Kits\10\\include\10.*"') DO (SET WindowsSDKVer=%~i )

C:\Users\osthege>(SET WindowsSDKVer=10.0.10240.0 )

C:\Users\osthege>(SET WindowsSDKVer=10.0.16299.0 )

C:\Users\osthege>(SET WindowsSDKVer=10.0.17134.0 )

C:\Users\osthege>(SET WindowsSDKVer=10.0.17763.0 )

C:\Users\osthege>(SET WindowsSDKVer=10.0.18362.0 )

C:\Users\osthege>(SET WindowsSDKVer=10.0.19041.0 )

C:\Users\osthege>if errorlevel 1 (echo "Didn't find any windows 10 SDK. I'm not sure if things will work, but let's try..." )  else (echo Windows SDK version found as: "10.0.19041.0" )
Windows SDK version found as: "10.0.19041.0"

C:\Users\osthege>IF "win-64" == "win-64" (
set "CMAKE_GEN=Visual Studio 15 2017 Win64"
 set "BITS=64"
)  else (
set "CMAKE_GEN=Visual Studio 15 2017"
 set "BITS=32"
)

C:\Users\osthege>pushd C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional>CALL "VC\Auxiliary\Build\vcvars64.bat" -vcvars_ver=14.16 10.0.19041.0
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.9.14
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'

(aesara-testing) C:\Users\osthege>

@twiecki
Copy link
Member Author

twiecki commented Aug 17, 2021

Thanks for testing it @michaelosthege. From what you post I can't tell what about it is crap?

@michaelosthege
Copy link
Member

Thanks for testing it @michaelosthege. From what you post I can't tell what about it is crap?

All these prints after the conda activate are not normal and definitely the first sign of trouble.
Activating a healthy environment looks like this:

C:\Users\osthege\Repos>conda activate pm3v4

(pm3v4) C:\Users\osthege\Repos>

@twiecki
Copy link
Member Author

twiecki commented Aug 17, 2021

Hmmm, odd, the packages that it installs all look correct. What do you think is causing this? Can you actually run aesara successfully?

@michaelosthege
Copy link
Member

Hmmm, odd, the packages that it installs all look correct. What do you think is causing this? Can you actually run aesara successfully?

(aesara-testing) C:\Users\osthege\Repos\bletl>python
Python 3.9.6 | packaged by conda-forge | (default, Jul 11 2021, 03:37:25) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import aesara
WARNING (aesara.configdefaults): g++ not available, if using conda: `conda install m2w64-toolchain`
WARNING (aesara.configdefaults): g++ not detected ! Aesara will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Aesara flags cxx to an empty string.
WARNING (aesara.link.c.cmodule): install mkl with `conda install mkl-service`: No module named 'mkl'
WARNING (aesara.tensor.blas): Using NumPy C-API based implementation for BLAS functions.

No compilers, so more or less useless for any real work.. Conclusion: this part of the recipe you mentioned is not sufficient.

@twiecki
Copy link
Member Author

twiecki commented Aug 18, 2021

Does that go away when you install m2w64-toolchain manually?

@twiecki
Copy link
Member Author

twiecki commented Aug 18, 2021

It is surprising because it seems like a C++ compiler gets installed (as it should according the conda env).

@michaelosthege
Copy link
Member

After installing m2w64-toolchain on top, the printouts upon activation remain and two warnings went away in the Aesara import:

>>> import aesara
WARNING (aesara.link.c.cmodule): install mkl with `conda install mkl-service`: No module named 'mkl'
WARNING (aesara.tensor.blas): Using NumPy C-API based implementation for BLAS functions.

@twiecki
Copy link
Member Author

twiecki commented Aug 18, 2021

Yeah, for mkl we would need to change the installation instructions to include conda install libblas=*=*mkl. Can you run that and see if the warning disappears?

@michaelosthege
Copy link
Member

michaelosthege commented Aug 18, 2021

Yeah, for mkl we would need to change the installation instructions to include conda install libblas=*=*mkl. Can you run that and see if the warning disappears?

No change in printouts/warnings after conda install "libblas=*=*mkl".

But it could be a different story if these dependencies are included in the recipe already. After all the environment was created kinda broken already.

@twiecki
Copy link
Member Author

twiecki commented Aug 18, 2021

It still complains about missing mkl? Did this install mkl-service? What if you install mkl-service by hand?

@twiecki
Copy link
Member Author

twiecki commented Aug 18, 2021

Trying to add it here: conda-forge/aesara-feedstock#29

@michaelosthege
Copy link
Member

Yeah, for mkl we would need to change the installation instructions to include conda install libblas=*=*mkl. Can you run that and see if the warning disappears?

No change in printouts/warnings after conda install "libblas=*=*mkl".

install mkl-servi

That brings it down to one warning:

WARNING (aesara.tensor.blas): Using NumPy C-API based implementation for BLAS functions.

@twiecki
Copy link
Member Author

twiecki commented Aug 18, 2021

@michaelosthege I merged conda-forge/aesara-feedstock#29. Can you try installing aesara (once it's built) in a fresh env using conda install aesara libblas=*=*mkl mkl-service?

@michaelosthege
Copy link
Member

Not perfect, but a a lot better than before:

conda create -n aesara-testing -c conda-forge aesara "libblas=*=*mkl" mkl-service
Full output
Collecting package metadata (current_repodata.json): done
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.9.2
  latest version: 4.10.3

Please update conda by running

    $ conda update -n base -c defaults conda



## Package Plan ##

  environment location: C:\Users\zufal\miniconda3\envs\aesara-testing

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


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    aesara-2.1.3               |   py39h7fcc1c2_1         2.2 MB  conda-forge
    libblas-3.9.0              |     11_win64_mkl         4.5 MB  conda-forge
    libcblas-3.9.0             |     11_win64_mkl         4.5 MB  conda-forge
    liblapack-3.9.0            |     11_win64_mkl         4.5 MB  conda-forge
    m2w64-toolchain_win-64-2.4.0|                0           4 KB  conda-forge
    markupsafe-2.0.1           |   py39hb82d6ee_0          25 KB  conda-forge
    mkl-2021.3.0               |     hb70f87d_564       179.7 MB  conda-forge
    mkl-service-2.4.0          |   py39hb82d6ee_0          52 KB  conda-forge
    numpy-1.21.2               |   py39h6635163_0         5.6 MB  conda-forge
    openssl-1.1.1k             |       h8ffe710_1         5.8 MB  conda-forge
    pip-21.2.4                 |     pyhd8ed1ab_0         1.1 MB  conda-forge
    pygpu-0.7.6                |py39h5d4886f_1002         579 KB  conda-forge
    python-3.9.6               |h7840368_1_cpython        19.9 MB  conda-forge
    python_abi-3.9             |           2_cp39           4 KB  conda-forge
    scipy-1.7.1                |   py39hc0c34ad_0        24.6 MB  conda-forge
    setuptools-57.4.0          |   py39hcbf5309_0         965 KB  conda-forge
    tbb-2021.3.0               |       h2d74725_0         143 KB  conda-forge
    tzdata-2021a               |       he74cb21_1         121 KB  conda-forge
    wheel-0.37.0               |     pyhd8ed1ab_1          31 KB  conda-forge
    ------------------------------------------------------------
                                           Total:       254.3 MB

The following NEW packages will be INSTALLED:

  aesara             conda-forge/win-64::aesara-2.1.3-py39h7fcc1c2_1
  ca-certificates    conda-forge/win-64::ca-certificates-2021.5.30-h5b45459_0
  filelock           conda-forge/noarch::filelock-3.0.12-pyh9f0ad1d_0
  intel-openmp       conda-forge/win-64::intel-openmp-2021.3.0-h57928b3_3372
  libblas            conda-forge/win-64::libblas-3.9.0-11_win64_mkl
  libcblas           conda-forge/win-64::libcblas-3.9.0-11_win64_mkl
  libgpuarray        conda-forge/win-64::libgpuarray-0.7.6-h8ffe710_1003
  liblapack          conda-forge/win-64::liblapack-3.9.0-11_win64_mkl
  m2w64-binutils     conda-forge/win-64::m2w64-binutils-2.25.1-5
  m2w64-bzip2        conda-forge/win-64::m2w64-bzip2-1.0.6-6
  m2w64-crt-git      conda-forge/win-64::m2w64-crt-git-5.0.0.4636.2595836-2
  m2w64-gcc          conda-forge/win-64::m2w64-gcc-5.3.0-6
  m2w64-gcc-ada      conda-forge/win-64::m2w64-gcc-ada-5.3.0-6
  m2w64-gcc-fortran  conda-forge/win-64::m2w64-gcc-fortran-5.3.0-6
  m2w64-gcc-libgfor~ conda-forge/win-64::m2w64-gcc-libgfortran-5.3.0-6
  m2w64-gcc-libs     conda-forge/win-64::m2w64-gcc-libs-5.3.0-7
  m2w64-gcc-libs-co~ conda-forge/win-64::m2w64-gcc-libs-core-5.3.0-7
  m2w64-gcc-objc     conda-forge/win-64::m2w64-gcc-objc-5.3.0-6
  m2w64-gmp          conda-forge/win-64::m2w64-gmp-6.1.0-2
  m2w64-headers-git  conda-forge/win-64::m2w64-headers-git-5.0.0.4636.c0ad18a-2
  m2w64-isl          conda-forge/win-64::m2w64-isl-0.16.1-2
  m2w64-libiconv     conda-forge/win-64::m2w64-libiconv-1.14-6
  m2w64-libmangle-g~ conda-forge/win-64::m2w64-libmangle-git-5.0.0.4509.2e5a9a2-2
  m2w64-libwinpthre~ conda-forge/win-64::m2w64-libwinpthread-git-5.0.0.4634.697f757-2
  m2w64-make         conda-forge/win-64::m2w64-make-4.1.2351.a80a8b8-2
  m2w64-mpc          conda-forge/win-64::m2w64-mpc-1.0.3-3
  m2w64-mpfr         conda-forge/win-64::m2w64-mpfr-3.1.4-4
  m2w64-pkg-config   conda-forge/win-64::m2w64-pkg-config-0.29.1-2
  m2w64-toolchain    conda-forge/win-64::m2w64-toolchain-5.3.0-7
  m2w64-toolchain_w~ conda-forge/win-64::m2w64-toolchain_win-64-2.4.0-0
  m2w64-tools-git    conda-forge/win-64::m2w64-tools-git-5.0.0.4592.90b8472-2
  m2w64-windows-def~ conda-forge/win-64::m2w64-windows-default-manifest-6.4-3
  m2w64-winpthreads~ conda-forge/win-64::m2w64-winpthreads-git-5.0.0.4634.697f757-2
  m2w64-zlib         conda-forge/win-64::m2w64-zlib-1.2.8-10
  mako               conda-forge/noarch::mako-1.1.4-pyh44b312d_0
  markupsafe         conda-forge/win-64::markupsafe-2.0.1-py39hb82d6ee_0
  mkl                conda-forge/win-64::mkl-2021.3.0-hb70f87d_564
  mkl-service        conda-forge/win-64::mkl-service-2.4.0-py39hb82d6ee_0
  msys2-conda-epoch  conda-forge/win-64::msys2-conda-epoch-20160418-1
  numpy              conda-forge/win-64::numpy-1.21.2-py39h6635163_0
  openssl            conda-forge/win-64::openssl-1.1.1k-h8ffe710_1
  pip                conda-forge/noarch::pip-21.2.4-pyhd8ed1ab_0
  pygpu              conda-forge/win-64::pygpu-0.7.6-py39h5d4886f_1002
  python             conda-forge/win-64::python-3.9.6-h7840368_1_cpython
  python_abi         conda-forge/win-64::python_abi-3.9-2_cp39
  scipy              conda-forge/win-64::scipy-1.7.1-py39hc0c34ad_0
  setuptools         conda-forge/win-64::setuptools-57.4.0-py39hcbf5309_0
  six                conda-forge/noarch::six-1.16.0-pyh6c4a22f_0
  sqlite             conda-forge/win-64::sqlite-3.36.0-h8ffe710_0
  tbb                conda-forge/win-64::tbb-2021.3.0-h2d74725_0
  tzdata             conda-forge/noarch::tzdata-2021a-he74cb21_1
  ucrt               conda-forge/win-64::ucrt-10.0.20348.0-h57928b3_0
  vc                 conda-forge/win-64::vc-14.2-hb210afc_5
  vs2015_runtime     conda-forge/win-64::vs2015_runtime-14.29.30037-h902a5da_5
  wheel              conda-forge/noarch::wheel-0.37.0-pyhd8ed1ab_1


Proceed ([y]/n)?


Downloading and Extracting Packages
libcblas-3.9.0       | 4.5 MB    | ############################################################################################################################################################################################################################################################################################################## | 100%
scipy-1.7.1          | 24.6 MB   | ############################################################################################################################################################################################################################################################################################################## | 100%
markupsafe-2.0.1     | 25 KB     | ############################################################################################################################################################################################################################################################################################################## | 100%
wheel-0.37.0         | 31 KB     | ############################################################################################################################################################################################################################################################################################################## | 100%
tbb-2021.3.0         | 143 KB    | ############################################################################################################################################################################################################################################################################################################## | 100%
numpy-1.21.2         | 5.6 MB    | ############################################################################################################################################################################################################################################################################################################## | 100%
mkl-service-2.4.0    | 52 KB     | ############################################################################################################################################################################################################################################################################################################## | 100%
openssl-1.1.1k       | 5.8 MB    | ############################################################################################################################################################################################################################################################################################################## | 100%
mkl-2021.3.0         | 179.7 MB  | ############################################################################################################################################################################################################################################################################################################## | 100%
liblapack-3.9.0      | 4.5 MB    | ############################################################################################################################################################################################################################################################################################################## | 100%
python_abi-3.9       | 4 KB      | ############################################################################################################################################################################################################################################################################################################## | 100%
m2w64-toolchain_win- | 4 KB      | ############################################################################################################################################################################################################################################################################################################## | 100%
tzdata-2021a         | 121 KB    | ############################################################################################################################################################################################################################################################################################################## | 100%
libblas-3.9.0        | 4.5 MB    | ############################################################################################################################################################################################################################################################################################################## | 100%
setuptools-57.4.0    | 965 KB    | ############################################################################################################################################################################################################################################################################################################## | 100%
pip-21.2.4           | 1.1 MB    | ############################################################################################################################################################################################################################################################################################################## | 100%
aesara-2.1.3         | 2.2 MB    | ############################################################################################################################################################################################################################################################################################################## | 100%
pygpu-0.7.6          | 579 KB    | ############################################################################################################################################################################################################################################################################################################## | 100%
python-3.9.6         | 19.9 MB   | ############################################################################################################################################################################################################################################################################################################## | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate aesara-testing
#
# To deactivate an active environment, use
#
#     $ conda deactivate
(aesara-testing) C:\Users\zufal>python -c "import aesara"
WARNING (aesara.tensor.blas): Using NumPy C-API based implementation for BLAS functions.

@sreedat
Copy link

sreedat commented Aug 18, 2021

@twiecki @michaelosthege

I have tested the latest aesara and modified my new environment creation in the following manner based on the discussion above. In addition to the packages needed for aesara discussed above, I also installed blas when creating the environment. There are no errors. I'm working with Windows 10 and Anaconda3. Note that as of now I have not installed pymc3-v4. See the details of the conda create below:

Create pm3v4 environment with specific packages

(base) C:\Users\sreedatta>conda create -n pm3v4 -c conda-forge "python=3.9" libpython mkl mkl-service m2w64-toolchain numba python-graphviz scipy numpy blas libblas=*=*mkl aesara -y

Installation Details Collecting package metadata (current_repodata.json): done Solving environment: done

Package Plan

environment location: C:\ProgramData\Anaconda3\envs\pm3v4

added / updated specs:
- aesara
- blas
- libblas[build=*mkl]
- libpython
- m2w64-toolchain
- mkl
- mkl-service
- numba
- numpy
- python-graphviz
- python=3.9
- scipy

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
aesara-2.1.3               |   py39h7fcc1c2_1         2.2 MB  conda-forge
blas-2.106                 |              mkl          13 KB  conda-forge
filelock-3.0.12            |     pyh9f0ad1d_0          10 KB  conda-forge
harfbuzz-2.9.0             |       hc601d6f_0         854 KB  conda-forge
libblas-3.9.0              |            6_mkl         3.9 MB  conda-forge
libcblas-3.9.0             |            6_mkl         3.9 MB  conda-forge
libgpuarray-0.7.6          |    h8ffe710_1003         345 KB  conda-forge
liblapack-3.9.0            |            6_mkl         3.9 MB  conda-forge
liblapacke-3.9.0           |            6_mkl         3.9 MB  conda-forge
libpython-2.0              |   py39hcbf5309_1          50 KB  conda-forge
llvmlite-0.36.0            |   py39ha0cd8c8_0        15.1 MB  conda-forge
m2w64-toolchain_win-64-2.4.0|                0           4 KB  conda-forge
mako-1.1.4                 |     pyh44b312d_0          58 KB  conda-forge
markupsafe-2.0.1           |   py39hb82d6ee_0          25 KB  conda-forge
mkl-service-2.3.0          |   py39h196d8e1_0          47 KB
numba-0.53.1               |   py39hb8cd55e_1         3.7 MB  conda-forge
numpy-1.21.2               |   py39h6635163_0         5.6 MB  conda-forge
pango-1.48.9               |       hd84fcdd_0         689 KB  conda-forge
pygpu-0.7.6                |py39h5d4886f_1002         579 KB  conda-forge
python-3.9.6               |h7840368_1_cpython        19.9 MB  conda-forge
python_abi-3.9             |           2_cp39           4 KB  conda-forge
scipy-1.7.1                |   py39hc0c34ad_0        24.6 MB  conda-forge
setuptools-57.4.0          |   py39hcbf5309_0         965 KB  conda-forge
tzdata-2021a               |       he74cb21_1         121 KB  conda-forge
------------------------------------------------------------
                                       Total:        90.4 MB

The following NEW packages will be INSTALLED:

aesara conda-forge/win-64::aesara-2.1.3-py39h7fcc1c2_1
blas conda-forge/win-64::blas-2.106-mkl
ca-certificates conda-forge/win-64::ca-certificates-2021.5.30-h5b45459_0
cairo conda-forge/win-64::cairo-1.16.0-hb19e0ff_1008
expat conda-forge/win-64::expat-2.4.1-h39d44d4_0
filelock conda-forge/noarch::filelock-3.0.12-pyh9f0ad1d_0
font-ttf-dejavu-s~ conda-forge/noarch::font-ttf-dejavu-sans-mono-2.37-hab24e00_0
font-ttf-inconsol~ conda-forge/noarch::font-ttf-inconsolata-3.000-h77eed37_0
font-ttf-source-c~ conda-forge/noarch::font-ttf-source-code-pro-2.038-h77eed37_0
font-ttf-ubuntu conda-forge/noarch::font-ttf-ubuntu-0.83-hab24e00_0
fontconfig conda-forge/win-64::fontconfig-2.13.1-h1989441_1005
fonts-conda-ecosy~ conda-forge/noarch::fonts-conda-ecosystem-1-0
fonts-conda-forge conda-forge/noarch::fonts-conda-forge-1-0
freetype conda-forge/win-64::freetype-2.10.4-h546665d_1
fribidi conda-forge/win-64::fribidi-1.0.10-h8d14728_0
getopt-win32 conda-forge/win-64::getopt-win32-0.1-h8ffe710_0
gettext conda-forge/win-64::gettext-0.19.8.1-h1a89ca6_1005
graphite2 conda-forge/win-64::graphite2-1.3.13-1000
graphviz conda-forge/win-64::graphviz-2.48.0-hefbd956_0
gts conda-forge/win-64::gts-0.7.6-h7c369d9_2
harfbuzz conda-forge/win-64::harfbuzz-2.9.0-hc601d6f_0
icu conda-forge/win-64::icu-68.1-h0e60522_0
intel-openmp conda-forge/win-64::intel-openmp-2021.3.0-h57928b3_3372
jbig conda-forge/win-64::jbig-2.1-h8d14728_2003
jpeg conda-forge/win-64::jpeg-9d-h8ffe710_0
lerc conda-forge/win-64::lerc-2.2.1-h0e60522_0
libblas conda-forge/win-64::libblas-3.9.0-6_mkl
libcblas conda-forge/win-64::libcblas-3.9.0-6_mkl
libdeflate conda-forge/win-64::libdeflate-1.7-h8ffe710_5
libffi conda-forge/win-64::libffi-3.3-h0e60522_2
libgd conda-forge/win-64::libgd-2.3.2-h138e682_0
libglib conda-forge/win-64::libglib-2.68.3-h1e62bf3_0
libgpuarray conda-forge/win-64::libgpuarray-0.7.6-h8ffe710_1003
libiconv conda-forge/win-64::libiconv-1.16-he774522_0
liblapack conda-forge/win-64::liblapack-3.9.0-6_mkl
liblapacke conda-forge/win-64::liblapacke-3.9.0-6_mkl
libpng conda-forge/win-64::libpng-1.6.37-h1d00b33_2
libpython conda-forge/win-64::libpython-2.0-py39hcbf5309_1
libtiff conda-forge/win-64::libtiff-4.3.0-h0c97f57_1
libwebp conda-forge/win-64::libwebp-1.2.1-h57928b3_0
libwebp-base conda-forge/win-64::libwebp-base-1.2.1-h8ffe710_0
libxcb conda-forge/win-64::libxcb-1.13-hcd874cb_1003
libxml2 conda-forge/win-64::libxml2-2.9.12-hf5bbc77_0
llvmlite conda-forge/win-64::llvmlite-0.36.0-py39ha0cd8c8_0
lz4-c conda-forge/win-64::lz4-c-1.9.3-h8ffe710_1
m2w64-binutils conda-forge/win-64::m2w64-binutils-2.25.1-5
m2w64-bzip2 conda-forge/win-64::m2w64-bzip2-1.0.6-6
m2w64-crt-git conda-forge/win-64::m2w64-crt-git-5.0.0.4636.2595836-2
m2w64-gcc conda-forge/win-64::m2w64-gcc-5.3.0-6
m2w64-gcc-ada conda-forge/win-64::m2w64-gcc-ada-5.3.0-6
m2w64-gcc-fortran conda-forge/win-64::m2w64-gcc-fortran-5.3.0-6
m2w64-gcc-libgfor~ conda-forge/win-64::m2w64-gcc-libgfortran-5.3.0-6
m2w64-gcc-libs conda-forge/win-64::m2w64-gcc-libs-5.3.0-7
m2w64-gcc-libs-co~ conda-forge/win-64::m2w64-gcc-libs-core-5.3.0-7
m2w64-gcc-objc conda-forge/win-64::m2w64-gcc-objc-5.3.0-6
m2w64-gmp conda-forge/win-64::m2w64-gmp-6.1.0-2
m2w64-headers-git conda-forge/win-64::m2w64-headers-git-5.0.0.4636.c0ad18a-2
m2w64-isl conda-forge/win-64::m2w64-isl-0.16.1-2
m2w64-libiconv conda-forge/win-64::m2w64-libiconv-1.14-6
m2w64-libmangle-g~ conda-forge/win-64::m2w64-libmangle-git-5.0.0.4509.2e5a9a2-2
m2w64-libwinpthre~ conda-forge/win-64::m2w64-libwinpthread-git-5.0.0.4634.697f757-2
m2w64-make conda-forge/win-64::m2w64-make-4.1.2351.a80a8b8-2
m2w64-mpc conda-forge/win-64::m2w64-mpc-1.0.3-3
m2w64-mpfr conda-forge/win-64::m2w64-mpfr-3.1.4-4
m2w64-pkg-config conda-forge/win-64::m2w64-pkg-config-0.29.1-2
m2w64-toolchain conda-forge/win-64::m2w64-toolchain-5.3.0-7
m2w64-toolchain_w~ conda-forge/win-64::m2w64-toolchain_win-64-2.4.0-0
m2w64-tools-git conda-forge/win-64::m2w64-tools-git-5.0.0.4592.90b8472-2
m2w64-windows-def~ conda-forge/win-64::m2w64-windows-default-manifest-6.4-3
m2w64-winpthreads~ conda-forge/win-64::m2w64-winpthreads-git-5.0.0.4634.697f757-2
m2w64-zlib conda-forge/win-64::m2w64-zlib-1.2.8-10
mako conda-forge/noarch::mako-1.1.4-pyh44b312d_0
markupsafe conda-forge/win-64::markupsafe-2.0.1-py39hb82d6ee_0
mkl conda-forge/win-64::mkl-2020.4-hb70f87d_311
mkl-service pkgs/main/win-64::mkl-service-2.3.0-py39h196d8e1_0
msys2-conda-epoch conda-forge/win-64::msys2-conda-epoch-20160418-1
numba conda-forge/win-64::numba-0.53.1-py39hb8cd55e_1
numpy conda-forge/win-64::numpy-1.21.2-py39h6635163_0
openssl conda-forge/win-64::openssl-1.1.1k-h8ffe710_1
pango conda-forge/win-64::pango-1.48.9-hd84fcdd_0
pcre conda-forge/win-64::pcre-8.45-h0e60522_0
pip conda-forge/noarch::pip-21.2.4-pyhd8ed1ab_0
pixman conda-forge/win-64::pixman-0.40.0-h8ffe710_0
pthread-stubs conda-forge/win-64::pthread-stubs-0.4-hcd874cb_1001
pygpu conda-forge/win-64::pygpu-0.7.6-py39h5d4886f_1002
python conda-forge/win-64::python-3.9.6-h7840368_1_cpython
python-graphviz conda-forge/noarch::python-graphviz-0.17-pyhaef67bd_0
python_abi conda-forge/win-64::python_abi-3.9-2_cp39
scipy conda-forge/win-64::scipy-1.7.1-py39hc0c34ad_0
setuptools conda-forge/win-64::setuptools-57.4.0-py39hcbf5309_0
six conda-forge/noarch::six-1.16.0-pyh6c4a22f_0
sqlite conda-forge/win-64::sqlite-3.36.0-h8ffe710_0
tzdata conda-forge/noarch::tzdata-2021a-he74cb21_1
ucrt conda-forge/win-64::ucrt-10.0.20348.0-h57928b3_0
vc conda-forge/win-64::vc-14.2-hb210afc_5
vs2015_runtime conda-forge/win-64::vs2015_runtime-14.29.30037-h902a5da_5
wheel conda-forge/noarch::wheel-0.37.0-pyhd8ed1ab_1
xorg-kbproto conda-forge/win-64::xorg-kbproto-1.0.7-hcd874cb_1002
xorg-libice conda-forge/win-64::xorg-libice-1.0.10-hcd874cb_0
xorg-libsm conda-forge/win-64::xorg-libsm-1.2.3-hcd874cb_1000
xorg-libx11 conda-forge/win-64::xorg-libx11-1.7.2-hcd874cb_0
xorg-libxau conda-forge/win-64::xorg-libxau-1.0.9-hcd874cb_0
xorg-libxdmcp conda-forge/win-64::xorg-libxdmcp-1.1.3-hcd874cb_0
xorg-libxext conda-forge/win-64::xorg-libxext-1.3.4-hcd874cb_1
xorg-libxpm conda-forge/win-64::xorg-libxpm-3.5.13-hcd874cb_0
xorg-libxt conda-forge/win-64::xorg-libxt-1.2.1-hcd874cb_2
xorg-xextproto conda-forge/win-64::xorg-xextproto-7.3.0-hcd874cb_1002
xorg-xproto conda-forge/win-64::xorg-xproto-7.0.31-hcd874cb_1007
xz conda-forge/win-64::xz-5.2.5-h62dcd97_1
zlib conda-forge/win-64::zlib-1.2.11-h62dcd97_1010
zstd conda-forge/win-64::zstd-1.5.0-h6255e5f_0

Downloading and Extracting Packages
libpython-2.0 | 50 KB | ############################################################################ | 100%
libcblas-3.9.0 | 3.9 MB | ############################################################################ | 100%
blas-2.106 | 13 KB | ############################################################################ | 100%
libblas-3.9.0 | 3.9 MB | ############################################################################ | 100%
m2w64-toolchain_win- | 4 KB | ############################################################################ | 100%
mkl-service-2.3.0 | 47 KB | ############################################################################ | 100%
pygpu-0.7.6 | 579 KB | ############################################################################ | 100%
setuptools-57.4.0 | 965 KB | ############################################################################ | 100%
pango-1.48.9 | 689 KB | ############################################################################ | 100%
filelock-3.0.12 | 10 KB | ############################################################################ | 100%
liblapack-3.9.0 | 3.9 MB | ############################################################################ | 100%
scipy-1.7.1 | 24.6 MB | ############################################################################ | 100%
python-3.9.6 | 19.9 MB | ############################################################################ | 100%
libgpuarray-0.7.6 | 345 KB | ############################################################################ | 100%
python_abi-3.9 | 4 KB | ############################################################################ | 100%
mako-1.1.4 | 58 KB | ############################################################################ | 100%
llvmlite-0.36.0 | 15.1 MB | ############################################################################ | 100%
aesara-2.1.3 | 2.2 MB | ############################################################################ | 100%
harfbuzz-2.9.0 | 854 KB | ############################################################################ | 100%
numba-0.53.1 | 3.7 MB | ############################################################################ | 100%
markupsafe-2.0.1 | 25 KB | ############################################################################ | 100%
liblapacke-3.9.0 | 3.9 MB | ############################################################################ | 100%
numpy-1.21.2 | 5.6 MB | ############################################################################ | 100%
tzdata-2021a | 121 KB | ############################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

To activate this environment, use

$ conda activate pm3v4

To deactivate an active environment, use

$ conda deactivate

** Testing the Aesara Install**
(base) C:\Users\sreedatta>conda activate pm3v4

(pm3v4) C:\Users\sreedatta>python
Python 3.9.6 | packaged by conda-forge | (default, Jul 11 2021, 03:37:25) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

import aesara

image

Running the import aesara command does not give any warnings as you can see above. I hope this helps.

@sreedat
Copy link

sreedat commented Aug 19, 2021

@twiecki @michaelosthege I continued my testing where I installed pymc3-v4.0 from GitHub using pip.

I could successfully run first example in the Getting Started page: http://docs.pymc.io/notebooks/getting_started
to the point of drawing the posterior samples:
with basic_model:
# draw 500 posterior samples
trace = pm.sample(500, cores=1, chains=2, return_inferencedata=False)

I got the following error next when I tried to plot with arviz using
with basic_model:
display(az.summary(trace, round_to=2))

Error: AttributeError: 'TensorVariable' object has no attribute 'logp_elemwise'

I could extract the last 5 values of the alpha parameter from the posterior samples using:
trace["alpha"][-5:]

For the current iteration of pymc3-v4.0 and aesara, is this expected behavior?

@twiecki
Copy link
Member Author

twiecki commented Aug 20, 2021

Can you check what the difference in environment between 1 & 2 are? Ideally all 3 but 1 & 2 seem like the most surprising currently to have a difference.

And can you check whether all of them have libpython installed?

@sreedat
Copy link

sreedat commented Aug 20, 2021

@twiecki I will post a comparison of the packages across 1 & 2, later this evening. I will check on libpython too

@sreedat
Copy link

sreedat commented Aug 21, 2021

@twiecki I have completed the comparison. Please note the following:

  1. The errors I saw with environments 2 (mkl-service aesara numba) & 3 (mkl-service aesara) have disappeared after I reinstalled both of those environments again on Aug-20 from scratch. Since I was installing pymc3 from GitHub, I thought that the these error in 2 & 3 could be a result of code changes.
  2. The code example I shared previously did sample successfully now in all three environments. Note the time it took to run 2 Chains with 1 Core allocated:
    Env 1: 5 seconds, Env 2: 6 seconds, & Env 3: 7 seconds (one without numba took 1 second longer, Env 3)
  3. Even today, after sampling, I cannot plot or summarize with Arviz across all three environments. The same error shown below persists: AttributeError: 'TensorVariable' object has no attribute 'logp_elemwise'

@twiecki twiecki marked this pull request as ready for review September 6, 2021 17:45
@@ -10,10 +10,8 @@ dependencies:
- cloudpickle
- fastprogress>=0.2.0
- h5py>=2.7
- libblas=*=*mkl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this Syntax mean?

And why is the line only for Windows Python 3.8?
(Maybe add a comment inline)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wait, is there just one yml for Windows? (on my phone, sorry)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That means that you want to use the mkl implementation of libblas, rather than e.g. openblas.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find any explanation of the =*=* operator, but it looks like this is the relevant docs section: https://conda-forge.org/docs/maintainer/knowledge_base.html#switching-blas-implementation

(Just leaving this here for reference.)

@twiecki
Copy link
Member Author

twiecki commented Sep 8, 2021

@MarcoGorelli I could use your input here. I want the conda env to not specify which blas implementation should be used, and not list mll-services as a dependency. However, when creating the conda env for running as part of GH action I do want to specify to use libblas=*=*mkl. Usually I would specify this during a call to conda install. But it also feels wrong to hard-code this into https://github.com/pymc-devs/pymc3/blob/main/scripts/create_testenv.sh

@MarcoGorelli
Copy link
Contributor

Hey @twiecki

However, when creating the conda env for running as part of GH action I do want to specify to use libblas=*=*mkl.

would it work to add it here

https://github.com/pymc-devs/pymc3/blob/b339ca5a24bef9b45f9602eedf7d7d9b0e07c87a/.github/workflows/pytest.yml#L136-L141

?

@twiecki
Copy link
Member Author

twiecki commented Sep 8, 2021

@MarcoGorelli I don't think so, needs to be specified during installation of the conda packages.

@MarcoGorelli
Copy link
Contributor

Maybe make separate conda env files for CI then, and specify them here

https://github.com/pymc-devs/pymc3/blob/b339ca5a24bef9b45f9602eedf7d7d9b0e07c87a/.github/workflows/pytest.yml#L134

? I don't think create_testenv.sh is used in CI

@fonnesbeck
Copy link
Member

Just reporting that the 3.9 env installs and runs well on my M1 Macbook under these changes.

@twiecki
Copy link
Member Author

twiecki commented Sep 16, 2021

@MarcoGorelli I think custom files for the purest env is the way to go. Thanks!

@twiecki
Copy link
Member Author

twiecki commented Sep 16, 2021

@MarcoGorelli OK I added additional test envs but I couldn't find where I would select that only those would be used on GH actions.

@MarcoGorelli
Copy link
Contributor

I think you just need to use them here

https://github.com/pymc-devs/pymc3/blob/59ce9af97f0b840f992322f33ec8dee203d7d1c0/.github/workflows/pytest.yml#L134

(and likewise for the others)

@twiecki
Copy link
Member Author

twiecki commented Sep 16, 2021

OK, this should be done.

- myst-nb
- numpy=1.15
- numpydoc>=0.9
- pandas=0.24
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need to pin pandas to such an old version?

Below it doesn't even pin a version. Is this because of some Python 3.7 oddity?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC there was one env which would have the deps pinned to the earliest allowed versions

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and I believe that pinning minimum versions helps and speeds up the conda dependency resolver, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know

- libblas=*=*mkl
- mkl-service
- myst-nb
- numpy=1.15
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a ticket about numpy version compatibility? Pinning to such an old version doesn't feel right.

Below it's a >= pin.

- nbsphinx>=0.4
- numpy>=1.15.0
- numpydoc>=0.9
- pandas>=0.24.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a third different way to pin pandas.
If these differences have a good reason we should probably comment that right in the file.

- libpython
- mkl-service
- m2w64-toolchain
- numba
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the hack to get compiler dependencies installed correctly. Can we remove it already, or is the Aesara recipe still broken?

@twiecki
Copy link
Member Author

twiecki commented Sep 17, 2021

@michaelosthege Tried to relax.

@fonnesbeck
Copy link
Member

Anything holding this one up?

@twiecki twiecki force-pushed the remove_mkl branch 2 times, most recently from 71d01d5 to 5951ea5 Compare October 2, 2021 08:15
@twiecki
Copy link
Member Author

twiecki commented Oct 2, 2021

Rebased and squashed. Can merge once CI passes.

@twiecki
Copy link
Member Author

twiecki commented Oct 3, 2021

Not sure why

=================================== FAILURES ===================================
260
______________________ TestMatchesScipy.test_wald_logcdf _______________________
261
[XPASS(strict)] Poor CDF in SciPy. See scipy/scipy#869 for details.
262
___________________ TestMatchesScipy.test_negative_binomial ____________________
263

264
self = <pymc.tests.test_distributions.TestMatchesScipy object at 0x7fee9e5e9e50>
265

266
    def test_negative_binomial(self):
267
        def scipy_mu_alpha_logpmf(value, mu, alpha):
268
            return sp.nbinom.logpmf(value, alpha, 1 - mu / (mu + alpha))
269
    
270
        def scipy_mu_alpha_logcdf(value, mu, alpha):
271
            return sp.nbinom.logcdf(value, alpha, 1 - mu / (mu + alpha))
272
    
273
        self.check_logp(
274
            NegativeBinomial,
275
            Nat,
276
            {"mu": Rplus, "alpha": Rplus},
277
            scipy_mu_alpha_logpmf,
278
        )
279
        self.check_logp(
280
            NegativeBinomial,
281
            Nat,
282
            {"p": Unit, "n": Rplus},
283
            lambda value, p, n: sp.nbinom.logpmf(value, n, p),
284
        )
285
        self.check_logcdf(
286
            NegativeBinomial,
287
            Nat,
288
            {"mu": Rplus, "alpha": Rplus},
289
            scipy_mu_alpha_logcdf,
290
        )
291
        self.check_logcdf(
292
            NegativeBinomial,
293
            Nat,
294
            {"p": Unit, "n": Rplus},
295
>           lambda value, p, n: sp.nbinom.logcdf(value, n, p),
296
        )
297

298
pymc/tests/test_distributions.py:1305: 
299
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
300
pymc/tests/test_distributions.py:768: in check_logcdf
301
    scipy_eval = scipy_logcdf(**params)
302
pymc/tests/test_distributions.py:1305: in <lambda>
303
    lambda value, p, n: sp.nbinom.logcdf(value, n, p),
304
/usr/share/miniconda/envs/pymc-test-py37/lib/python3.7/site-packages/scipy/stats/_distn_infrastructure.py:3266: in logcdf
305
    place(output, cond, self._logcdf(*goodargs))
306
/usr/share/miniconda/envs/pymc-test-py37/lib/python3.7/site-packages/scipy/stats/_discrete_distns.py:329: in _logcdf
307
    return _lazywhere(cond, (x, n, p), f=f1, f2=f2)
308
/usr/share/miniconda/envs/pymc-test-py37/lib/python3.7/site-packages/scipy/_lib/_util.py:69: in _lazywhere
309
    np.place(out, cond, f(*temp))
310
<__array_function__ internals>:6: in place
311
    ???
312
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
313

314
arr = array([nan], dtype=float32), mask = array([ True])
315
vals = array([-0.00300043])
316

317
    @array_function_dispatch(_place_dispatcher)
318
    def place(arr, mask, vals):
319
        """
320
        Change elements of an array based on conditional and input values.
321
    
322
        Similar to ``np.copyto(arr, vals, where=mask)``, the difference is that
323
        `place` uses the first N elements of `vals`, where N is the number of
324
        True values in `mask`, while `copyto` uses the elements where `mask`
325
        is True.
326
    
327
        Note that `extract` does the exact opposite of `place`.
328
    
329
        Parameters
330
        ----------
331
        arr : ndarray
332
            Array to put data into.
333
        mask : array_like
334
            Boolean mask array. Must have the same size as `a`.
335
        vals : 1-D sequence
336
            Values to put into `a`. Only the first N elements are used, where
337
            N is the number of True values in `mask`. If `vals` is smaller
338
            than N, it will be repeated, and if elements of `a` are to be masked,
339
            this sequence must be non-empty.
340
    
341
        See Also
342
        --------
343
        copyto, put, take, extract
344
    
345
        Examples
346
        --------
347
        >>> arr = np.arange(6).reshape(2, 3)
348
        >>> np.place(arr, arr>2, [44, 55])
349
        >>> arr
350
        array([[ 0,  1,  2],
351
               [44, 55, 44]])
352
    
353
        """
354
        if not isinstance(arr, np.ndarray):
355
            raise TypeError("argument 1 must be numpy.ndarray, "
356
                            "not {name}".format(name=type(arr).__name__))
357
    
358
>       return _insert(arr, mask, vals)
359
E       TypeError: Cannot cast array data from dtype('float64') to dtype('float32') according to the rule 'safe'

is occurring.

… does not compile anything, it should not have these dependencies. Instead, it is aesaras job to specify its compile-chain dependencies. Closes #4715.

Add custom envs for testing.

Remove patsy dependency.
@twiecki twiecki merged commit b54c8af into main Oct 12, 2021
@twiecki twiecki deleted the remove_mkl branch October 12, 2021 07:29
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

Successfully merging this pull request may close these issues.

Remove strict requirement of MKL so that M1 chips are supported natively
5 participants