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.

Potential 0.39 changes

Largely speaking I (Penny) am fairly happy with the general state of DPPL now. By far the biggest pain point for me, and the only thing I feel like I really want to change in the short term, is ThreadSafeVarInfo. Apart from that, in my opinion, it's now a good time to spend more resources on Turing, samplers, and optimisation.

Suggestions welcome.

@codecov
Copy link

codecov bot commented Oct 21, 2025

Codecov Report

❌ Patch coverage is 85.78947% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.67%. Comparing base (052bc19) to head (3cd8d34).

Files with missing lines Patch % Lines
src/fasteval.jl 91.13% 7 Missing ⚠️
src/contexts/conditionfix.jl 79.16% 5 Missing ⚠️
src/contexts.jl 50.00% 4 Missing ⚠️
src/test_utils/ad.jl 0.00% 4 Missing ⚠️
src/onlyaccs.jl 75.00% 3 Missing ⚠️
src/compiler.jl 85.71% 2 Missing ⚠️
ext/DynamicPPLEnzymeCoreExt.jl 0.00% 1 Missing ⚠️
src/utils.jl 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1082      +/-   ##
==========================================
+ Coverage   81.58%   81.67%   +0.09%     
==========================================
  Files          40       42       +2     
  Lines        3845     3930      +85     
==========================================
+ Hits         3137     3210      +73     
- Misses        708      720      +12     

☔ 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: 3cd8d3431e14ebc581266c1323d1db8a5bd4c0eb
  • base branch: 052bc1950df3a42e14b56eae51af236881092f90

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 × Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, icelake-server)
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 │    445.74 │    422.92 │    1.05 │  10.74 │   10.88 │    0.99 │   4789.10 │   4603.09 │    1.04 │
│                   LDA │    12 │ reversediff │             typed │   true │   2929.37 │   2785.77 │    1.05 │   2.03 │    2.12 │    0.96 │   5954.17 │   5906.43 │    1.01 │
│   Loop univariate 10k │ 10000 │    mooncake │             typed │   true │ 161660.57 │ 154479.82 │    1.05 │   5.49 │    5.55 │    0.99 │ 887267.00 │ 857786.61 │    1.03 │
├───────────────────────┼───────┼─────────────┼───────────────────┼────────┼───────────┼───────────┼─────────┼────────┼─────────┼─────────┼───────────┼───────────┼─────────┤
│    Loop univariate 1k │  1000 │    mooncake │             typed │   true │  15973.87 │  14094.96 │    1.13 │   5.46 │    5.82 │    0.94 │  87231.16 │  82004.54 │    1.06 │
│      Multivariate 10k │ 10000 │    mooncake │             typed │   true │  34032.90 │  31552.97 │    1.08 │   9.48 │    9.70 │    0.98 │ 322523.45 │ 306108.47 │    1.05 │
│       Multivariate 1k │  1000 │    mooncake │             typed │   true │   3869.01 │   3666.19 │    1.06 │   8.50 │    8.45 │    1.01 │  32894.52 │  30973.45 │    1.06 │
├───────────────────────┼───────┼─────────────┼───────────────────┼────────┼───────────┼───────────┼─────────┼────────┼─────────┼─────────┼───────────┼───────────┼─────────┤
│ Simple assume observe │     1 │ forwarddiff │             typed │  false │     17.72 │     17.14 │    1.03 │   1.86 │    1.88 │    0.99 │     33.01 │     32.16 │    1.03 │
│           Smorgasbord │   201 │ forwarddiff │             typed │  false │   2651.45 │   2520.10 │    1.05 │  44.53 │   45.85 │    0.97 │ 118071.75 │ 115539.51 │    1.02 │
│           Smorgasbord │   201 │ forwarddiff │       simple_dict │   true │  24027.52 │  23618.52 │    1.02 │  25.55 │   24.03 │    1.06 │ 613854.67 │ 567602.58 │    1.08 │
├───────────────────────┼───────┼─────────────┼───────────────────┼────────┼───────────┼───────────┼─────────┼────────┼─────────┼─────────┼───────────┼───────────┼─────────┤
│           Smorgasbord │   201 │ forwarddiff │ simple_namedtuple │   true │   1073.63 │   1039.26 │    1.03 │ 174.67 │   79.41 │    2.20 │ 187529.78 │  82523.13 │    2.27 │
│           Smorgasbord │   201 │      enzyme │             typed │   true │   2642.51 │   2527.45 │    1.05 │   4.98 │    4.92 │    1.01 │  13155.72 │  12424.88 │    1.06 │
│           Smorgasbord │   201 │    mooncake │             typed │   true │   2667.85 │   2537.53 │    1.05 │   5.67 │    5.69 │    1.00 │  15127.42 │  14438.42 │    1.05 │
├───────────────────────┼───────┼─────────────┼───────────────────┼────────┼───────────┼───────────┼─────────┼────────┼─────────┼─────────┼───────────┼───────────┼─────────┤
│           Smorgasbord │   201 │ reversediff │             typed │   true │   2753.14 │   2557.70 │    1.08 │  54.65 │   56.94 │    0.96 │ 150460.00 │ 145625.98 │    1.03 │
│           Smorgasbord │   201 │ forwarddiff │      typed_vector │   true │   2654.58 │   2598.19 │    1.02 │  47.78 │   43.70 │    1.09 │ 126828.34 │ 113544.69 │    1.12 │
│           Smorgasbord │   201 │ forwarddiff │           untyped │   true │   2340.73 │   2290.74 │    1.02 │  46.56 │   51.84 │    0.90 │ 108985.05 │ 118750.36 │    0.92 │
├───────────────────────┼───────┼─────────────┼───────────────────┼────────┼───────────┼───────────┼─────────┼────────┼─────────┼─────────┼───────────┼───────────┼─────────┤
│           Smorgasbord │   201 │ forwarddiff │    untyped_vector │   true │   2379.64 │   2439.28 │    0.98 │  47.37 │   42.87 │    1.10 │ 112728.52 │ 104583.73 │    1.08 │
│              Submodel │     1 │    mooncake │             typed │   true │     26.74 │     25.77 │    1.04 │   5.21 │    5.21 │    1.00 │    139.24 │    134.28 │    1.04 │
└───────────────────────┴───────┴─────────────┴───────────────────┴────────┴───────────┴───────────┴─────────┴────────┴─────────┴─────────┴───────────┴───────────┴─────────┘

@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 10 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
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