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

Gpy is not built using cython #2

Open
elcorto opened this issue Jan 18, 2023 · 0 comments
Open

Gpy is not built using cython #2

elcorto opened this issue Jan 18, 2023 · 0 comments

Comments

@elcorto
Copy link
Owner

elcorto commented Jan 18, 2023

This a minor thing but still worth documenting.

We removed cython from reqs since it gets pulled in by Gpy anyway as install_requires. However the wheel doesn't get built using cython. Therefore we use Gpy using the numpy fallback, even if we install cython first. Must be a Gpy issue.

Here we create a venv, install cython, Gpy and then the rest in order. cython is not used.

$ fd -g "GPy*.whl" ~/.cache/pip
/home/elcorto/.cache/pip/wheels/27/bd/9f/82ab4216eae088cba864ca0dc1d75699bd4bf6823790fb2f77/GPy-1.10.0-py3-none-any.whl

$ fd -g "GPy*.whl" ~/.cache/pip | xargs rm
$ mkvirtualenv gp_play
(gp_play) $ pip install --extra-index-url https://download.pytorch.org/whl/cpu torch
(gp_play) $ pip install cython
(gp_play) $ pip install Gpy
Collecting Gpy
  Using cached GPy-1.10.0.tar.gz (959 kB)
  Preparing metadata (setup.py) ... done
Collecting numpy>=1.7
  Using cached numpy-1.24.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB)
Collecting six
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting paramz>=0.9.0
  Using cached paramz-0.9.5-py3-none-any.whl
Requirement already satisfied: cython>=0.29 in /home/elcorto/.virtualenvs/gp_play/lib/python3.10/site-packages (from Gpy) (0.29.33)
Collecting scipy>=1.3.0
  Using cached scipy-1.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (34.4 MB)
Collecting decorator>=4.0.10
  Using cached decorator-5.1.1-py3-none-any.whl (9.1 kB)
Building wheels for collected packages: Gpy
  Building wheel for Gpy (setup.py) ... done
  Created wheel for Gpy: filename=GPy-1.10.0-py3-none-any.whl size=1089372 sha256=8f010617e946ba7bdb211d3e78dd37e2e2be165a377d355cefea5f78dbfdefb8
  Stored in directory: /home/elcorto/.cache/pip/wheels/27/bd/9f/82ab4216eae088cba864ca0dc1d75699bd4bf6823790fb2f77
Successfully built Gpy
Installing collected packages: six, numpy, decorator, scipy, paramz, Gpy
Successfully installed Gpy-1.10.0 decorator-5.1.1 numpy-1.24.1 paramz-0.9.5 scipy-1.10.0 six-1.16.0

(gp_play) $ pip install -r requirements.txt

(gp_play) $ python book/content/gp_pred_comp/notebook_comp.py
No GPU/TPU found, falling back to CPU. (Set TF_CPP_MIN_LOG_LEVEL=0 and rerun for more info.)
warning in stationary: failed to import cython module: falling back to numpy
warning in coregionalize: failed to import cython module: falling back to numpy
warning in choleskies: failed to import cython module: falling back to numpy

Uninstall, rm wheel and install again builds it using cython. Strange.

(gp_play) $ pip uninstall Gpy
(gp_play) $ fd -g "GPy*.whl" ~/.cache/pip | xargs rm
(gp_play) $ pip install Gpy
Collecting Gpy
  Using cached GPy-1.10.0.tar.gz (959 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy>=1.7 in /home/elcorto/.virtualenvs/gp_play/lib/python3.10/site-packages (from Gpy) (1.24.1)
Requirement already satisfied: six in /home/elcorto/.virtualenvs/gp_play/lib/python3.10/site-packages (from Gpy) (1.16.0)
Requirement already satisfied: paramz>=0.9.0 in /home/elcorto/.virtualenvs/gp_play/lib/python3.10/site-packages (from Gpy) (0.9.5)
Requirement already satisfied: cython>=0.29 in /home/elcorto/.virtualenvs/gp_play/lib/python3.10/site-packages (from Gpy) (0.29.33)
Requirement already satisfied: scipy>=1.3.0 in /home/elcorto/.virtualenvs/gp_play/lib/python3.10/site-packages (from Gpy) (1.10.0)
Requirement already satisfied: decorator>=4.0.10 in /home/elcorto/.virtualenvs/gp_play/lib/python3.10/site-packages (from paramz>=0.9.0->Gpy) (5.1.1)
Building wheels for collected packages: Gpy
  Building wheel for Gpy (setup.py) ... done
  Created wheel for Gpy: filename=GPy-1.10.0-cp310-cp310-linux_x86_64.whl size=3229998 sha256=5043579109b96992f294d5bdc524a8f51419bb83ba99dffe9de3863fafc87bb9
  Stored in directory: /home/elcorto/.cache/pip/wheels/27/bd/9f/82ab4216eae088cba864ca0dc1d75699bd4bf6823790fb2f77
Successfully built Gpy
Installing collected packages: Gpy
Successfully installed Gpy-1.10.0

(gp_play) $ python book/content/gp_pred_comp/notebook_comp.py
No GPU/TPU found, falling back to CPU. (Set TF_CPP_MIN_LOG_LEVEL=0 and rerun for more info.)
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

1 participant