-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
ENH: enable OpenBLAS on windows. #10139
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
Conversation
Note that this requires #9431 also, but that's a pretty big change. You might be better off using our distutils hack:
|
What's the motivation for backporting this to 1.13.x? Switching our wheels to OpenBLAS seems like it might be a risky change to do in a point release. |
This is a significant performance improvement for large arrays. Whether that means anything relevant is not my say. |
@njsmith I canceled the backport as it isn't needed. However, note that 1.13.3 was built with OpenBLAS on windows, which was actually useful, as it got tested and a bug in the 32 bit version was uncovered. The bug also let us test the build version machinery of PIP, so it was a good all round learning experience :0 |
Wait, sorry. This configuration isn't needed to build with OpenBLAS if you standardize on the MSVC ABI:
The current build procedure (in master) standardizes on the MinGW ABI:
The reason for this is that this is the way that it was done in SciPy, because you currently must standarize on the MinGW ABI if you are using gfortran. But Numpy doens't have fortran sources. |
I realize this is confusing and am I working on a solution to remove the second scenario entirely: #10047. |
@xoviat So if I do a 1.13.4 it should just work? After the license fix and check that the 32 bit OpenBLAS bug has been fixed. |
Yes, but you should change the |
There are so many moving parts here that it's difficult to say for sure (ugh!). But it should work. |
@xoviat Numpy 1.13.x can not be built for 32 bit windows. I'm guessing something has changed in picking up the correct OpenBLAS module. |
That is with |
Ouch! The 64 bit wheels may not even be correct either because it looks
like you picked up the mingwpy OpenBLAS, which has been shown to be broken.
To resolve these issues, we need to do a few things:
1. Backport the changes from "make MSVC + mingw gfortran work" related to
writing __config__.py. These should be about five lines of changes that
should have no problem being accepted into a maintenance release.
2. Make absolutely sure that the OpenBLAS name does not contain "mingwpy."
3. Copy the OpenBLAS.dll file to the extra-dll directory. This can be done
with one line in appveyor.yml.
|
The correct OpenBLAS file (for both 32 and 64 bit) is given here:
https://ci.appveyor.com/project/scipy/scipy/build/1.0.1267/job/6t57x3f0v4gpdu1r#L62
https://3f23b170c54c2533c070-1c8a9b3114517dc5fe17b7c3f8c63a43.ssl.cf2.rackcdn.com/openblas-5f998ef_gcc7_1_0_win32.zip
|
Specifically, you need to backport these lines:
https://github.com/numpy/numpy/pull/9431/files#diff-59c1de52780b698ea26e0cbbda5c951cR2284
|
@xoviat Don't think so, as master doesn't build 32 bit window wheels using the new OpenBLAS libraries either. I think the script in |
Master uses the same openblas as scipy. Please note that the mingwpy openblas is broken. |
Current status building NumPy wheels against master
@xoviat I assume that we need the EDIT: Note that this PR was against EDIT2: the libraries are unpacked by |
@charris Let me prepare a PR backporting the required fixes. It should take a few minutes. |
The failures are against master. |
I assume the libraries are being unpacked into the wrong location. I'd rather fix that first and worry about the |
Do you want to build master or maintenance/1.13x? I can do either but it's going to be different strategy for each. Edit: building master is much simpler. |
Both, although I want to do master first and am considering dropping the 1.13.4 release. Because things will probably differ by branch, I'd rather wait to make major modifications till after implementing branches for |
Which is to say, I'd rather start by modifying |
MacPython/numpy-wheels#11 will build master with |
Backport of #9645.
Previously, #9431 allowed distutils to make use of gfortran to create fortran wrappers that worked with MSVC. For a quick review:
Distutils detects objects that cannot be linked with an MSVC lib.
Distutils compiles unlinkable objects into a DLL
Distutils links Python extension against the DLL
Distutils writes config that includes the DLLs in the PATH.
Here, we use distutils the link against the "unlinkable object" openblas.a. Distutils compiles openblas with gfortran as a DLL and then links against it. As a result of using OpenBLAS, performance restrictions on windows are addressed.
Because gfortran enables BLAS and fortran functionality, some new tests are run that were previously skipped. Some of these newly run tests fail. Such tests are marked as "known failures" on windows because they were previously untested on the CI, thus they are not regressions.