-
Notifications
You must be signed in to change notification settings - Fork 14
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
Support for new Accelerate interface on macOS 13.3 #43
Comments
Good to hear that they updated. Hopefully that means they will keep up-to-date with LAPACK versions now. Confusing, because in the LAPACK configure step (
Will need some more investigation to understand what's going on. |
I think the issue might be in missing the |
I changed the config to define it on the command line. That shouldn't really matter — it calls
I'm on macOS Ventura 13.4.1. Edit:
|
Could the issue stem from different ways of including Accelerate? I ran a search for |
@mgates3 I think there's something to my hypothesis. I tracked down
Here are the contents of that folder, just to help you get oriented.
The relevant lines in
I looked at some of blaspp/lapackpp's cmake files and their logic for macOS systems. They try to find
I tried looking at the latter file, but I don't really understand what it's doing. It defines a preprocessor macro called
|
Thanks for the investigation. BLAS++ and LAPACK++ largely ignore the system headers. They define their own Fortran prototypes, since most BLAS / LAPACK libraries don't even provide Fortran prototypes, and might get them wrong with respect to Mostly we probe the library to figure out behavior, rather than relying on Fortran prototypes that might not even exist. So if the BLAS / LAPACK library changes its runtime behavior, we should detect that. Yes, I'm very much wondering if they failed to update Apple Accelerate always gives lots of headaches. One is including the header file. Per the comments in blaspp/config/cblas.cc, if configure can find cblas.h, it will use that. This is the officially sanctioned method of using CBLAS (Appendix B.2.8), so if Apple doesn't support it, that's their bad. Nonetheless, we also check for Accelerate.h, if using cblas.h didn't work, but I previously had issues with Accelerate.h. (Intel MKL and IBM ESSL also fail to have the cblas.h header, also requiring complicated If Apple's updates require going through cblas / lapacke rather than the Fortran interface, that would be quite unfortunate and really complicate BLAS++ / LAPACK++. |
It sounds like it's worth getting some Accelerate developers involved in this discussion. I have the contact info for the guy who oversees Accelerate's development. Should I reach out to him? |
@mgates3, can you push the code you changed to some branch, so that I can replicate what you did? EDIT: I might have misunderstood the nature of your change. I tried compiling
Then running |
@rileyjmurray I fixed my comment from Aug 31. One of the lines was truncated. You can just copy those two I tried including I talked with Heiko briefly at the SparseBLAS workshop and need to follow up with him about what they did to get the new Accelerate working. lapack_version.cc
Compiled as:
|
Thanks for the update, @mgates3. I get different results from what you observe. Here's what I see with clang++ and the ACCELERATE_NEW_LAPACK definition.
Upon running If I use clang++ with no special defines, then I see the following.
Running System infomacOS 13.6.2 (22G320) Compiler
Developer toolkit
Note: my version of the macOS developer toolkit actually overrides g++ with the Apple version of clang. I verified that this version of clang produces the same results as I reported above (based on Homebrew clang++).
|
Ah! Success!
That fixes the problem. Setting
Now we would have to include Apple's Accelerate.h header instead of our own fortran.h header. Hopefully that's all there is to it. Note my
|
Hooray, progress! Do you think you'll be able to make the necessary changes to BLAS++ and LAPACK++ in the near future? |
I'm looking into it. Unfortunately it requires a bit more changes to the fortran.h header than I hoped, since we have to use Apple's decorated prototypes instead of our own, but need our own macros:
and so on. But now it seems just a matter of getting the mechanics right. |
Happy to hear that. No worries if it takes a few weeks for you to get to this. @TeachRaccooon and I can put this feature to work as soon as it's ready, but we can keep ourselves busy until then. Please let us know if there's anything we might be able to do to help. |
Hi @mgates3, just checking in on this. Any chance you can get to it this week? |
You can see my current work in BLAS++ PR icl-utk-edu/blaspp#74 |
Progress of any kind is awesome. Thanks so much! I’ll keep an eye on that
PR, and look out for a similar PR on this repo.
Riley
…On Wed, Dec 20, 2023 at 4:23 PM Mark Gates ***@***.***> wrote:
You can see my current work in BLAS++ PR icl-utk-edu/blaspp#74
<icl-utk-edu/blaspp#74>
Still a ways to go to work, and then do similar work on LAPACK++.
—
Reply to this email directly, view it on GitHub
<#43 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACRLIFEJAW4JOOMTPTRQG7DYKNJLJAVCNFSM6AAAAAA4GGXLNSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRVGE2TMMZSGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
The version of Accelerate that ships with macOS 13.3 has the option of providing ILP_64 and LAPACK 3.9.1:
https://developer.apple.com/documentation/macos-release-notes/macos-13_3-release-notes#New-Features
This new version of Accelerate is a major upgrade. Older versions only supported LAPACK 3.2. @TeachRaccooon (Max) and I need the more up-to-date LAPACK 3.9.1 interface to get randomized column-pivoted QR working on Apple Silicon.
@mgates3 having this fix in LAPACK++ would actually make a big difference for us. Let me know if there's anything I can do to help.
The text was updated successfully, but these errors were encountered: