-
Notifications
You must be signed in to change notification settings - Fork 58
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
Alternatives to lapacke.h
#300
Comments
I think, probably, we can avoid calling LAPACKE routines in the C code in phono3py. There are two types of calling those routines:
For 1, calling the LAPACK routines via scipy is fine if the BLAS is multithreaded. In old days, installation of scipy was sometimes difficult, so I tried to avoid relying on it. But now I feel OK to depend on scipy, so except for experimental usage (https://phonopy.github.io/phono3py/direct-solution.html#solver-choice-for-diagonalization), use of LAPACKE may be avoided at least for the release version. For 2, currently I have no idea how to call selectively the multithreaded and single thread BLASs in one installation of phono3py. So I usually choose multithreaded BLAS, and the Overall, it is a good challenge to avoid using LAPACKE in a way as written above. Simply I had no reason to try it. |
@LecrisUT, I have made an option to remove the BLAS and LAPACKE calls in the C code (#301), and the libraries are unnecessary to be installed and linked. While I haven't conducted an extensive performance evaluation, it seems not bad. I believe this version is suitable for use in both conda and pip wheel packages. Although
|
Ok, I'll look into the changes and rebase. BTW |
Yes,
It is difficult to understand this sentence... The lapack approach is unnecessary. |
I am just checking if all the |
I think so. The following is the test,
The test with lapacke (https://github.com/phonopy/phono3py/blob/develop/.github/workflows/phono3py-pytest-conda.yml)
|
I think it is good to consider the new C++26 proposal for
<linalg>
, specifically section 9.2It seems unlikely that LAPACK interface would be ported to standard library and when BLAS is ported to C++ std, I don't believe the BLAS provider projects would have much benefit. Even currently there are issues:
lapacke.h
is not packaged in all providerspkg-config
supportFindLAPACK.cmake
does not actually add the relevantinclude
to work properlyThe paper recommends other C++ native libraries like Armadillo, Eigen3, etc. It might be useful to look into how the support for these would look like. But in the meantime let's discuss a plan of action
Short-term
Continue to use
lapacke.h
and test for the presence of the header, and fail the build if it's not present. The user would have to define themselves overrides likeBLA_VENDOR
to select the vendor that is compatible like OpenBLAS. There are various bugs that need to be addressed upstream:pkg-config
filesFindLAPACK.cmake
should have an interface to override the include directoryWith regards to the packaged wheels, these will contain bundled BLAS and LAPACK implementations compatible with
cibuildwheel
. How well this works, we will have to find out and work withcibuildwheel
folks. But hopefully the user can rely on thesdist
builds to work on their arbitrary environments.Future
For the future support we should consider some other options:
lapacke
wrappersFetchContent
in case the user does not have the packageIf it's possible to get some performance benchmarking or profiling that would be very helpful for guiding which approach is most suitable.
The text was updated successfully, but these errors were encountered: