Skip to content
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

Add new BLAS and LAPACK symbols in quadruple precision #145

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

amontoison
Copy link
Contributor

@amontoison amontoison commented Nov 9, 2024

@amontoison amontoison force-pushed the quad_symbols branch 2 times, most recently from ecd9f06 to 341e7e3 Compare November 9, 2024 03:42
Copy link
Member

@staticfloat staticfloat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to need a version bump. Can you increase the version number here? I think increasing the patch number should be sufficient, as this is totally backwards-compatible.

@@ -481,7 +495,7 @@ zpotri,
dtptrs,
dtrcon, dtrevc, dtrexc, dtrrfs, dtrsen, dtrsna, dtrsyl,
dtrtrs, dtzrzf, dstemr,
dsgesv, dsposv, dlag2s, slag2d, dlat2s,
dsgesv, dsposv, dlag2s, dlag2d, dlat2s,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@@ -566,6 +581,69 @@ zpotri,
zgeqrt, zgeqrt2, zgeqrt3, zgemqrt,
ztpqrt, ztpqrt2, ztpmqrt, ztprfb,
);

@exlapackobjs2 = (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is quite a lot of symbols being added; what happened here? Were we just missing these?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is to support quadruple-precision BLAS/LAPACK with LBT.
The symbols are not standard in quadruple precision; OpenBLAS uses the prefixes q* or x*, but only for the BLAS symbols and routines with real inputs.
I would like to add a similar paradigm for LAPACK symbols, but I am open to suggestions!

Integrating Fortran code compiled in quadruple precision is straightforward in Julia using the Float128 data type from Quadmath.jl.
However, we need an efficient way to compile our library with BLAS/LAPACK libraries that have dedicated symbols for quadruple precision.
LBT is optimal because we can add a dedicated backend compiled in quadruple precision at runtime.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you're planning to have LBT redirect back to Julia code for the backing algorithms for this quadruple precision?

Copy link
Contributor Author

@amontoison amontoison Nov 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I was planning to compile Reference-LAPACK in quadruple precision.
A simple way to do this is to use the compiler-dependent flag -freal-8-real-16 with gfortran and some macros for the symbols.

The goal is to use it in libHSL, which is more or less similar to SuiteSparse and has some of the most robust linear solvers, such as MA27 and MA57, available in quadruple precision.
I can easily call them later in Julia with wrappers like this.

CUTEst doesn’t have any dependencies, unlike libHSL, which requires BLAS / LAPACK.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. And so you’re trying to start a new convention with this naming scheme, or is there already a naming scheme for this and you’re conforming to that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the q* symbols, I followed what was initially established by GotoBLAS, so I’m not creating a new convention here; instead, I’m following one that already exists informally. I proposed splitting this PR into two parts, one of which would include only the quadruple symbols.

I’ll contact Julien Langou, one of the developers of Reference-LAPACK, to confirm this informal convention, and then we can decide how to proceed.

@amontoison amontoison changed the title Add new BLAS and LAPACK symbols Add new BLAS and LAPACK symbols in quadruple precision Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants