Skip to content

Add IBLAVER to BLAS - #1446

Merged
ACSimon33 merged 3 commits into
Reference-LAPACK:masterfrom
mohawk2:iblaver
Nov 16, 2026
Merged

ACSimon33 merged 3 commits into
Reference-LAPACK:masterfrom
mohawk2:iblaver

Conversation

@mohawk2

@mohawk2 mohawk2 commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Description

As discussed on #1420, this adds IBLAVER to BLAS, allowing independent tracking of the version of BLAS from its "parent" LAPACK.

From the Fortran side, it implements:

  • IBLAVER

In C:

  • cblas_iblaver

I have based this off the branch in #1407 since there are overlapping areas of config touched, so that will need merging first.

Checklist

  • The documentation has been updated.
  • If the PR solves a specific issue, it is set to be closed on merge.

@codecov

codecov Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.25000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.23%. Comparing base (49b9308) to head (57f483e).
⚠️ Report is 2 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
CBLAS/src/cblas_iblaver.c 40.00% 6 Missing and 3 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1446   +/-   ##
=======================================
  Coverage   70.22%   70.23%           
=======================================
  Files        6237     6239    +2     
  Lines      500983   501031   +48     
  Branches    23536    23540    +4     
=======================================
+ Hits       351836   351875   +39     
- Misses     148685   148691    +6     
- Partials      462      465    +3     
Components Coverage Δ
BLAS 99.73% <100.00%> (+<0.01%) ⬆️
CBLAS 96.95% <40.00%> (-0.16%) ⬇️
LAPACK 83.64% <ø> (ø)
LAPACKE 2.17% <ø> (ø)
TMGLIB 55.69% <ø> (ø)
BLAS testing 88.79% <100.00%> (+0.01%) ⬆️
CBLAS testing 89.65% <100.00%> (+<0.01%) ⬆️
LAPACK testing 82.40% <ø> (ø)
LAPACKE testing ∅ <ø> (∅)
Files with missing lines Coverage Δ
BLAS/SRC/iblaver.f 100.00% <100.00%> (ø)
BLAS/TESTING/cblat1.f 92.82% <100.00%> (+0.03%) ⬆️
BLAS/TESTING/cblat2.f 85.50% <100.00%> (+0.01%) ⬆️
BLAS/TESTING/cblat3.f 90.98% <100.00%> (+<0.01%) ⬆️
BLAS/TESTING/dblat1.f 93.39% <100.00%> (+0.02%) ⬆️
BLAS/TESTING/dblat2.f 85.39% <100.00%> (+0.01%) ⬆️
BLAS/TESTING/dblat3.f 89.46% <100.00%> (+0.01%) ⬆️
BLAS/TESTING/sblat1.f 94.24% <100.00%> (+0.01%) ⬆️
BLAS/TESTING/sblat2.f 85.39% <100.00%> (+0.01%) ⬆️
BLAS/TESTING/sblat3.f 89.46% <100.00%> (+0.01%) ⬆️
... and 5 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 49b9308...57f483e. Read the comment docs.

langou
langou previously approved these changes Oct 25, 2026

@langou langou left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the work and the pul request. Note: It might have been preferrable to have two pull requests instead of one. One pull request with IBLAVER and one pull request with XERBLA_BLAS.

@mohawk2

mohawk2 commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the work and the pul request. Note: It might have been preferrable to have two pull requests instead of one. One pull request with IBLAVER and one pull request with XERBLA_BLAS.

@langou There are two separate pull requests. This one, and #1407, as noted in the initial PR? Should I have spelled that out in a different way?

@ACSimon33
ACSimon33 marked this pull request as draft October 27, 2026 15:59
@ACSimon33

Copy link
Copy Markdown
Collaborator

I converted this to a draft, so that it doesn't get merged by mistake until #1407 is merged.

@langou

langou commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

@ACSimon33 "I converted this to a draft, so that it doesn't get merged by mistake until #1407 is merged."

Thanks this is useful. This helps.

@mohawk2 "@langou There are two separate pull requests. This one, and #1407, as noted in the initial PR? Should I have spelled that out in a different way?"

No, you were clear with your initial "I have based this off the branch in #1407 since there are overlapping areas of config touched, so that will need merging first." That was quite clear.

Having the PR as a draft helps even more.

Thanks to both.

@mohawk2

mohawk2 commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

@langou I'm thinking more about this, and I'm starting to think it would be valuable to have another value, VENDOR. That would return 0 for reference BLAS, and other values to be determined, possibly recorded in my proposed registry.

@mohawk2
mohawk2 force-pushed the iblaver branch 3 times, most recently from 389561a to 3800b5d Compare November 4, 2026 17:34
@mohawk2
mohawk2 marked this pull request as ready for review November 4, 2026 17:35
@mohawk2

mohawk2 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@ACSimon33 @langou Thank you for looking at this previously. I've now marked it as ready. I added a "library ID" parameter, which is an update of the idea of "vendor", since at least AMD and nVidia have put out more than one library each.

My thinking so far is that for the library number, it's a 32-bit integer. The first half would allow for 65536 vendors, and the second half would allow each to put out 65536 different libraries. That feels like the right amount of future-proofing.

@martin-frbg

Copy link
Copy Markdown
Collaborator

I'm not sure I understand the reasoning between the vendor/library number - wouldn't it suffice to have a flag telling whether this is the Reference BLAS or not ? Everything beyond that opens a huge can of worms IMHO - firstly you'd need others to accept your new idea of IBLAVER, secondly who assigns the numbers and manages the resulting registry, thirdly is this registration going to be mandatory for any BLAS-like library (or fork thereof) anywhere in the world ?

@mohawk2

mohawk2 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

I'm not sure I understand the reasoning between the vendor/library number - wouldn't it suffice to have a flag telling whether this is the Reference BLAS or not ? Everything beyond that opens a huge can of worms IMHO - firstly you'd need others to accept your new idea of IBLAVER, secondly who assigns the numbers and manages the resulting registry, thirdly is this registration going to be mandatory for any BLAS-like library (or fork thereof) anywhere in the world ?

@martin-frbg That can of worms already exists. As currently implemented here, 0 is reference and therefore can be interpreted as a flag. Having it be INTEGER allows more meaning than a LOGICAL, even though none of the numbers have inherent semantic meaning, same as for ILAVER.

@martin-frbg

Copy link
Copy Markdown
Collaborator

Sorry, but I don't feel that this addresses my question when the "already exists" is all in your PR and I'd like to understand where you're heading with this. Maybe this has all been discussed in private, but I'm not privy to such discussion and all i see is an anonymous perl contributor getting ahead of himself ?

@mohawk2

mohawk2 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Sorry, but I don't feel that this addresses my question when the "already exists" is all in your PR and I'd like to understand where you're heading with this. Maybe this has all been discussed in private, but I'm not privy to such discussion and all i see is an anonymous perl contributor getting ahead of himself ?

Oh dear.

When I say "it already exists" - what version number do you think OpenBLAS should put in there?

@ACSimon33

ACSimon33 commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

I get both sides here. On one hand we already have vendor libraries that already lack some routines that reference BLAS provides and there is precedent where new things were added. On the other we as the ones that create this reference should also not take this an argument to extend BLAS all the time, at least not with a very good reason.

I think the BLAS versioning is definitely a very good addition to the standard. That part could be merged already since it was agreed upon in #1420.

The vendor number needs a bit more discussion I think and could be a topic of the BLAS forum you mentioned in #1459. The main issue I see at the moment is the actual use of this number. What we want to accomplish is that we can easily determine which API a certain BLAS library provides. That functionality is fully covered by the version number, I think. So I don’t see any immediate use cases for the vendor number at the moment.

@mohawk2

mohawk2 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

I get both sides here. On one hand we already have vendor libraries that already lack some routines that reference BLAS provides and there is precedent where new things were added. On the other we as the ones that create this reference should also not take this an argument to extend BLAS all the time, at least not with a very good reason.

I think the BLAS versioning is definitely a very good addition to the standard. That part could be merged already since it was agreed upon in #1420.

The vendor number needs a bit more discussion I think and could be a topic of the BLAS forum you mentioned in #1459. The main issue I see at the moment is the actual use of this number. What we want to accomplish is that we can easily determine which API a certain BLAS library provides. That functionality is fully covered by the version number, I think. So I don’t see any immediate use cases for the vendor number at the moment.

Fair enough. What version number should OpenBLAS return?

@ACSimon33

Copy link
Copy Markdown
Collaborator

OpenBLAS exports all reference BLAS symbols of 3.12.1. So it should report that. When we release 3.13.0 (hopefully soon), it should stay at 3.12.1 until the ?skewsy* routines are added.

The same holds for MKL, AOCL, and BLIS. Apple Accelerate should report 3.12.0, since ?gemmtr are missing.

@martin-frbg

Copy link
Copy Markdown
Collaborator

Might wait and see if any of the other implementations adopt this... I still maintain that shoehorning entirely new functions into 3.13+ without an attempt at industry-wide consensus would make 3.12 the last actual Reference BLAS release (in the sense of preserving the agreed-on "legacy" BLAS standard while applying minor bug fixes).

(I see GEMMT(R) AXPBY etc. as more of a gray area, as at least there's the 2001 BLAS Technical Forum report giving them credibility, though there seemingly never was a Reference-BLAS(T) implementation comparable to Reference-BLAS, and apparently everybody just went on their ways. Maybe it would be worthwile starting there, unless the goal is simply to have yet another BLAS-like library with private extensions that some will find useful ?)

@mohawk2

mohawk2 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor Author

OpenBLAS exports all reference BLAS symbols of 3.12.1. So it should report that. When we release 3.13.0 (hopefully soon), it should stay at 3.12.1 until the ?skewsy* routines are added.

The same holds for MKL, AOCL, and BLIS. Apple Accelerate should report 3.12.0, since ?gemmtr are missing.

So your approach is that it's "what version of reference LAPACK's co-released BLAS API does this implementation support"? I think I could get behind that.

If so, then a library-identifier could move to a separate routine. There's no important reason for that to be numerical, and passing in a string buffer to be filled could look like this:

module string_c_util_mod
    use, intrinsic :: iso_c_binding, only: c_char, c_null_char
    implicit none
contains
    subroutine generate_c_string(out_buffer, out_len)
        character(kind=c_char, len=*), intent(out) :: out_buffer
        ! total written characters (including NUL)
        integer,                       intent(out) :: out_len
        character(kind=c_char, len=:), allocatable :: local_data
        local_data = "Idiomatic C-String Data"
        out_len = min(len(local_data) + 1, len(out_buffer))
        if (out_len > 1) then
            out_buffer(1:out_len-1) = local_data(1:out_len-1)
        end if
        out_buffer(out_len:) = c_null_char
    end subroutine generate_c_string
end module string_c_util_mod

program main
    use string_c_util_mod
    implicit none
    ! Allocate fixed memory buffer
    character(len=12) :: my_buffer
    integer           :: actual_written
    call generate_c_string(my_buffer, actual_written)
    print *, "Total Length (with NUL): ", actual_written
    print *, "Fortran Content View:    [", my_buffer(1:actual_written-1), "]"
end program main

@ACSimon33

Copy link
Copy Markdown
Collaborator

@mohawk2 I suggest moving the library ID discussion to a new issue and keeping this PR limited to the originally discussed IBLAVER, which has the same signature as ILAVER.

@langou

langou commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Let us keep it at IBLAVER for this pull request. I like the { which BLAS ( implementation ) / ( vendor library ) / ( backend ) I am currently using } too, but I agree this should be pushed to (1) later discussions, and (2) another subroutines, and (3) another pull request / thread.

IBLAVER would tell us what the library contains based on a version number that we hopefully all agree. I can see plenty of good use for this. For some folks which implementation they use does not matter much. They just want to make sure they use the correct version of the BLAS.

Then it would be nice to have a way to know the { which BLAS library I am currently using }. VENDOR sounds good enough. Julia has a BLAS.vendor(). Always a little reticent with VENDOR since it can be the reference version, open source, developed by single individual, etc. or indeed a vendor library, so we can fiddle with the name. But fine. BACKEND could work for me (used by numpy). I like "implementation" but I am not sure this is much used. Any of these would work for me. I see there is not 100% support so we should move this to another thread.

So your approach is that it's "what version of reference LAPACK's co-released BLAS API does this implementation support"? I think I could get behind that.

+1 here too

@mohawk2

mohawk2 commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

@ACSimon33 @langou Updated to return the BLAS API version, with docs updated accordingly.

@mohawk2 mohawk2 mentioned this pull request Nov 7, 2026
2 tasks done
@mohawk2

mohawk2 commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

I've implemented GET_{BLAS,LAPACK}_LIBNAME in #1481, with a branch starting from this one. It's marked as draft to avoid confusion, but has a hyperlink in the description to review just the changes in that PR should anyone be interested.

@mohawk2
mohawk2 force-pushed the iblaver branch 2 times, most recently from 7b9df28 to 23aae4e Compare November 8, 2026 03:11
@mohawk2

mohawk2 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

I made the change requested. Is there anything else needed?

Edit: I have rebased this past the CI expansion from @ACSimon33 (including the SET_XERBLA-related adjustment for nagfor) so it can be run against the even bigger CI.

@ACSimon33
ACSimon33 merged commit 12612ec into Reference-LAPACK:master Nov 16, 2026
56 checks passed
@mohawk2
mohawk2 deleted the iblaver branch November 19, 2026 14:27
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