-
Notifications
You must be signed in to change notification settings - Fork 308
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
Use 64-bit BLAS #133
Comments
I took a quick look at this with https://github.com/steabert/openblas-src/tree/ilp64 and https://github.com/steabert/cblas-sys/tree/ilp64, but as my rust knowledge is very limited at this point, I'm not sure if that would be the proper way to go. For one thing, one would like to make sure there is no feature mismatch between them. I guess in this library, it would just come down to detecting the feature that was set in the dependency, or propagating the feature? The biggest PITA with C/C++ and Fortran is usually getting mixed ilp64 and lp64 application/libraries with mostly garbage or the occasional crash at runtime. |
Thanks for looking at this. The issue is pretty old, and I'm not sure what's the right path or if it's needed. To be pragmatic, using whatever can commonly be installed as "system blas" would be preferred, but there might even be use cases for supporting both. |
There is a long story about "system blas" and the fact that it's mostly useless to anyone trying to run actual calculations :) Because of historical reasons, the BLAS interface has the The tragedy is that those CBLAS dimensions should have been So, the common procedure in computing is to compile the BLAS/LAPACK libraries with 64-bit default integer size. That data model is referred to as So, in the end, the only reason that the system blas has 32bit integer sizes for the dimensions is historic, and since that's the expected interface, that's what shipped with most distros. Usually, the What OpenBLAS e.g. offers is to have both interfaces into a single library file, but with different symbols, although that means you have to adapt your interface to use that: OpenMathLib/OpenBLAS#646, and related discussion: numpy/numpy#5906. So after my little rant (sorry!), to the question of relevance / use case:
I was excited to see the |
Thanks for the explanation! Sounds like it's tricky to solve in Rust's bindings too. For toolchain reasons I think it's a pain to have to compile blas just to run tests or CI - this is one reason to have a system-installed alternative. And in Rust, it's very common with clean builds too, and not reusing cargo builds between different projects, so build time always adds up. |
You're absolutely right, it should be possible to use the system blas. I was hoping we could make it so that when neccessary, one could just flip a switch to compile an ilp64 version. |
Using 64-bit BLAS allows removing the fallback for arrays with dimensions larger than the 32-bit supported by regular openblas.
64-bit refers to the index / stride / dimension size used.
The text was updated successfully, but these errors were encountered: