Skip to content

Add blas and cblas subroutines *skewsbmv - #1449

Open
sh-zheng wants to merge 6 commits into
Reference-LAPACK:masterfrom
sh-zheng:blas-skewsb
Open

sh-zheng wants to merge 6 commits into
Reference-LAPACK:masterfrom
sh-zheng:blas-skewsb

Conversation

@sh-zheng

Copy link
Copy Markdown
Contributor

This submission provides subroutines of *skewsbmv (skew-symmetric band matrix-vector multiplication). It is a supplement of existed skew-symmetric blas2 subroutines.

@codecov

codecov Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.12111% with 86 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.05%. Comparing base (a5857d1) to head (d282e93).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
CBLAS/testing/c_dblas2.c 0.00% 27 Missing ⚠️
CBLAS/testing/c_sblas2.c 0.00% 27 Missing ⚠️
CBLAS/testing/c_dblat2.f 60.00% 10 Missing ⚠️
CBLAS/testing/c_sblat2.f 60.00% 10 Missing ⚠️
BLAS/TESTING/dblat2.f 90.62% 6 Missing ⚠️
BLAS/TESTING/sblat2.f 90.62% 6 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1449      +/-   ##
==========================================
+ Coverage   70.04%   70.05%   +0.01%     
==========================================
  Files        6210     6214       +4     
  Lines      497449   497933     +484     
  Branches    23436    23460      +24     
==========================================
+ Hits       348442   348848     +406     
- Misses     148571   148649      +78     
  Partials      436      436              
Components Coverage Δ
BLAS 99.74% <100.00%> (+<0.01%) ⬆️
CBLAS 97.13% <100.00%> (+0.02%) ⬆️
LAPACK 83.45% <ø> (ø)
LAPACKE 2.17% <ø> (ø)
TMGLIB 55.69% <ø> (ø)
BLAS testing 88.77% <90.62%> (-0.01%) ⬇️
CBLAS testing 89.43% <60.21%> (-0.22%) ⬇️
LAPACK testing 82.26% <ø> (ø)
LAPACKE testing ∅ <ø> (∅)
Files with missing lines Coverage Δ
BLAS/SRC/dskewsbmv.f 100.00% <100.00%> (ø)
BLAS/SRC/sskewsbmv.f 100.00% <100.00%> (ø)
CBLAS/src/cblas_dskewsbmv.c 100.00% <100.00%> (ø)
CBLAS/src/cblas_sskewsbmv.c 100.00% <100.00%> (ø)
CBLAS/testing/c_d2chke.c 98.77% <100.00%> (+0.07%) ⬆️
CBLAS/testing/c_s2chke.c 98.77% <100.00%> (+0.07%) ⬆️
BLAS/TESTING/dblat2.f 85.41% <90.62%> (+0.02%) ⬆️
BLAS/TESTING/sblat2.f 85.41% <90.62%> (+0.02%) ⬆️
CBLAS/testing/c_dblat2.f 82.98% <60.00%> (-0.42%) ⬇️
CBLAS/testing/c_sblat2.f 82.98% <60.00%> (-0.42%) ⬇️
... and 2 more

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a5857d1...d282e93. Read the comment docs.

@mohawk2

mohawk2 commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

This may be none of my business, sorry if so. I note this extends your previous skew-symmetric routines. Are there current LAPACK routines that should be updated to use any of those?

@sh-zheng

Copy link
Copy Markdown
Contributor Author

This may be none of my business, sorry if so. I note this extends your previous skew-symmetric routines. Are there current LAPACK routines that should be updated to use any of those?

Hi,

As far as the current call structure goes, there are no LAPACK routines calling *skewsbmv other than the test routines. Similarly, the *skewsymv, *skewsyr2, *skewsymm, and *skewsyr2k I submitted previously currently have no callers in LAPACK, but a subsequent set of skew-symmetric LAPACK routines I plan to submit will call them.

@mohawk2

mohawk2 commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

This may be none of my business, sorry if so. I note this extends your previous skew-symmetric routines. Are there current LAPACK routines that should be updated to use any of those?

Hi,

As far as the current call structure goes, there are no LAPACK routines calling *skewsbmv other than the test routines. Similarly, the *skewsymv, *skewsyr2, *skewsymm, and *skewsyr2k I submitted previously currently have no callers in LAPACK, but a subsequent set of skew-symmetric LAPACK routines I plan to submit will call them.

Makes sense. Good luck!

@martin-frbg

Copy link
Copy Markdown
Collaborator

This may be just an old man comment, but it still feels wrong to me that a reference library that has been pretty much officially closed&complete for over 30 years - to the extent that any new functions had to be put into LAPACK as "miscellaneous BLAS-like" instead - is suddenly introducing new symbols. There was limited precedent for GEMMTR as GEMMT was around as a vendor extension, but its addition caused problems nevertheless (I'm not even sure that said vendors have adopted the new name) - and I find it a bit weird to see that circumstance now labeled as the other implementations being "deficient".
Of course, the situation is completely different with LAPACK, as that has pretty much always been in active development.

@ilayn

ilayn commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

I agree. The problem is not the addition but as new symbols go into the binary, their absence is very loud as we experienced when ?gemmtr was not available on Accelerate for a while.

In other words, there is no fallback mechanism to make things gracefully run regular ?gemv behind the scenes, should the user links to an older BLAS. So this needs to be very loud in all vendors that now folks need to bother with their BLAS (and not LAPACK) version cf. #1446

@martin-frbg

Copy link
Copy Markdown
Collaborator

Arguably the addition as such is problematic as well, if the normative power of a reference implementation is still to be taken seriously - does every other implementation of the BLAS have to scramble to stay conformant to what has inexplicably become a moving target ?

@mohawk2

mohawk2 commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Arguably the addition as such is problematic as well, if the normative power of a reference implementation is still to be taken seriously - does every other implementation of the BLAS have to scramble to stay conformant to what has inexplicably become a moving target ?

I'd argue that is up to them whether to "scramble". But I like the idea that BLAS can actually evolve rather than being "stable" (in the special biologist sense of "dead"). Having explicit versions of BLAS, as you already have with LAPACK, and even considering separate releases, would be a way to solve this.

@martin-frbg

Copy link
Copy Markdown
Collaborator

Call it something else, if you want it to be a novel BLAS-like library ?

@sh-zheng

Copy link
Copy Markdown
Contributor Author

The versioning and compatibility issues raised in this discussion are indeed an problem. But as far as the skew-symmetric routines in BLAS are concerned, I think there is a need to implement them in the reference library, for the following reasons:

a. To maintain a correspondence with the symmetric routines in BLAS. If the symmetric routines are implemented in BLAS while the skew-symmetric ones are placed in LAPACK’s blas-like section, this may hurt structural consistency and may also confuse users who read the code about where to look for them.

b. As things stand, third-party high-performance implementations of BLAS are the foundation for high-performance LAPACK. LAPACK’s blas-like routines lack comparable high-performance implementations. If the skew-symmetric BLAS routines are placed in LAPACK’s blas-like section, the subsequent series of LAPACK skew-symmetric routines will miss the opportunity to benefit from high-performance implementations.

c. Some users only need skew-symmetric matrix-vector/matrix multiplication or rank-2 update operations, and for them a lightweight BLAS library is sufficient; they should not need to pull in LAPACK.

@ilayn

ilayn commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Adding new functionality is not the problem and I think we all want it to move forward and have these. But not thinking about the consequences after the addition is every vendor's problem once something goes in.

Suddenly adding stuff to a calcified library is not without its problems and they need to be communicated thoroughly. Otherwise these issues will be dumped on not just OpenBLAS but also MKL, Accelerate and BLIS and many other vendors commercial or otherwise.

@mohawk2

mohawk2 commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Adding new functionality is not the problem and I think we all want it to move forward and have these. But not thinking about the consequences after the addition is every vendor's problem once something goes in.

Suddenly adding stuff to a calcified library is not without its problems and they need to be communicated thoroughly. Otherwise these issues will be dumped on not just OpenBLAS but also MKL, Accelerate and BLIS and many other vendors commercial or otherwise.

I believe explicit BLAS versioning (#1446) is a good start on such a communication strategy. One of my other projects (PDL) went through a process a couple of years ago of changing from a huge monolith into more, smaller parts. That was a lot of work, but the maintenance and communication benefits were considerable. Perhaps separate releases of reference-BLAS-plus-CBLAS, and reference-LAPACK-plus-LAPACKE, might be contemplated.

@martin-frbg

Copy link
Copy Markdown
Collaborator

Suddenly adding stuff to a calcified library is not without its problems and they need to be communicated thoroughly. Otherwise these issues will be dumped on not just OpenBLAS but also MKL, Accelerate and BLIS and many other vendors commercial or otherwise.

I can only speak for OpenBLAS (at most), but this is going to affect all other implementations, unless they choose to ignore it (at which point it will probably become a mess for FlexiBLAS to sort out).

As far as I'm aware, the original BLAS gained its status as the reference implementation through consultations among interested parties about which fundamental routines should be a part of the library - and similarly, consensus seems to have developed that it was a done thing a few years later. I'm not sure it's entirely warranted to claim this grandfathered reference status for adding new functionality decades later.

And even with added BLAS versioning, it is only going to get worse once new LAPACK routines start to make use of the new BLAS functionality - historically (as far as I'm aware), new BLAS-like helpers got put into LAPACK when&where there was a need for them, which also meant that other implementers could update both at the same time if and when they choose to adopt new LAPACK functionality. Now it seems likely that a future Reference-LAPACK will no longer build against any third-party BLAS, or build with reduced functionality only.

@mohawk2

mohawk2 commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

And even with added BLAS versioning, it is only going to get worse once new LAPACK routines start to make use of the new BLAS functionality - historically (as far as I'm aware), new BLAS-like helpers got put into LAPACK when&where there was a need for them, which also meant that other implementers could update both at the same time if and when they choose to adopt new LAPACK functionality. Now it seems likely that a future Reference-LAPACK will no longer build against any third-party BLAS, or build with reduced functionality only.

That ship has sailed; Apple Accelerate cannot be used as an optimised BLAS by LAPACK 3.12.1, since 3.12.1 needs ?gemmtr, which isn't in Apple Accelerate.

@ilayn

ilayn commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Have a look at the box at the top of the page for the latest and greatest https://developer.apple.com/documentation/accelerate/blas-library about 2026 update.

BLAS/LAPACK version inside accelerate is consistent. Often old but consistent. Because BLAS does not change underneath the LAPACKs. If BLAS starts to move then what @martin-frbg is going start to happen. That is the issue here. If you break the pair with separate versions you break the compatibility of the pair.

What we are trying to emphasize is that without a fallback mechanism this is just going to bring features for some users at the expense of every other user if versions start to diverge in particular if a famous library uses these new features.

I am not against of change, and typically you would find me in the "let's break it at some point" camp. But this is just too much breakage without any planning.

@martin-frbg

Copy link
Copy Markdown
Collaborator

That ship has sailed; Apple Accelerate cannot be used as an optimised BLAS by LAPACK 3.12.1, since 3.12.1 needs ?gemmtr, which isn't in Apple Accelerate.

Well, Intel MKL only gained ?gemmtr in its 2026.2 release last week, although it has had a functionally equivalent ?gemmt extension for years. Doesn't mean that playing rough with the neigbors is a good idea.

Things would be very different if we were talking about a mohawkBLAS or langouBLAS (maybe vibeBLAS or ClaudeBLAS even, going forward) rather than what is still considered the BLAS

@sh-zheng

Copy link
Copy Markdown
Contributor Author

Historically, software compatibility has always been an issue—not just the BLAS and LAPACK. Popular open-source BLAS implementations such as OpenBLAS and BLIS are in a better position; I plan to fill in these new routines for them. Proprietary vendor implementations (Intel MKL, Arm Performance Libraries, etc.) are the main obstacle. Given how widely BLAS is used, it is nearly impossible to discuss change plans with vendors; we can only rely on momentum to encourage them to develop these proactively, if users generally agree that these routines are indeed necessary. Fortunately, the skew-symmetric LAPACK routines to be submitted later involve a fairly large amount of code, and thorough testing and review will take considerable time. This may provide some buffer time.

@martin-frbg

Copy link
Copy Markdown
Collaborator

Historically, software compatibility has always been an issue

Well, you're deliberately breaking an industry standard here

I wonder if at least an effort at communication and/or solicitation of comments could be made, instead of just throwing it in as a change the community has to live with ? There's SC26 coming up, there's HPC.social and probably other online/social media opportunities, even just the netlib pages and this github project site - some 40 years ago, I assume people managed to design BLAS with in-person meetings, phone calls and mailed newsletters. How come it is suddenly all down to one person with write access to a github repository (and I haven't even seen the Langou's comment on this) ?
The alternative would be to remove the "Reference" from the project designation and assume it is just another BLAS-like implementation with somewhat random extensions that the authors deemed useful (or just interesting to implement)

@sh-zheng

Copy link
Copy Markdown
Contributor Author

Well, you're deliberately breaking an industry standard here

I wonder if at least an effort at communication and/or solicitation of comments could be made, instead of just throwing it in

I understand your concerns regarding compatibility. From the discussion, there are valid arguments on both sides as to whether Reference BLAS should evolve or remain stable, and it is difficult to reach a decision at this point. We really do need to hear from others, especially the repository maintainers and vendor developers. Given that some skewsy routines have already been merged into BLAS (but not yet released), if the majority view leans conservative, I will move them from Reference BLAS into LAPACK’s BLAS-like section. This question may need to be settled before the next release.

@mohawk2

mohawk2 commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

I believe it would be a good idea to have a new BLAS Technical Forum. Such a thing might (and I suggest should) be floated at SC26. If there were an agreed process where new BLAS functionality could be discussed and voted on, that seems a good idea.

A model might be https://github.com/Perl/PPCs/blob/main/docs/process.md, although for those who like that sort of thing, the "Python Enhancement Proposal" process might also shed light.

@mohawk2

mohawk2 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

A starting point for an agenda for discussion at this proposed BLAS forum:

[snipped]

Please let's discuss this on the separated #1459, rather than clutter up discussion of @sh-zheng's specific work here :-)

@mohawk2

mohawk2 commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

I've created a new issue, #1459, to discuss a proposed BLAS Technical Forum, and recommend folks participate there.

@sh-zheng

sh-zheng commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Hi dear developers,

This is not an isolated PR; it is a follow-up to PR #1155 . Since PR 1155 has already been merged, if there are no issues with the code in this PR, would it also be considered to merge? If the community reaches a consensus later (keeping conservative), I would then move them out of Reference BLAS as a whole.

This branch has not been deployed

No deployments
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.

4 participants