Skip to content

Conversation

@penelopeysm
Copy link
Member

@penelopeysm penelopeysm commented Oct 21, 2025

This is the regular PR for accumulating breaking changes, to be released in the next minor version of DynamicPPL.

@codecov
Copy link

codecov bot commented Oct 21, 2025

Codecov Report

❌ Patch coverage is 87.45520% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.99%. Comparing base (6c615ad) to head (54ae7e3).

Files with missing lines Patch % Lines
ext/DynamicPPLMCMCChainsExt.jl 68.96% 9 Missing ⚠️
src/contexts/conditionfix.jl 79.16% 5 Missing ⚠️
src/contexts.jl 50.00% 4 Missing ⚠️
src/logdensityfunction.jl 95.06% 4 Missing ⚠️
src/test_utils/ad.jl 0.00% 4 Missing ⚠️
src/onlyaccs.jl 75.00% 3 Missing ⚠️
src/compiler.jl 92.30% 2 Missing ⚠️
ext/DynamicPPLEnzymeCoreExt.jl 0.00% 1 Missing ⚠️
src/contexts/init.jl 97.14% 1 Missing ⚠️
src/model.jl 97.05% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1082      +/-   ##
==========================================
- Coverage   81.58%   79.99%   -1.60%     
==========================================
  Files          40       41       +1     
  Lines        3845     3874      +29     
==========================================
- Hits         3137     3099      -38     
- Misses        708      775      +67     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 31, 2025

Benchmark Report

  • this PR's head: 54ae7e30df1cfaa1f69202c8637d58afce55134d
  • base branch: 6c615ad41946ffa11698408948f85cd4606262ff

Computer Information

Julia Version 1.11.7
Commit f2b3dbda30a (2025-09-08 12:10 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 4 × AMD EPYC 7763 64-Core Processor
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, znver3)
Threads: 1 default, 0 interactive, 1 GC (on 4 virtual cores)

Benchmark Results

┌───────────────────────┬───────┬─────────────┬───────────────────┬────────┬─────────────────────────────────┬───────────────────────────┬─────────────────────────────────┐
│                       │       │             │                   │        │        t(eval) / t(ref)         │     t(grad) / t(eval)     │        t(grad) / t(ref)         │
│                       │       │             │                   │        │ ──────────┬───────────┬──────── │ ──────┬─────────┬──────── │ ──────────┬───────────┬──────── │
│                 Model │   Dim │  AD Backend │           VarInfo │ Linked │      base │   this PR │ speedup │  base │ this PR │ speedup │      base │   this PR │ speedup │
├───────────────────────┼───────┼─────────────┼───────────────────┼────────┼───────────┼───────────┼─────────┼───────┼─────────┼─────────┼───────────┼───────────┼─────────┤
│               Dynamic │    10 │    mooncake │             typed │   true │    452.88 │    374.78 │    1.21 │ 10.00 │   11.84 │    0.84 │   4526.63 │   4437.75 │    1.02 │
│                   LDA │    12 │ reversediff │             typed │   true │   2888.32 │   3874.72 │    0.75 │  2.21 │    4.15 │    0.53 │   6387.27 │  16068.17 │    0.40 │
│   Loop univariate 10k │ 10000 │    mooncake │             typed │   true │ 169851.47 │ 103546.15 │    1.64 │  4.97 │    4.24 │    1.17 │ 843779.89 │ 439315.13 │    1.92 │
├───────────────────────┼───────┼─────────────┼───────────────────┼────────┼───────────┼───────────┼─────────┼───────┼─────────┼─────────┼───────────┼───────────┼─────────┤
│    Loop univariate 1k │  1000 │    mooncake │             typed │   true │  14297.38 │   8775.14 │    1.63 │  5.64 │    4.28 │    1.32 │  80692.69 │  37534.58 │    2.15 │
│      Multivariate 10k │ 10000 │    mooncake │             typed │   true │  32670.51 │  32769.67 │    1.00 │  9.30 │   10.04 │    0.93 │ 303988.53 │ 329143.43 │    0.92 │
│       Multivariate 1k │  1000 │    mooncake │             typed │   true │   3586.36 │   3652.70 │    0.98 │  8.77 │    9.12 │    0.96 │  31465.63 │  33318.77 │    0.94 │
├───────────────────────┼───────┼─────────────┼───────────────────┼────────┼───────────┼───────────┼─────────┼───────┼─────────┼─────────┼───────────┼───────────┼─────────┤
│ Simple assume observe │     1 │ forwarddiff │             typed │  false │     17.15 │      2.72 │    6.31 │  1.89 │    3.87 │    0.49 │     32.43 │     10.51 │    3.09 │
│           Smorgasbord │   201 │ forwarddiff │             typed │  false │   2531.50 │   1209.42 │    2.09 │ 45.75 │   63.44 │    0.72 │ 115828.53 │  76724.14 │    1.51 │
│           Smorgasbord │   201 │ forwarddiff │       simple_dict │   true │  25280.10 │       err │     err │ 23.64 │     err │     err │ 597721.08 │       err │     err │
├───────────────────────┼───────┼─────────────┼───────────────────┼────────┼───────────┼───────────┼─────────┼───────┼─────────┼─────────┼───────────┼───────────┼─────────┤
│           Smorgasbord │   201 │ forwarddiff │ simple_namedtuple │   true │   1037.84 │       err │     err │ 81.81 │     err │     err │  84905.21 │       err │     err │
│           Smorgasbord │   201 │      enzyme │             typed │   true │   2559.97 │   1652.63 │    1.55 │  4.70 │    5.86 │    0.80 │  12039.79 │   9689.69 │    1.24 │
│           Smorgasbord │   201 │    mooncake │             typed │   true │   2535.65 │   1656.54 │    1.53 │  5.59 │    5.33 │    1.05 │  14183.36 │   8826.97 │    1.61 │
├───────────────────────┼───────┼─────────────┼───────────────────┼────────┼───────────┼───────────┼─────────┼───────┼─────────┼─────────┼───────────┼───────────┼─────────┤
│           Smorgasbord │   201 │ reversediff │             typed │   true │   2550.10 │   1712.21 │    1.49 │ 58.42 │   88.08 │    0.66 │ 148965.52 │ 150805.18 │    0.99 │
│           Smorgasbord │   201 │ forwarddiff │      typed_vector │   true │   2614.48 │   1670.64 │    1.56 │ 95.57 │  122.15 │    0.78 │ 249877.24 │ 204063.54 │    1.22 │
│           Smorgasbord │   201 │ forwarddiff │           untyped │   true │   2279.12 │   1647.15 │    1.38 │ 48.35 │   57.49 │    0.84 │ 110186.81 │  94701.56 │    1.16 │
├───────────────────────┼───────┼─────────────┼───────────────────┼────────┼───────────┼───────────┼─────────┼───────┼─────────┼─────────┼───────────┼───────────┼─────────┤
│           Smorgasbord │   201 │ forwarddiff │    untyped_vector │   true │   2408.03 │   1647.93 │    1.46 │ 44.54 │   59.02 │    0.75 │ 107256.64 │  97264.51 │    1.10 │
│              Submodel │     1 │    mooncake │             typed │   true │     25.82 │      7.27 │    3.55 │  5.55 │    5.22 │    1.06 │    143.36 │     37.93 │    3.78 │
└───────────────────────┴───────┴─────────────┴───────────────────┴────────┴───────────┴───────────┴─────────┴───────┴─────────┴─────────┴───────────┴───────────┴─────────┘

@github-actions
Copy link
Contributor

github-actions bot commented Nov 5, 2025

DynamicPPL.jl documentation for PR #1082 is available at:
https://TuringLang.github.io/DynamicPPL.jl/previews/PR1082/

penelopeysm and others added 17 commits November 5, 2025 18:36
* Remove NodeTrait

* Changelog

* Fix exports

* docs

* fix a bug

* Fix doctests

* Fix test

* tweak changelog
* Fast Log Density Function

* Make it work with AD

* Optimise performance for identity VarNames

* Mark `get_range_and_linked` as having zero derivative

* Update comment

* make AD testing / benchmarking use FastLDF

* Fix tests

* Optimise away `make_evaluate_args_and_kwargs`

* const func annotation

* Disable benchmarks on non-typed-Metadata-VarInfo

* Fix `_evaluate!!` correctly to handle submodels

* Actually fix submodel evaluate

* Document thoroughly and organise code

* Support more VarInfos, make it thread-safe (?)

* fix bug in parsing ranges from metadata/VNV

* Fix get_param_eltype for TSVI

* Disable Enzyme benchmark

* Don't override _evaluate!!, that breaks ForwardDiff (sometimes)

* Move FastLDF to experimental for now

* Fix imports, add tests, etc

* More test fixes

* Fix imports / tests

* Remove AbstractFastEvalContext

* Changelog and patch bump

* Add correctness tests, fix imports

* Concretise parameter vector in tests

* Add zero-allocation tests

* Add Chairmarks as test dep

* Disable allocations tests on multi-threaded

* Fast InitContext (#1125)

* Make InitContext work with OnlyAccsVarInfo

* Do not convert NamedTuple to Dict

* remove logging

* Enable InitFromPrior and InitFromUniform too

* Fix `infer_nested_eltype` invocation

* Refactor FastLDF to use InitContext

* note init breaking change

* fix logjac sign

* workaround Mooncake segfault

* fix changelog too

* Fix get_param_eltype for context stacks

* Add a test for threaded observe

* Export init

* Remove dead code

* fix transforms for pathological distributions

* Tidy up loads of things

* fix typed_identity spelling

* fix definition order

* Improve docstrings

* Remove stray comment

* export get_param_eltype (unfortunatley)

* Add more comment

* Update comment

* Remove inlines, fix OAVI docstring

* Improve docstrings

* Simplify InitFromParams constructor

* Replace map(identity, x[:]) with [i for i in x[:]]

* Simplify implementation for InitContext/OAVI

* Add another model to allocation tests

Co-authored-by: Markus Hauru <[email protected]>

* Revert removal of dist argument (oops)

* Format

* Update some outdated bits of FastLDF docstring

* remove underscores

---------

Co-authored-by: Markus Hauru <[email protected]>
* print output

* fix

* reenable

* add more lines to guide the eye

* reorder table

* print tgrad / trel as well

* forgot this type
… and also `bundle_samples` (#1129)

* Implement `ParamsWithStats` for `FastLDF`

* Add comments

* Implement `bundle_samples` for ParamsWithStats -> MCMCChains

* Remove redundant comment

* don't need Statistics?
* Make FastLDF the default

* Add miscellaneous LogDensityProblems tests

* Use `init!!` instead of `fast_evaluate!!`

* Rename files, rebalance tests
…o` (#1130)

* Use OnlyAccsVarInfo for many re-evaluation functions

* drop `fast_` prefix

* Add a changelog
…nked (#1141)

* Improve type stability when all parameters are linked or unlinked

* fix a merge conflict

* fix enzyme gc crash (locally at least)

* Fixes from review
* Make threadsafe evaluation opt-in

* Reduce number of type parameters in methods

* Make `warned_warn_about_threads_threads_threads_threads` shorter

* Improve `setthreadsafe` docstring

* warn on bare `@threads` as well

* fix merge

* Fix performance issues

* Use maxthreadid() in TSVI

* Move convert_eltype code to threadsafe eval function

* Point to new Turing docs page

* Add a test for setthreadsafe

* Tidy up check_model

* Apply suggestions from code review

Fix outdated docstrings

Co-authored-by: Markus Hauru <[email protected]>

* Improve warning message

* Export `requires_threadsafe`

* Add an actual docstring for `requires_threadsafe`

---------

Co-authored-by: Markus Hauru <[email protected]>
* Standardise `:lp` -> `:logjoint`

* changelog

* fix a test
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.

3 participants