-
Notifications
You must be signed in to change notification settings - Fork 159
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
Cython 3 and numpy 2 #3290
Cython 3 and numpy 2 #3290
Conversation
I was wrong to assume that this would be simple. In order for Cython 3 to work for us we need to also install numpy 1.26 (as older numpys do not work with Cython 3). This has a number of issues:
@JDBetteridge, you were completely right about this being a hard problem. I vote that we wait for numpy 2.0 to land when the build system is sane again. However, I hope it's at least helpful that I've fixed |
@@ -983,14 +982,10 @@ def run_pip_install(pipargs): | |||
# subprocesses wrote out. | |||
# Particularly important for debugging petsc fails. | |||
with environment(**blas): | |||
pipargs = ["-vvv"] + pipargs | |||
pipargs = ["-v"] + pipargs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😂
@Ig-dolci FYI I am having another stab at this now. If we use the release candidate for numpy 2.0 then we can hopefully land Cython 3 and numpy at the same time. |
This is quite the pain, now loopy is also having issues. |
@@ -1347,8 +1334,9 @@ def build_and_install_torch(): | |||
raise InstallError("CUDA installation is not available on MacOS.") | |||
if sys.version_info >= (3, 10): | |||
run_pip_install(["typing_extensions"]) | |||
extra_index_url = ["--extra-index-url", "https://download.pytorch.org/whl/cpu"] if args.torch == "cpu" else [] | |||
run_pip_install(["torch"] + extra_index_url) | |||
# FIXME: use nightly to see if that makes numpy 2.0 happy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should really be
pip install torch==2.3.0 --index-url https://download.pytorch.org/whl/test/cpu
as detailed in https://dev-discuss.pytorch.org/t/pytorch-release-2-3-0-final-rc-is-available/1995
2.3.0 is supposed to be released 24/04.
Just to double check: are the numpy changes here backward compatible with 1.x, or not? cython 3.x is somewhat widespread now, while it will still take a while to get numpy 2.x widely used (at least, on installations that do not use firedrake-install) |
I think so. The errors fixed here were mostly due to numpy dropping support for deprecated API. |
Will this be closed in favor of #3546? |
Yes. |
Description
Fixes #3081
It will also allow us to update our PETSc fork as petsc4py now requires cython 3.