Skip to content
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

PRNG determinism #5

Open
jmason42 opened this issue Dec 19, 2018 · 4 comments
Open

PRNG determinism #5

jmason42 opened this issue Dec 19, 2018 · 4 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@jmason42
Copy link
Contributor

We need all implementations to be deterministic. With any sort of compiled approach (JIT, Cython) this is challenging.

It's particularly tricky to support determinism with the single-step approach (as opposed to evaluating to some time point) with compilation since jumping in and out of compiled code while maintaining a PRNG state is difficult or impossible. I'm inclined to suggest that the step-based procedure should be handled via a class or generator function, while the run-until procedure should be handled by a separate function entirely, with the expectation that the two will not lead to the exact same results.

@jmason42 jmason42 added enhancement New feature or request question Further information is requested labels Dec 19, 2018
@prismofeverything
Copy link
Member

After doing some more tests with numba I was getting results where the jit compiled code was taking longer than the uncompiled code (10s vs 25s for the same simulation). I will make a new issue for it, but for now I am leaning to keeping this uncompiled, both for this reason and to avoid nondeterminism with RNG.

@jmason42
Copy link
Contributor Author

That's troubling. If you have a working example, I can poke around. It's possible that it was only compiling the already fast parts.

@prismofeverything
Copy link
Member

Yeah I actually removed the numba parts, but it should be easy enough to put back in to test. I also had a few problems with compilation, for instance the list comprehension threw some kind of "This error should not happen" deep in the numba code, but works with map? Kind of funny. Now that I think about it I should have written all this down, but I was moving fast and just stripped it out instead with the intention that I would try it again later.

@jmason42
Copy link
Contributor Author

A separate resource for Numba friction points would be tremendously helpful. There's not a lot out there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants