Repository navigation
Add IBLAVER to BLAS - #1446
Add IBLAVER to BLAS#1446
IBLAVER to BLAS#1446Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ 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
Continue to review full report in Codecov by Harness.
|
a700ca8 to
5705bab
Compare
langou
left a comment
There was a problem hiding this comment.
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? |
|
I converted this to a draft, so that it doesn't get merged by mistake until #1407 is merged. |
e2ddffb to
42c9ce7
Compare
|
@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. |
|
@langou I'm thinking more about this, and I'm starting to think it would be valuable to have another value, |
389561a to
3800b5d
Compare
|
@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. |
|
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 |
|
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? |
|
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? |
|
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 The same holds for MKL, AOCL, and BLIS. Apple Accelerate should report 3.12.0, since |
|
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 ?) |
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 |
|
@mohawk2 I suggest moving the library ID discussion to a new issue and keeping this PR limited to the originally discussed |
|
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.
+1 here too |
|
@ACSimon33 @langou Updated to return the BLAS API version, with docs updated accordingly. |
|
I've implemented |
7b9df28 to
23aae4e
Compare
|
I made the change requested. Is there anything else needed? Edit: I have rebased this past the CI expansion from @ACSimon33 (including the |
Description
As discussed on #1420, this adds
IBLAVERto BLAS, allowing independent tracking of the version of BLAS from its "parent" LAPACK.From the Fortran side, it implements:
IBLAVERIn C:
cblas_iblaverI have based this off the branch in #1407 since there are overlapping areas of config touched, so that will need merging first.Checklist