On 7/6/20 2:47 PM, lloda wrote:
>
> Thanks for all the replies.
>
> I tried disabling the error checking (I was already checking shapes and such separately) and the gemm cases I tried all worked fine and gave the correct result. Zero on either stride or both, on either of the source arguments or both. Then I tried some non-zero strides that result in overlapping that the error checker also rejects (say cs = rs = 1), and those also gave the correct results.
Daniel,
I'm pleased (and a little surprised!) to hear that everything worked as
expected.
>
> The reasons not to support arbitrary strides aren't obvious to me, but of course I only come to BLIS as a user. I hope you reconsider at some point!
You're right to point out that it's not necessarily obvious to other
people! So let me explain.
I designed and wrote BLIS to operate under certain assumptions. One of
those assumptions was that matrices were conventionally stored in either
row-major (rs > 1, cs = 1), column-major (rs = 1, cs > 1), or "general"
format (rs > 1, cs > 1), with the third being like a slice of a 3D
tensor that is orthogonal to its unit dimension. I never contemplated
zero strides for anything beyond a trivial axpyv here or there. That's
not to say it doesn't work (as it appears to, based on your
experimentation) but rather that I never went out of my way to consider
it. I try to be meticulous and methodical about implementing and testing
BLIS, but again, only for the set of inputs I envisioned. If suddenly I
needed to test BLIS for inputs I *didn't* envision, my first instinctual
reaction is one of anxiety. :) So, that's what I meant by "makes me
nervous for obvious reasons."
I will certainly take note of other users asking for "official" zero
stride support. But until then, I would guess that BLIS encountering
zero strides is just as (if not more) likely to indicate a problem than
it is intentional behavior on the user's part. This is another reason
why I would prefer to keep the error checks in place by default while
still allowing more knowledgeable people such as yourself to consciously
disable them.
Please keep in touch, though. If you continue to use this functionality
over time, I may be open to adding a configure-time option that disables
*only* the stride checks. That way, you wouldn't need the runtime call
to disable error checking and you would still have the peace of mind of
having the other error checks enabled.
Field