Skip to content

Conversation

@penelopeysm
Copy link
Member

No description provided.

@github-actions
Copy link
Contributor

AdvancedHMC.jl documentation for PR #471 is available at:
https://TuringLang.github.io/AdvancedHMC.jl/previews/PR471/

@penelopeysm
Copy link
Member Author

Ack, have to fix CI for 1.12.

@penelopeysm
Copy link
Member Author

I ran the tests locally and it's only JET that's failing, so I'll open a separate issue for that.

@penelopeysm penelopeysm merged commit dc8dc1c into main Oct 31, 2025
10 of 19 checks passed
@penelopeysm penelopeysm deleted the py/getstats branch October 31, 2025 23:42
penelopeysm added a commit to TuringLang/Turing.jl that referenced this pull request Nov 5, 2025
Following on from:

- TuringLang/AbstractMCMC.jl#182 Adding the
interface function `AbstractMCMC.getstats`
- TuringLang/AdvancedHMC.jl#471 and
TuringLang/AdvancedMH.jl#119 Implementing them
for AdvancedHMC and AdvancedMH

this PR changes Turing's external sampler interface to exclusively use
AbstractMCMC functions. **With this PR, anyone who defines an external
sampler will only need to depend on AbstractMCMC (which they presumably
already do, because it is a sampler) and LogDensityProblems (which is
already a dep of AbstractMCMC).** No need for a Turing extension.

To be precise, it makes the following changes:

- Previously where one had to define `Turing.Inference.getparams`, now
one has to define `AbstractMCMC.getparams`.
- Previously there was no way to include sampler stats in the resulting
chain, now one can define `AbstractMCMC.getstats`.
- The default for `Turing.Inference.isgibbscomponent` is changed to
`true`, so that external sampler packages don't need to override it
(unless absolutely necessary).

As an example implementation, this PR contains a test mock (note how it
doesn't require a Turing dep):


https://github.com/TuringLang/Turing.jl/blob/06752c41a97cd0dc37bb8700ab7a2d06f50f4f76/test/mcmc/external_sampler.jl#L20-L74
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants