Closed j-bryan closed 9 months ago
Some benchmarks for the numpy RNG code and scipy distributions. This compares the results of the current pull request, the current devel branch (982644d0446c6955b3ca004dbcba4736c5a81b70), and the last commit before the distributions were reimplemented in scipy (177725318819492917e2d8e1904f750cc7f2846b). These will be referred to as "feature", "devel", and "previous" here. The tests were run on my 7-year-old Dell XPS laptop.
Benchmark Times: | Test/Function | Branch | RNG | Total Samples | Time (s) |
---|---|---|---|---|---|
randomUtils.random(dim=1, size=1) | feature | numpy | 1000000 | 54.23 | |
randomUtils.random(dim=1, size=1) | feature | crow | 1000000 | 23.17 | |
randomUtils.random(dim=1, size=1) | devel | crow | 1000000 | 31.66 | |
randomUtils.random(dim=1, size=1) | previous | crow | 1000000 | 23.98 | |
- | - | - | - | - | |
randomUtils.random(dim=1000000, size=1) | feature | numpy | 1000000 | 0.02 | |
randomUtils.random(dim=1000000, size=1) | feature | numpy | 1000000 | 0.94 | |
randomUtils.random(dim=1000000, size=1) | feature | numpy | 1000000 | 1.19 | |
randomUtils.random(dim=1000000, size=1) | feature | numpy | 1000000 | 1.27 | |
- | - | - | - | - | |
randomUtils.randomNormal(size=1) | feature | numpy | 1000000 | 92.83 | |
randomUtils.randomNormal(size=1) | feature | crow | 1000000 | 73.61 | |
randomUtils.randomNormal(size=1) | devel | crow | 1000000 | 69.30 | |
randomUtils.randomNormal(size=1) | previous | crow | 1000000 | 65.63 | |
- | - | - | - | - | |
randomUtils.randomNormal(size=1000000) | feature | numpy | 1000000 | 0.53 | |
randomUtils.randomNormal(size=1000000) | feature | crow | 1000000 | 1.75 | |
randomUtils.randomNormal(size=1000000) | devel | crow | 1000000 | 28.08 | |
randomUtils.randomNormal(size=1000000) | previous | crow | 1000000 | 27.44 | |
- | - | - | - | - | |
Distributions.Normal.rvs() | feature | numpy | 10000 | 32.33 | |
Distributions.Normal.rvs() | feature | crow | 10000 | 25.89 | |
Distributions.Normal.rvs() | devel | crow | 10000 | 28.23 | |
Distributions.Normal.rvs() | previous | crow | 10000 | 1.59 | |
- | - | - | - | - | |
Distributions.MultivariateNormal.rvs() (dim=5) | feature | numpy | 10000 | 37.61 | |
Distributions.MultivariateNormal.rvs() (dim=5) | feature | crow | 10000 | 33.83 | |
Distributions.MultivariateNormal.rvs() (dim=5) | devel | crow | 10000 | 1.78 | |
Distributions.MultivariateNormal.rvs() (dim=5) | previous | crow | 10000 | 1.61 | |
- | - | - | - | - | |
tests/framework/MCMC/test_1D.xml | feature | numpy | 80000 | 1827 | |
tests/framework/MCMC/test_1D.xml | devel | crow | 80000 | 1821 | |
tests/framework/MCMC/test_1D.xml | previous | crow | 80000 | 1800 | |
- | - | - | - | - | |
tests/framework/Distributions/test_distributionsGeometric.xml | feature | numpy | 10000 | 230 | |
tests/framework/Distributions/test_distributionsGeometric.xml | devel | crow | 10000 | 232 | |
tests/framework/Distributions/test_distributionsGeometric.xml | previous | crow | 10000 | 231 |
My observations:
randomUtils.BoxMullerGenerator
class on the feature branch provides significant speedups over the previous implementation for both RNG engines.Job Test qsubs sawtooth on ed4a2ce : invalidated by @j-bryan
Python environment timeout on sawtooth
Job Test Ubuntu 18 PIP on 7d63b28 : invalidated by @joshua-cogliati-inl
restarted civet
Job Test qsubs sawtooth on 7d63b28 : invalidated by @j-bryan
sawtooth restart
Job Test qsubs sawtooth on 7d63b28 : invalidated by @joshua-cogliati-inl
FAILED: Diff tests/cluster_tests/test_mpiqsub_long
Job Test qsubs sawtooth on 7d63b28 : invalidated by @joshua-cogliati-inl
Failed with: DirectoryNotACondaEnvironmentError: The target directory exists, but it is not a conda environment.
Pull Request Description
What issue does this change request address? (Use "#" before the issue to link it, i.e., #42.)
2204
What are the significant changes in functionality due to this change request?
Allows for the use of the numpy stochastic environment by default instead of relying on Crow. The new numpy RNG produces outputs identical to the Crow RNG, with the added
NumpyRNG
class providing an equivalent interface as the existingCrowRNG
class.One disadvantage of this approach is that many of the nice functions that the numpy interface provides are not usable while still producing identical output due differences in how the underlying Mersenne Twister RNG engine is used when producing anything but 32-bit integers.
For Change Control Board: Change Request Review
The following review must be completed by an authorized member of the Change Control Board.
<internalParallel>
to True.raven/tests/framework/user_guide
andraven/docs/workshop
) have been changed, the associated documentation must be reviewed and assured the text matches the example.