-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Seeding ensemble problems #421
Comments
rng management and seeding is a bit of a mess in general. Here we pass You can see what we do for SSAStepper here: JumpProcesses.jl/src/SSA_stepper.jl Lines 152 to 173 in d0dff65
If you are in serial Probably we are in need of some kind of uniform SciML-wide approach for handling and storing user-selected rngs that all these libraries could query and use in a common manner. |
@ChrisRackauckas would creating a SciML rng interface that works across serial/parallelism modes make sense as a small grant project? Or is it too complicated to expect someone to tackle in that context? |
Thanks for the explanation! For reproducibility purposes I think it would be nice to have a consistent RNG interface, amusingly, I only needed to set seeds to debug some weird threading behaviour. Would passing a RNG to Ideally the threading mode should not affect results, so |
To make passing via |
There is an issue for this over at DiffEq, however, it hasn't really gotten any traction: SciML/DifferentialEquations.jl#1034 |
A problem with that approach, i.e. user generated per thread/process seeds, is that it isn’t how all (many?) parallel rngs are designed to work. For example, some generators handle setting up uncorrelated streams from a single global seed and knowing the process/thread id. Having users select and pass per thread seeds could actually result in correlated streams for some generators. (Note, I don’t actually know the recommended way of using the default Julia generator when multi-threading as that is an uncommon workflow for me.) |
I think I am relatively agnostic to the actual implementation (as I don't know anything about it), but like @kaandocal I think there is a feature here that should be implemented somehow (possibly using new/old options). |
Probably too complicated.
Yes but you'd still want to do it on the prob in the prob_func because otherwise the whole ensmble would have the same seed. |
I have been going through the code & documentation of
JumpProcesses
in order to find out how to set up reproducible (RNG seeded) ensemble runs. The following snippet yields the same output each time, as intended:If I replace
EnsembleSerial
byEnsembleThreads
, the outputs stop being reproducible.I am aware that
JumpProblem
seems to have anrng
field, so one naive solution would be to use theprob_func
argument toEnsembleProblem
andremake
the jump problem with a different seed for each trajectory. That is not directly possible sinceremake
does not accept aseed
orrng
argument, so I currently recreate theJumpProblem
from scratch (which is less than ideal).There might be a solution to this online, but I haven't found anything, which seems surprising. Is there any better (intended) way of doing this?
The text was updated successfully, but these errors were encountered: