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
Upgrade numpy to 1.21.4 #1934
Upgrade numpy to 1.21.4 #1934
Conversation
@@ -0,0 +1,13 @@ | |||
diff --git a/numpy/distutils/command/build.py b/numpy/distutils/command/build.py |
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.
Unintentionally included this file. This patch is not needed.
This must've been a hard job. I appreciate your effort! A minor comments:
I think adding these descriptions into the patch file would help other people who later see patch files.
|
Thanks a lot for doing this work @leopsidom !
Right now the CI fails with,
which seems to be expected as discussed in emscripten-core/emscripten#12714. I'm very in favor of investigating what we need to use SIMD a separate issue (and in particular check that it doesn't break Safari), for now maybe the easiest would be,
to disable simd ?
This is another subject we should improve on in Pyodide. Historically we have not run much tests for packages, because while we have the ability to run the package test suites in Pyodide #69 running them would be very slow, and there are also some known failure (cf related open issues about numpy). So we have just written some sanity tests and that's it. However now we have much more CI resources than before and I think we could run them but maybe triggered manually and not for each commit. Improving the package test situation is also somewhat a blocker for #1577 So there is a lot work that can be done there, for this PR for instance running the numpy test suite and report new issues would probably be sufficient. We can also do this after merging of this PR. The only thing maybe we should add a test for, is one of the operations that uses SIMD to make sure that calling it doesn't error after all the workaround that were done here. |
Good idea. I have added the description to the corresponding patch files.
I think numpy has it's own test suite. Ideally we might want to see how we can run the tests in pyodide as commented by @rth. |
Yeah, that means we have to pass an extra cflag
Sounds good. I've switched both to |
Scipy build is failing because it can't link |
Hmm yeah, will check a little later this week. |
The
Looks like |
I think this will depend on success of this upgrade: #1293 |
Well it's still available as |
Ahh, good point. Let me try that. |
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.
Thanks @leopsidom, great I see the CI passes!
A few minor comments below otherwise looks good. Could you also please merge upstream/main to sync? I merged #1708 recently which adds a few more patches to numpy, but you should be able to remove the fix-random-double-fill.patch
with this update.
@@ -329,6 +329,8 @@ def handle_command(line, args, dryrun=False): | |||
continue | |||
if arg == "-lffi": | |||
continue | |||
if arg == "-mpopcnt": |
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.
Maybe let's add a comment that this is a SSE 4.2 instruction, and we currently build without SIMD.
Just so it's easier to know what to re-enable once we want to build with SIMD.
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.
Added a comment -
It seems the |
It's possible, I wasn't 100% sure in what release it got included. |
No actually my initial comment was correct. That patch is not included in 1.21.4, so it's still necessary. |
Yeah, I was looking at a newer commit @1.22.0.dev0 |
Also I'm seeing two patches not applied in |
Maybe they aren't needed any more, but we just forgot to delete them? |
Okay, makes sense. Let me just remove them - |
Oh wait I think they are correct. The first one is Cython patch not a numpy patch. The 2nd does get included in meta.yaml. |
Thanks @leopsidom ! |
Thanks @leopsidom! This is very helpful. Though I think we should have a changelog entry for this? |
Opened a PR to update the change log. |
Description
Currently pyodide has numpy @1.17.5 but the newest numpy version is 1.21.4. This PR is to keep the numpy package in pyodide up to date. Some changes made in this PR include:
add-emscripten-cpu.patch
andrm-duplicate-symbols-link.patch
. These patches got removed because the underlying issue has been fixed in the numpy package.fix-invalid-asm-instruction.patch
to fix invalid asm instructionslimit-cpu-baseline.patch
this is to limit cpu baseline toAVX
so it doesn't try to build SIMD feature AVX512 that emscripten doesn't support;not-build-lapack-lite-as-64-bit.patch
this is to prevent building lapack-lite as 64 bit integer mode which emscripten doesn't support;fix-static-init-of-nditer-pywrap.patch
use-local-blas-lapack.patch
Notes: in numpy build file, I'm currently setting:
I think this means there are still basic SIMD optimization built with this which is supported by emscripten. We might want to check if we want to enable it yet.
Issue: #1827
Checklists
Not all of these steps are necessary for every PR.