Closed
Description
This happens because ADVI compiles a function from the model RandomVariables which depend on shared RandomState/Generator variables that are updated in place and not reset.
There is currently no easy way to reseed these shared variables. There used to be something like this at some point in the V4 refactor, but it's gone. Probably it will be reintroduced by whatever fixes #5733.
This is also a limitation in prior and posterior predictive, as those functions can only be resampled with the same results if a whole Model
is recreated with the original rng_seeder
. This is "less of a problem" because those functions explicitly raise if a user tries to pass seeds, whereas these are still supported in sampling
.