-
Notifications
You must be signed in to change notification settings - Fork 9
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
benchmark results oscillate #79
Comments
Very interesting. Thank you for reporting even though it is hard to reproduce. My initial guess is that this is that this is due to a random slowdown causing the autotuner to pick a significantly too low number of evaluations, which results in a longer reported runtime. This is something that both Chairmarks and BenchmarkTools are susceptible to, but Chairmarks more so due to less time spent tuning. One possible solution is to verify that the tuning was reasonable using the final estimated runtime, and retry if not. However, after a fair bit of experimentation, the closest I could get to reproducing this is
Which is totally inconsistent with that hypothesis. What do you get when you change |
This seems suspicious and related: julia> for _ in 1:10
v = zero(SVector{1,Int16});
x = @be $v == $v seconds=.003
println(sum(s -> s.time*s.evals, x.samples) / .003) # Efficiency
end
0.005333333333333334
0.6315463333333339
0.9134653333333339
0.8869929999999999
0.8970749999999997
0.8211156666666665
0.8458399999999997
0.9160763333333332
0.7899360000000001
0.959712333333333 Perhaps it is because compile time is counted against the runtime budget resulting in significantly fewer samples being taken |
Note that for |
Very strange. This is inconsistent with both the compile time idea and the tuning idea. To confirm that it is not tuning-related, what if you add keywords
|
Now I almost always get the larger value for
|
wtf. Benchmarking is hard. I have no idea. What if you put it in a function?
and then |
Maybe this cannot be debugged ... |
I wonder if @jrevels has any ideas, seeing how this effects both BenchmarkTools and Chairmarks. |
If you take out the call to BenchmarkTools are the Chairmark results still slow?
And then |
Yes, still slow with |
I wish I could reproduce this on my machine, that would make debugging easier. I've tried unsuccessfully on
|
I'm guessing this is due to hardware quirks. I'm going to close this as not actionable because
|
In this example, the timings returned by
@b
oscillate between two values, one of which agrees with@btime
:I only get this on my laptop, not on another machine.
versioninfo()
for my laptop:Packages:
Addition: For
@btime
I once got the higher number when I ran the benchmark for the first time:but I cannot reproduce this.
The text was updated successfully, but these errors were encountered: