-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Backends other than NDArray don't work with sequential sampling #2856
Comments
Thanks for reporting @delwaterman. |
@junpenglao Yeah. Same as the other issue #2801 copying the trace when running on 1 core for every new chain will fix this error. The same trace is being reused (which can be confirmed by Again just like the other issue, this will fix the error. https://github.com/pymc-devs/pymc3/blob/master/pymc3/sampling.py#L501
|
In this case, since it is hard to see a workaround just creating a |
Yeah, deepcopy will fix the issue but it will also give the performance a big hit. |
Okay. I will ponder a bit more on alternates to deepcopy if possible for SGFS and subsequently update the other #2801 PR One question about this issue. For folding one trace backend into two or more, would require modification to the BaseTrace class. Is that what you are referring to ? Just want to think about the expected change in the code. |
Actually, probably not a good idea to folding one long trace into more, see this discussion. |
@junpenglao Isn't the initialize point the same for all chains in pymc3 ?
that's the reason for not doing one long chain in the thread |
The default 'jitter+adapt_diag' gives different starting point, but I think in general the starting point is always the |
Okay, makes sense. I think I can start a PR with a 'jitter' by default in pm.sample, and then follow up with another PR that fixes this issue and Issue handled in PR #2801 for njobs=1 and chains > 1 situation. Let me know your thoughts, and whether that plan makes sense. |
That sounds good to me! |
Also, just some related ideas:
|
@junpenglao If the #2876 PR is in master, it solve the first part of the problem which is jittering the start points of the chains. Then I will only need to implement multiple independent chains when cores=1. This issue thus I can completely resolve the #2801 PR |
Hi all, sorry to revive this issue, but I wanted to see if it was ever officially resolved. I'm attempting to do some sequential sampling and just ran into this problem today. Was this ever fully fixed, or are workarounds still required? Thanks so much! |
Hi @cgatno - we are actually planning on deprecating non in-memory backends. Perhaps we could open a new issue to provide support for sequential sampling? @aloctavodia |
Hey @ColCarroll, thanks for the update! It looks like there are some suggestions for best practices to save/export data in the issue you linked. I'll see if any of these work for the sequential sampling case and provide an update there. |
Toy example of Backends does not work with default chains
While trying to use a toy example to test out Backends for PyMC3 3.3, I found that none of the backends (except the default in memory one) work with multiple chains:
Normal works:
Text Backend Fails:
SQLite Fails:
HDF5 Fails:
When I tried using a single chain it worked correctly for all three.
Versions and main components
The text was updated successfully, but these errors were encountered: