Best practice for parallel model selection, especially avoidance of recompilation

Hey, @lucidfrontier45!

I am not sure if you can avoid recompilation if you are changing your priors. Hopefully someone else can chime in on that specific part.

I do know that if you have a model that isn’t changing, then you can avoid recompilation if you are using the same model on multiple datasets.

To do that, you have to use nutpie’s native API.

For example, if you have a model named model coded up how you typically code up a PyMC model using a context manager. You would then need to compile the model like this:

compiled_pymc_model = nutpie.compile_pymc_model(model) and then you can sample using:
idata = nutpie.sample(compiled_pymc_model)

Then when you want to update the data without recompiling the model you can do:

updated_pymc_model = compiled_pymc_model.with_data(**dictionary_object_with_your_new_data)

and then you can sample again like above using the newly updated_pymc_model object.

EDIT:
Also, just curious, how long of a compilation time are we talking about here? It really shouldn’t take more than a few seconds to compile. Do you have any loops inside of your model?