Make nutpie the default nuts sampler (if installed)#8248
Draft
ricardoV94 wants to merge 13 commits intopymc-devs:v6from
Draft
Make nutpie the default nuts sampler (if installed)#8248ricardoV94 wants to merge 13 commits intopymc-devs:v6from
ricardoV94 wants to merge 13 commits intopymc-devs:v6from
Conversation
Documentation build overview
246 files changed ·
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v6 #8248 +/- ##
=====================================
Coverage ? 89.88%
=====================================
Files ? 124
Lines ? 20064
Branches ? 0
=====================================
Hits ? 18035
Misses ? 2029
Partials ? 0
🚀 New features to boost your workflow:
|
c356b69 to
f6ec474
Compare
f4179b5 to
19542dd
Compare
This was referenced Apr 16, 2026
Closed
4643071 to
92c90a9
Compare
3f0ee4d to
e70fd2d
Compare
6b9025d to
ba423ad
Compare
Member
Author
|
testing wise nutpie pins zarr >= 3.0, but pymc zarr use is only compat with < 3.0 |
7a54dc4 to
54d5e6a
Compare
The "A list or tuple of random_seed no longer specifies the specific random_seed of each chain" `UserWarning` was added in Dec 2024 to flag the behavior change during the deprecation window. By now the current behavior (list/tuple treated as an entropy source by `np.random.default_rng`) is well-established, so the warning adds noise without value. `get_random_generator(...).spawn(chains)` keeps consuming multi-seed lists as entropy.
Emit a `FutureWarning` when the caller opts out of `InferenceData`. The long-term plan is to only return `InferenceData`. Existing tests that exercise the deprecated MultiTrace path now assert the warning via `pytest.warns(FutureWarning, match="return_inferencedata=False")`. nutpie can't produce a `MultiTrace`, so the auto-selection gate (in `Default to nutpie`) already routes `return_inferencedata=False` to the pymc sampler.
Also deprecate nuts_sampler_kwargs in favor of the existing per-step
`nuts={...}` kwarg
And make message more clear
JAX is not fork-safe and can deadlock under multiprocessing's fork start method. When a JAX backend is detected and the user has not specified an `mp_ctx`, fall back to `forkserver` (or `spawn`). Warn instead of switch if the user explicitly asked for fork. Applies to both `pm.sample` and `pm.sample_smc`.
Needed until conda-forge ships a nutpie release that supports arviz>=1.0. Until then the conda env can't co-install nutpie and pymc's arviz pin, so we get nutpie via pip-from-git-main in every CI job. Once a compatible nutpie is on conda-forge, drop this commit and put `nutpie>=<that version>` back into `environment-test.yml` and `windows-environment-test.yml`.
54d5e6a to
0a2a4a5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Also adds a
pip install pymc[nutpie]Closes #8079
Closes #8111
Closes #8250
First need to update nutpie to use modern pytensor imports, and more importantly arviz 1.0: pymc-devs/nutpie#297
This will create a bit of a tricky pymc-nutpie circular optional dependency. We have to make sure neither breaks the other before we release. There's also a soft warning machinery now to ask users to update, before we totally remove support for old nutpie functionality/API