Skip to content
Draft
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
51549c8
Replace AdvancedPS with a native particle MCMC implementation
yebai Jul 21, 2026
a2eb174
Consolidate particle MCMC files, drop redundant fork step, add notes
yebai Jul 21, 2026
3e0960b
Default to stratified resampling
yebai Jul 21, 2026
0620231
Drop redundant prior/Jacobian accumulators from particles
yebai Jul 21, 2026
5d9d127
Reuse surviving parents on resample to cut allocations
yebai Jul 21, 2026
ad5979b
Clarity pass: high-level design note, sectioning, key-step notes
yebai Jul 21, 2026
48e112a
Document particle-MCMC rewrite in HISTORY; add RNG-respected tests
yebai Jul 21, 2026
22daced
Port extra particle-MCMC tests from PR 2848 (ck/smc)
yebai Jul 21, 2026
4789428
Note that resampler scheme types are not exported
yebai Jul 21, 2026
cd6444a
Minimise: drop unused step-counter generality
yebai Jul 21, 2026
b904713
Minimise: drop redundant threadsafe check in SMC step
yebai Jul 21, 2026
499b61a
Derive numeric types instead of hardcoding Float64
yebai Jul 21, 2026
87c0bb7
Move import Random123 into particle_mcmc.jl
yebai Jul 21, 2026
bcae152
Release the particle MCMC rewrite as 0.47.0
yebai Jul 21, 2026
0223944
Fix method ambiguity in TracedRNG seed!
yebai Jul 21, 2026
ad08bbf
Make RNG seed splitting version-stable and decorrelated
yebai Jul 21, 2026
716cc1e
Cite Andrieu, Doucet & Holenstein (2010) in the particle MCMC module
yebai Jul 21, 2026
541bc2a
Stabilise the gdemo CSMC+ESS test against seed variation
yebai Jul 21, 2026
160ab54
Add opt-in within-sweep particle threading to SMC and PG
yebai Jul 21, 2026
75d3c0b
Keep particle log-score consistent with the likelihood accumulator
yebai Jul 23, 2026
50d2f40
Rename ParticleMCMCContext to SMCContext
yebai Jul 23, 2026
7247b13
Parametrise Particle on its RNG and weight types
yebai Jul 23, 2026
39ab78e
Document why particle assume always draws from the prior
yebai Jul 23, 2026
8f6f700
Reuse Particle as the PG state (const PGState = Particle)
yebai Jul 23, 2026
f80dc16
Clarify particle parallelism: rename threaded to multithreaded, separ…
yebai Jul 23, 2026
280ade9
Move project instructions into AGENTS.md, include from CLAUDE.md
yebai Jul 23, 2026
564b471
SMC: bundle the population directly, drop the step-loop, PGState, and…
yebai Jul 23, 2026
99a2c2b
Add per-observation ESS to SMC output; rename evidence stat to log_no…
yebai Jul 23, 2026
186282c
Fix Inference.jl test for the log_normalizing_constant rename
yebai Jul 23, 2026
b55ea5a
Rename resampler types with a Resampler suffix
yebai Jul 23, 2026
96c11a5
Pin the CSMC reference to the retained trajectory by value
yebai Jul 23, 2026
14bc29d
Guard stratified/systematic resampling against weight undersum
yebai Jul 23, 2026
1a917bb
Warn when SMC is given initial_params
yebai Jul 23, 2026
bf9357d
Explain why the CSMC reference reproduces by value, with the math
yebai Jul 24, 2026
118348b
Finish the resampler rename in HISTORY.md
yebai Jul 28, 2026
58a4e0a
Detect a changed reference execution trace instead of silently resamp…
yebai Jul 28, 2026
43f4694
Draw conditional-sweep ancestors multinomially, whatever scheme is named
yebai Jul 28, 2026
8e74b4c
Report which sampling keywords SMC actually honours
yebai Jul 28, 2026
ac77e43
Let ess_per_step follow LogProbType instead of pinning it to Float64
yebai Jul 29, 2026
8665e57
Build a CSMC reference from the retained particle, not from loose values
yebai Jul 29, 2026
bee0e0c
Record the measured CSMC+ESS margin, which is thinner than the commen…
yebai Jul 29, 2026
e8ef7a0
Stop AGENTS.md claiming the particle samplers wrap AdvancedPS
yebai Jul 29, 2026
f7af068
Delegate the accloglikelihood!! overload instead of reimplementing it
yebai Jul 29, 2026
542b85c
Assert MoGtest posterior means, not idealised cluster labels
yebai Jul 29, 2026
861d1ce
Mention the reference-replay branch in the SMCContext docstring
yebai Jul 29, 2026
7b12f5f
Skip Aqua's persistent_tasks check on Windows, where it is flaky
yebai Jul 29, 2026
6c8247d
Drop the reference's seed-replay machinery, which value-pinning made …
yebai Jul 29, 2026
9efc184
Rename ESSResampler and the weight-ESS helper away from the ESS sampl…
yebai Jul 29, 2026
2ff6b22
Say that PG's log_normalizing_constant is biased, and test that it is
yebai Jul 29, 2026
92b3638
Check the particle samplers against two models with tractable posteriors
yebai Jul 29, 2026
8390a7c
Produce the particle weight from the accumulator, dropping the type p…
yebai Jul 29, 2026
bbfc692
Tidy the particle samplers and their tests
yebai Jul 29, 2026
3f822ff
Derive the fixed-parameter test models, and give the files a header h…
yebai Jul 29, 2026
5cd20ea
Drop the dead normalized_weights import from the particle tests
yebai Jul 29, 2026
9dce003
Correct two comments that misdescribe how particles carry state
yebai Jul 29, 2026
e4628df
Cover latents whose dimension varies between executions
yebai Jul 29, 2026
6535094
Widen the varying-dimension tolerance to allow for chain autocorrelation
yebai Jul 29, 2026
8663adf
Fold the normalizing-constant caveat into its bullet, for the formatter
yebai Jul 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
# 0.47.0

## Breaking changes

### Particle MCMC (SMC and PG)

`SMC` and `PG` / `CSMC` have been reimplemented natively and no longer depend on AdvancedPS.

Resampling schemes are now types rather than functions — `Stratified()`, `Systematic()`, and `Multinomial()` (in `Turing.Inference`), optionally wrapped in `ESSResampler(threshold, scheme)` to resample only when the effective sample size falls below `threshold * nparticles`; for example `SMC(Turing.Inference.Systematic())`, `SMC(0.5)`, or `PG(10, Turing.Inference.Multinomial(), 0.5)`.
The old function-based API (`resample_systematic`, `AdvancedPS.ResampleWithESSThreshold`, …) is gone.

The default scheme is now **stratified** rather than systematic: it stays consistent as the number of particles grows and within the theoretical guarantees for particle Gibbs, which systematic does not.
Exact draws may therefore differ from previous releases, but remain statistically consistent (the same target distribution).

The rewrite also brings:

- **Reproducibility.** Internal seeds are derived through a counter-based (Philox) generator, so a fixed user seed gives the same draws on every Julia version and platform, and splitting one stream into many is better decorrelated. Previously, results could drift between Julia versions even under a `StableRNG` (https://github.com/TuringLang/Turing.jl/issues/2781).
- **Parallelism.** Multiple chains run under AbstractMCMC's `MCMCThreads()` and `MCMCDistributed()`, and `SMC(; threaded=true)` / `PG(n; threaded=true)` spread the particles across threads within each sweep. Neither changes the results; start Julia with multiple threads (e.g. `julia -t auto`) for the thread-based paths to take effect.
Comment thread
yebai marked this conversation as resolved.
Outdated
- **Weight diagnostics.** `SMC` chains carry the log-evidence estimate `logevidence` and the per-particle normalised `weight` as extra columns; `PG` / `CSMC` chains carry `logevidence`.

# 0.46.0

## Breaking changes
Expand Down
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Turing"
uuid = "fce5fe82-541a-59a6-adf8-730c64b5f9a0"
version = "0.46.0"
version = "0.47.0"

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
Expand All @@ -9,7 +9,6 @@ AbstractPPL = "7a57a42e-76ec-4ea3-a279-07e840d6d9cf"
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
AdvancedHMC = "0bf59076-c3b1-5ca4-86bd-e02cd72cde3d"
AdvancedMH = "5b7e9947-ddc0-4b3f-9b55-0d8042f74170"
AdvancedPS = "576499cb-2369-40b2-a588-c64705576edc"
AdvancedVI = "b5ca4192-6429-45e5-a2d9-87aec30a685c"
BangBang = "198e06fe-97b7-11e9-32a5-e1d131e6ad66"
Bijectors = "76274a88-744f-5084-9051-94815aaf08c4"
Expand All @@ -29,6 +28,7 @@ OptimizationOptimJL = "36348300-93cb-4f02-beb5-3c3902f8871e"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Random123 = "74087812-796a-5b5d-8853-05524746bad3"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
Expand All @@ -52,7 +52,6 @@ AbstractPPL = "0.15"
Accessors = "0.1"
AdvancedHMC = "0.8.3"
AdvancedMH = "0.8.9"
AdvancedPS = "0.7.2"
AdvancedVI = "0.7"
BangBang = "0.4.2"
Bijectors = "0.15.17, 0.16"
Expand All @@ -74,6 +73,7 @@ OptimizationOptimJL = "0.1 - 0.4"
OrderedCollections = "1, 2"
Printf = "1"
Random = "1"
Random123 = "1.7.1"
Reexport = "0.2, 1"
SciMLBase = "2, 3"
SpecialFunctions = "0.7.2, 0.8, 0.9, 0.10, 1, 2"
Expand Down
1 change: 0 additions & 1 deletion src/mcmc/Inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import AdvancedHMC
const AHMC = AdvancedHMC
import AdvancedMH
const AMH = AdvancedMH
import AdvancedPS
import EllipticalSliceSampling
import LogDensityProblems
import Random
Expand Down
Loading
Loading