-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
MersenneTwister: more efficient Float64 scalar generation with caching #25197
Conversation
@nanosoldier |
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan |
105b486
to
a786746
Compare
Nanosoldier still not seeing improvements... let see with the "problem" benchmarks: @nanosoldier runbenchmarks("problem", vs=":master") |
Oups, forgot to quote: @nanosoldier |
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan |
The regressions in Nanosoldier's report are expected: those two problems use the |
I don't think we guarantee the same stream across releases - so it should be perfectly ok to do this if it gives better performance. |
a786746
to
f42ac06
Compare
The performance improvements are confirmed on at least 4 different computers, so I will merge tomorrow unless there are objections. |
f42ac06
to
2839de5
Compare
Like for integers, a cache of size 8016 bytes seems to be optimal.
2839de5
to
4e42436
Compare
We should not change the behavior of the same RNG type across releases, but we are allowed to change default RNGs with minor releases. If we change the stream for MersenneTwister in the future, it would require a major version bump of the package that provides it. |
Do you mean minor releases? (as opposed to "major version bump") |
I guess it depends and it's a choice we have to make. We need to make sure that code can request a specific behavior of an RNG over time, which means that RNGs must be in packages and that one can continue to ask for MersenneTwister |
w.r.t. the comment above about SemVer of RNG, is it possible to recreate the julia 0.6 sequence of random numbers in 0.7/1.0? thanks. |
There is the (registered, I think) |
thanks! |
The is branched off and inspired from #25058. There seem to be a sweet spot at randomizing arrays of size 8016 bytes for dSFMT: beyond this threshold, the generation rate increases, and for
Float64
, this shows a speed-up of about 30% (compared to the currentFloat64
cache size of 3056 bytes, the minimum possible for dSFMT). This again would change the generated streams, so is breaking. Let's see if Nanosoldier agrees this time:@nanosoldier
runbenchmarks("random", vs=":master")