Skip to content

Commit

Permalink
Allow for passing of backend and gradient_backend to nutpie (#7535)
Browse files Browse the repository at this point in the history
* Allow for passing of backend and gradient_backend to nutpie

* Extract nutpie compiler args explicitly
  • Loading branch information
fonnesbeck authored Oct 11, 2024
1 parent c61e9cd commit 5352798
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pymc/sampling/mcmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,14 @@ def _sample_external_nuts(
"`var_names` are currently ignored by the nutpie sampler",
UserWarning,
)
compiled_model = nutpie.compile_pymc_model(model)
compile_kwargs = {}
for kwarg in ("backend", "gradient_backend"):
if kwarg in nuts_sampler_kwargs:
compile_kwargs[kwarg] = nuts_sampler_kwargs.pop(kwarg)
compiled_model = nutpie.compile_pymc_model(
model,
**compile_kwargs,
)
t_start = time.time()
idata = nutpie.sample(
compiled_model,
Expand Down

0 comments on commit 5352798

Please sign in to comment.