You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it is best to keep the BLAS behavior as it is. I consulted with a few other folks by email and (at least) three other persons agree that it is best to keep the BLAS behavior as it is. Arguments being: "It's essentially impossible to change those documented semantics of BLAS gemv, since any change would have to be agreed to and propagated through all the vendor libraries" and this is a "classical and well-documented behavior".
For now, I am closing the comment and the PR. I do see that there is a disagreement on what to do since there were three initial thumbs up on the initial PR.
All in all, it is great that you are willing to change the library and propose a PR for it. But I think, for this change, it is best to leave the code as is.
Thank you for your answer. Maybe the "wrong" part in this case is not the behavior of the subroutines, but the documentation. In all of them the docs say referred to the matrix dimensions "must be at least zero", also the doc for MKL and ESSL BLAS. The question is then how behave MKL and ESSL in this situation, but I suppose in the same way as the reference BLAS. I've inspected the code in MAGMA and it works in the same way, i.e., if (m <= 0 || n <= 0) return;. OpenBLAS present the same behavior, as well as ATLAS.
My understanding was that ATLAS is not active any longer and is now moved to OpenBLAS. But I am not 100% sure. I am surprised that there was a commit in 2019 for ATLAS. I was assuming that the project was long not maintained any more. So I think you want to look at OpenBLAS.
The question is then how behave MKL and ESSL in this situation, but I suppose in the same way as the reference BLAS. I've inspected the code in MAGMA and it works in the same way, i.e., if (m <= 0 || n <= 0) return;. OpenBLAS present the same behavior, as well as ATLAS.
Testing several BLAS libraries, I found gemv in OpenBLAS and MKL did not scale y when n = 0. With macOS Accelerate, the Fortran API gemv did not scale y, but cblas_Xgemvdid scale y (inconsistent with documented behavior).
Maybe the "wrong" part in this case is not the behavior of the subroutines, but the documentation. In all of them the docs say referred to the matrix dimensions "must be at least zero", also the doc for MKL and ESSL BLAS.
Ah. Thanks. Yes, the documentation could be fixed. Good point.
Maybe the "wrong" part in this case is not the behavior of the subroutines, but the documentation. In all of them the docs say referred to the matrix dimensions "must be at least zero", also the doc for MKL and ESSL BLAS.
Ah. Thanks. Yes, the documentation could be fixed. Good point.
Maybe a note with something like "if M or N are 0, the function does nothing"
Activity
jgpallero commentedon Jan 23, 2023
Hi,
there are also affected the subroutines xGBMV, xSBMV, xSPMV, and xSYMV
langou commentedon Jan 23, 2023
Hi @jgpallero and @bE554357, @akobotov also gave a thumbs up,
I think it is best to keep the BLAS behavior as it is. I consulted with a few other folks by email and (at least) three other persons agree that it is best to keep the BLAS behavior as it is. Arguments being: "It's essentially impossible to change those documented semantics of BLAS gemv, since any change would have to be agreed to and propagated through all the vendor libraries" and this is a "classical and well-documented behavior".
For now, I am closing the comment and the PR. I do see that there is a disagreement on what to do since there were three initial thumbs up on the initial PR.
All in all, it is great that you are willing to change the library and propose a PR for it. But I think, for this change, it is best to leave the code as is.
cheers,
Julien.
jgpallero commentedon Jan 23, 2023
Thank you for your answer. Maybe the "wrong" part in this case is not the behavior of the subroutines, but the documentation. In all of them the docs say referred to the matrix dimensions "must be at least zero", also the doc for MKL and ESSL BLAS. The question is then how behave MKL and ESSL in this situation, but I suppose in the same way as the reference BLAS. I've inspected the code in MAGMA and it works in the same way, i.e.,
if (m <= 0 || n <= 0) return;. OpenBLAS present the same behavior, as well as ATLAS.[OFFTOPIC]
And talking about ATLAS, anyone knows what is the current status of the project? The last commit in https://github.com/math-atlas/math-atlas was in 2019
langou commentedon Jan 23, 2023
My understanding was that ATLAS is not active any longer and is now moved to OpenBLAS. But I am not 100% sure. I am surprised that there was a commit in 2019 for ATLAS. I was assuming that the project was long not maintained any more. So I think you want to look at OpenBLAS.
langou commentedon Jan 23, 2023
Yes. I want to point to: https://github.com/tlapack/testBLAS. In this software, @weslleyspereira is trying to check BLAS libraries. These corner cases are in. Yes, most current libraries are following the convention as set by the reference BLAS.
mgates3 commentedon Jan 23, 2023
Note that
gemmhas different semantics: if k = 0, it still scales the C matrix. This isn't in the manpage, but it is in the 1990 paper (https://doi.org/10.1145/77626.79170) and reference code, and appears to work with OpenBLAS, MKL, and Accelerate. So a user could useinstead of
mgates3 commentedon Jan 23, 2023
Testing several BLAS libraries, I found
gemvin OpenBLAS and MKL did not scaleywhen n = 0. With macOS Accelerate, the Fortran APIgemvdid not scaley, butcblas_Xgemvdid scaley(inconsistent with documented behavior).whereas with MKL:
langou commentedon Jan 23, 2023
Ah. Thanks. Yes, the documentation could be fixed. Good point.
martin-frbg commentedon Jan 23, 2023
I'd read that as "must be at least zero to avoid raising an error " ?
jgpallero commentedon Jan 23, 2023
Maybe a note with something like "if M or N are 0, the function does nothing"
jgpallero commentedon Jan 23, 2023
I'm sure this was the original idea
langou commentedon Jan 23, 2023
I agree with @martin-frbg. I think the comments are fine then.
Yes, we can add
If M or N are 0, the function performs a quick return.bE554357 commentedon Jan 24, 2023
Now it's hard to localize error in$\mathbf{y}$ misscale?
gemvwhile debugging. Is it possible to callxerblafor cases of