| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Well that is smoking out a bunch of issues ... I bet there's a whole bunch of projects building NumPy in CI without BLAS support, either by accident or because it doesn't matter to them. I think we need to have this default though, because it affects the pip install numpy from source and most users are going to want BLAS/LAPACK support. |
Sorry, something went wrong.
Disable using BLAS in the PyPy job on Azure because it was broken. Before this PR, it uses to silently not find OpenBLAS and continue, now we have to be explicit about it.
| mkdir C:/opt/32/lib/pkgconfig | ||
| mkdir C:/opt/64/lib/pkgconfig | ||
| # TBD: support 32 bit testing | ||
| $target=$(python -c "import tools.openblas_support as obs; plat=obs.get_plat(); ilp64=obs.get_ilp64(); target=f'openblas_{plat}.zip'; obs.download_openblas(target, plat, ilp64);print(target)") |
There was a problem hiding this comment.
Oh, this is ugly :)
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, this stuff is awful. I'm really looking forward to the day we have OpenBLAS in a wheel and get rid of this.
Sorry, something went wrong.
|
LGTM. Just for confirmation
|
Sorry, something went wrong.
Indeed, that's how it has always been - you get 32-bit by default, and have to opt in to ILP64.
It's working fine and is used in a bunch of places. Only the PyPy build is changed here, it was silently failing to find OpenBLAS ILP64 before (so passing with lapack-lite), and when I fixed the detection logic it started failing with a "can't import _multiarray_umath error". So that needs investigating, but on a Windows machine - debugging that via Azure isn't really possible. Cc @mattip for visibility. |
Sorry, something went wrong.
I am not sure what you meant by "it" in the context of PyPy failing. It seems all the CI is passing here? |
Sorry, something went wrong.
|
@mattip I had to add DISABLE_BLAS and -Dallow-noblas to the PyPy job to make it pass. There never was a working CI job that linked against openblas64_, and the "fail instead of silently proceeding" change in this PR smoked that out. |
Sorry, something went wrong.
|
Let's get this in. Thanks Ralf. |
Sorry, something went wrong.
|
@charris I think we can backport all this to 1.26.x, but set the default for allow-noblas to true. That way it keeps the code between the two branches in sync (which is useful), and allows using the flag to test whether our wheel builds and CI jobs indeed pick up OpenBLAS. While at the same time not changes the behavior for 1.26.0. |
Sorry, something went wrong.
|
This seems already done in 1.26 except main isn't building pp39. |
Sorry, something went wrong.
Except the default is still false there, which is fine for now, but as I commented here, we should decide before the final release whether that is what we'd like to do. |
Sorry, something went wrong.
I think we should allow building without OpenBLAS by default on 1.26. That has been the policy up to now. The time to change it is in the move to 2.0, not in a 1.26 interim release which is mainly meant to enable building with meson for python 3.12. |
Sorry, something went wrong.
|
@mattip if it were only about the policy and there were no side effects, it would be a simple decision indeed and I'd agree we should only consider it for 2.0. Why I am hesitant (either way) is that the BLAS/LAPACK detection mechanisms changed. E.g. someone who had a ~/site.cfg file pointing to their library of choice will now, if the default is true, silently get a slow lapack-lite build. I'd expect even Linux distro packagers may get this wrong. E.g., they have OpenBLAS or ATLAS in the right place, but no pkg-config installed when they build a numpy 1.26.0 package. Usually they just look at their build automation that tells them a new release was uploaded to PyPI, trigger a build, and call it good if it builds and the test suite passes. So the trade-off we deal with here is:
Given the above, would you still prefer allow-noblas=true? |
Sorry, something went wrong.
|
Hmm. Crazy thought: could we port just enough of the system_info discovery system to give a clear error before using lapack-lite if
|
Sorry, something went wrong.
|
My first thought was "even more work, don't really wanna". Second thought: "yeah, I think this is actually feasible and may be appreciated by our users". There's two ways of doing that:
Neither is going to be 100% complete without a lot of effort, but it's doable to catch most of the common cases with maybe half a day of work. The trickiest situation is also the most common one: when the user did nothing special like setting an env var or creating a site.cfg file, but some library would have been auto-detected in one of the hardcoded paths in system_info.py. That case is easier to handle with (1), so I think I'd go for that approach. |
Sorry, something went wrong.
|
I'd be happy just to be able to continue using something like .numpy-site.cfg. I read the Redhat thread on the missing pkgconf files for OpenBLAS, and I think they had a point about the difficulty in handling all the different OpenBLAS options, not to mention other BLAS versions. Which is to say, automatic detection may not be sufficient. IIRC, there was also a builtin priority in the way that was done before. Having a simple way to just specify which library to use would be helpful, along with platform specific documentation. All this makes me appreciate Pearu's work way back in the beginning. |
Sorry, something went wrong.
|
@charris you can use a custom file to specify the location, compile flags, etc. of BLAS/LAPACK. It has changed from a numpy-specific and ad-hoc format to a pkg-config file, as documented at http://scipy.github.io/devdocs/building/blas_lapack.html#using-pkg-config-to-detect-libraries-in-a-nonstandard-location.
Yep, that part is still in the works (also for SciPy). I should have that done by the end of September; recreating all of system_info.py has turned out to be a little more challenging than expected.
definitely! |
Sorry, something went wrong.
I ended up downloading a tarball from the OpenBLAS nightlies and installing it in /usr. Note that meson does not recognize PKG_CONFIG_PATH, so the install locations are limited to the defaults. We could upgrade tools/openblas_support.py to make such an install, in Fedora 38 it currently installs in /var/tmp. That module could also use more documentation. |
Sorry, something went wrong.
That's not how that works. You can put a .pc file anywhere, and then the PKG_CONFIG_PATH environment variable should be set to point to the location of the .pc file. The include and library directories are given inside the .pc files, and those can be any absolute path.
We will get rid of that file as soon as possible, so please don't spend more than the minimum needed effort on it. The plan is to change our custom OpenBLAS build from a .tar.gz to a wheel, and at that point the install command is pip install openblas and the install locations are then inside or relative to site-packages. |
Sorry, something went wrong.
This xfail was added in numpygh-24279 for 32-bit Python + MSVC when switching to Meson and having temporarily no SIMD support. That is back now, so this test passes again. [skip circle] [skip cirrus] [skip travis]
| Back | FazBrowse Home | New Git URL |
The change of default in build system behavior follows up on the discussion in gh-24200. It avoids large accidental regression in performance. If users really want to build with fallback routines, it's a matter of passing a single -Dallow-noblas to opt into that.
The 32-bit Python on Windows CI job was removed from Azure when switching to Meson. This re-introduces it, on GitHub Actions because it's much easier to debug there. This should be low-maintenance, and exercise the -Dallow-noblas flag at the same time. It addressed one of the TODO's in gh-23981.
There was one failing test on this config, not surprising because it hasn't been tested before. Those were for floating point exceptions, which already had a note about issues with MSVC + 32-bit Python. Given that the behavior is going to change when SIMD support comes back, I simply disabled the test for now.