-
Notifications
You must be signed in to change notification settings - Fork 449
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add NaN propagation and array initialization notes to ?GEMM docs #1098
base: master
Are you sure you want to change the base?
Conversation
May I suggest a less if, else language such as
This is more to the point and explains the mechanism instead of enumerating rules. I don't claim a command on English but this reads easier to me. |
Thanks for the suggestion, I am of course open to refining the wording based on feedback. Your version changes the meaning slightly, because "A and B are not referenced" would imply a no-touch-guarantee (no reads, no writes to any array element), which is something I do not want to include in the BLAS specification. Such a guarantee would permit A and B to not only contain arbitrary values, but also to not even be allocated. Hypothetically, that could be untrue for some other BLAS implementations, eg. hardware vendor optimized BLAS libraries. I guess this could also happen with the NaN propagation quirks I am adding, since the spec has been silent on this until now, but I would rather not make this change any more invasive than it needs to be. |
On a third reading, some of the conditions in the quirks list were redundant, so I have simplified that. |
That's a standard LAPACK/BLAS wording that can be found in many routine specifications. See for example |
I see. The reference BLAS implementation does of course satisfy the stronger guarantee of not referencing the arrays, and I would actually be happy to demand it in the spec, but since this is not coordinated with other BLAS implementations, I minimized the amount that implementation freedom is restricted by the spec change. |
I would be interested to hear more opinions on this. |
Description
This PR fixes and closes #1077 and:
ALPHA
arguments:A
arguments fromarray A must contain the matrix A.
to:B
arguments fromarray B must contain the matrix B.
to:BETA
arguments fromWhen BETA is supplied as zero then C need not be set on input.
to:
C
arguments fromarray C must contain the matrix C, except when beta is zero, in which case C need not be set on entry.
to:
This documents/clarifies existing behaviour without adding anything to the docs that might hypothetically clash with the behaviour of some optimized BLAS implementation. (eg. I have decided against adding no-touch-guarantees to A, B and C, so a conforming implementation might still read data from them, as long as it does not affect the output)
Checklist