-
Notifications
You must be signed in to change notification settings - Fork 2
Don't use @assert
, and print some debugging info if C
is not approximately equal to reference
#47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…oximately equal to `reference`
) where {F} | ||
maybe_sleep(sleep_time) | ||
t0 = @elapsed f!(C, A, B) | ||
isnothing(reference) || @assert C ≈ reference | ||
if (reference !== nothing) && (!(C ≈ reference)) | ||
msg = "C is not approximately equal to reference" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reference is the first of the libraries passed to runbenchmark
, so perhaps the order does matter -- we should trust that the reference is correct.
When we get this error, we know either the ref or lib
is wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not quite sure what you mean. Can you elaborate on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see what you mean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we instead just always use LinearAlgebra.mul!
to compute the reference C0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That could take potentially many extra seconds at larger sizes, and do we trust it more than BinaryBuilder OpenBLAS or MKL (or BLIS)?
The time issue would be major when it's integers, and mul!
calls the generic matmul.
I guess it'd be nice to always know what the reference is, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point. Hmmm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep the current behavior for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Feel free to merge when ready. |
Fixes #46
Also, if
C !≈ reference
, we print some info (the name of the library, as well as the values ofM
,K
, andN
) to help with debugging.