Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
064113e
Remove DifferentiationInterface dependency; use AbstractPPL AD interface
yebai Apr 20, 2026
e1cac2f
Merge remote-tracking branch 'origin/main' into adproblems-interface
yebai Apr 21, 2026
d59e645
Use structural AbstractPPL AD prep for LogDensityFunction (#1365)
yebai Apr 23, 2026
3436cb7
Merge branch 'main' into adproblems-interface
yebai Apr 23, 2026
6e01f94
Merge branch 'main' into adproblems-interface
yebai Apr 26, 2026
a11e9cc
Split AD integration tests
yebai Apr 26, 2026
00969e0
Fix benchmark dependency sources
yebai Apr 26, 2026
ad29168
Format logdensityfunction test
yebai Apr 26, 2026
33f262c
format
yebai Apr 27, 2026
c3b3016
Merge branch 'main' into adproblems-interface
yebai Apr 29, 2026
187bd3d
Add DifferentiationInterface to benchmarks
yebai Apr 29, 2026
0b597b9
Merge branch 'main' into adproblems-interface
yebai May 4, 2026
aa3af76
Use AbstractPPL gradient bang API
yebai May 4, 2026
ecfe04d
Simplify benchmarks: single CI job, absolute log-density times
yebai Apr 30, 2026
d89c1e6
Collapse benchmarks/src into a single script
yebai May 4, 2026
a50b023
Merge branch 'improve-benchmarks-1374' into adproblems-interface
yebai May 4, 2026
5849eb6
Match Mooncake's bench harness for the AD-benchmarking flow
yebai May 4, 2026
f31e912
Skip ill-defined LDA-unlinked rows; surface a Smorgasbord gist + coll…
yebai May 4, 2026
49b1837
Add DifferentiationInterface to benchmarks env
yebai May 4, 2026
dfe042e
Restructure benchmark PR comment; pin remaining setup-julia to v3
yebai May 5, 2026
e2d5161
Bench PR head and main side-by-side; tolerate main-bench failure
yebai May 5, 2026
bc79c56
Merge remote-tracking branch 'origin/main' into adproblems-interface
yebai May 5, 2026
35b7b89
Collapse full benchmark table into a <details> foldout
yebai May 5, 2026
f7a116c
Pivot benchmark table by AD backend; restructure PR comment
yebai May 5, 2026
09c012d
Tighten benchmark PR comment template
yebai May 5, 2026
8982438
Restructure benchmark report table formatting
yebai May 5, 2026
adf7647
Sync benchmark workflow comment body with benchmarks branch
yebai May 5, 2026
60856c0
Merge branch 'main' into adproblems-interface
yebai May 5, 2026
f307d42
Minor tweaks.
yebai May 5, 2026
83e72a7
Clarify noisy benchmark ratios
yebai May 5, 2026
e8efe38
Update Project.toml
yebai May 6, 2026
9e1cb36
Merge branch 'main' into adproblems-interface
yebai May 7, 2026
6cd4d1e
Bump AbstractPPL compat to 0.15 in test, docs, and benchmarks envs
yebai May 13, 2026
7faf9dc
Merge branch 'main' into adproblems-interface
yebai May 13, 2026
66f5aed
Add Bijectors source override to envs that lack it
yebai May 13, 2026
64557cc
Add Bijectors to deps in floattypes and integration envs
yebai May 13, 2026
5934481
Inline LogDensityProblems entry points
yebai May 13, 2026
52cdddc
Load DifferentiationInterface in AD-using test envs
yebai May 13, 2026
ed4d852
Re-collect AD gradients in run_ad
yebai May 13, 2026
1bfa6e6
Pass raw gradient target to AbstractPPL.prepare
yebai May 13, 2026
cd1cedf
Bind raw_gradient_target to problem fields
yebai May 13, 2026
94c1b85
Bump DynamicPPL compat to 0.42 in benchmarks and docs envs
yebai May 13, 2026
07879c8
Switch AD prep to context-based AbstractPPL.prepare API
yebai May 18, 2026
8b418df
Merge branch 'main' into adproblems-interface
yebai May 19, 2026
6876b4e
Point AbstractPPL source to main branch in all envs
yebai May 19, 2026
bf6c85b
Deprecate LogDensityAt; alias to AbstractPPL.Evaluators.VectorEvaluator
yebai May 19, 2026
971f8a9
Merge branch 'main' into adproblems-interface
yebai May 19, 2026
db0ac05
Use AbstractPPL.prepare context kwarg in LogDensityAt deprecation
yebai May 19, 2026
54a0820
Skip dims check in LogDensityAt deprecation shim
yebai May 19, 2026
aaf1e3f
Consolidate integration test envs under test/ext
yebai May 19, 2026
a142a58
Drop AbstractPPL source pins now that 0.15 is registered
yebai May 19, 2026
02f6bc2
Drop Bijectors source pins now that 0.16 is registered
yebai May 21, 2026
3bdeb74
Point Enzyme CI workflow at relocated integration test
yebai May 21, 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
34 changes: 34 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,37 @@ jobs:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true

reversediff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: julia-actions/setup-julia@v3
with:
version: "1"

- uses: julia-actions/cache@v3

- name: Run AD with ReverseDiff on demo models
working-directory: test/ext/DynamicPPLReverseDiffExt
run: |
julia --project=. --color=yes -e 'using Pkg; Pkg.instantiate()'
julia --project=. --color=yes main.jl

marginallogdensities:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: julia-actions/setup-julia@v3
with:
version: "1"

- uses: julia-actions/cache@v3

- name: Run MarginalLogDensities integration tests
working-directory: test/ext/DynamicPPLMarginalLogDensitiesExt
run: |
julia --project=. --color=yes -e 'using Pkg; Pkg.instantiate()'
julia --project=. --color=yes main.jl
2 changes: 1 addition & 1 deletion .github/workflows/Enzyme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: julia-actions/cache@v3

- name: Run AD with Enzyme on demo models
working-directory: test/integration/enzyme
working-directory: test/ext/DynamicPPLEnzymeCoreExt
run: |
julia --project=. --color=yes -e 'using Pkg; Pkg.instantiate()'
julia --project=. --color=yes main.jl
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ DynamicPPL builds on AbstractPPL.jl for shared PPL interfaces such as `VarName`,

- CI also runs Aqua.jl quality checks and doctests.
- Test files are self-contained: use package imports, not relative imports or `include()`, so they run individually with TestPicker.jl.
- Always refresh each environment (`Pkg.update()` / `up`) before tests or doc builds — a stale manifest can cause subtle resolution and loading issues.
- Formatting is JuliaFormatter v1 (Blue style), enforced by CI:

```bash
Expand Down
10 changes: 4 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "DynamicPPL"
uuid = "366bfd00-2699-11ea-058f-f148b4cae6d8"
version = "0.41.8"
version = "0.42"

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
Expand All @@ -12,7 +12,6 @@ Bijectors = "76274a88-744f-5084-9051-94815aaf08c4"
Chairmarks = "0ca39b1e-fe0b-4e98-acfc-b1656634c4de"
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
Expand Down Expand Up @@ -44,22 +43,21 @@ DynamicPPLComponentArraysExt = ["ComponentArrays"]
DynamicPPLEnzymeCoreExt = ["EnzymeCore"]
DynamicPPLForwardDiffExt = ["ForwardDiff"]
DynamicPPLMCMCChainsExt = ["MCMCChains"]
DynamicPPLMooncakeExt = ["Mooncake"]
DynamicPPLMarginalLogDensitiesExt = ["MarginalLogDensities"]
DynamicPPLMooncakeExt = ["Mooncake", "DifferentiationInterface"]
DynamicPPLReverseDiffExt = ["ReverseDiff"]

[compat]
ADTypes = "1"
AbstractMCMC = "5.14"
AbstractPPL = "0.14.1"
AbstractPPL = "0.15"
Accessors = "0.1"
BangBang = "0.4.1"
Bijectors = "0.15.17"
Bijectors = "0.16"
Chairmarks = "1.3.1"
Compat = "4"
ComponentArrays = "0.15"
ConstructionBase = "1.5.4"
DifferentiationInterface = "0.6.41, 0.7"
Distributions = "0.25"
DocStringExtensions = "0.9"
EnzymeCore = "0.6 - 0.8"
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ DynamicPPL = {path = ".."}

[compat]
ADTypes = "1.14.0"
AbstractPPL = "0.14"
Bijectors = "0.15.17"
AbstractPPL = "0.15"
Bijectors = "0.16"
Chairmarks = "1.3.1"
DifferentiationInterface = "0.7"
Distributions = "0.25.117"
DynamicPPL = "0.41"
DynamicPPL = "0.42"
Enzyme = "0.13"
ForwardDiff = "1"
LogDensityProblems = "2.1.2"
Expand Down
6 changes: 3 additions & 3 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ StatsFuns = "4c63d2b9-4356-54db-8cca-17b64c39e42c"
[compat]
ADTypes = "1"
AbstractMCMC = "5"
AbstractPPL = "0.14"
AbstractPPL = "0.15"
Accessors = "0.1"
BangBang = "0.4"
Bijectors = "0.15.17"
Bijectors = "0.16"
Chairmarks = "1"
ChangesOfVariables = "0.1"
DimensionalData = "0.30"
Distributions = "0.25"
Documenter = "1"
DocumenterInterLinks = "1"
DocumenterMermaid = "0.1, 0.2"
DynamicPPL = "0.41"
DynamicPPL = "0.42"
FillArrays = "0.13, 1"
ForwardDiff = "0.10, 1"
LogDensityProblems = "2"
Expand Down
4 changes: 2 additions & 2 deletions ext/DynamicPPLMarginalLogDensitiesExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ accs = DynamicPPL.OnlyAccsVarInfo((
DynamicPPL.RawValueAccumulator(false),
# ... whatever else you need
))
_, accs = DynamicPPL.init!!(rng, model, oavi, init_strategy, DynamicPPL.UnlinkAll())
_, accs = DynamicPPL.init!!(rng, model, accs, init_strategy, DynamicPPL.UnlinkAll())
```
You can then extract all the updated data from `accs` using DynamicPPL's existing API (see
Expand Down Expand Up @@ -192,7 +192,7 @@ retcode: Success
u: 1-element Vector{Float64}:
4.88281250001733e-5
julia> # Get the an initialisation strategy representing the mode of `y`.
julia> # Get an initialisation strategy representing the mode of `y`.
init_strategy = InitFromVector(mld, opt_solution.u);
julia> # Evaluate the model with this initialisation strategy.
Expand Down
19 changes: 12 additions & 7 deletions ext/DynamicPPLMooncakeExt.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module DynamicPPLMooncakeExt

using DynamicPPL: DynamicPPL, is_transformed
using AbstractPPL: AbstractPPL
using Mooncake: Mooncake

# These are purely optimisations (although quite significant ones sometimes, especially for
Expand All @@ -15,17 +16,21 @@ Mooncake.@zero_derivative Mooncake.DefaultCtx Tuple{

using DynamicPPL: @model, LinkAll, getlogjoint_internal, LogDensityFunction
using ADTypes: AutoMooncake
import DifferentiationInterface
using Distributions: Normal, InverseGamma, Beta
using PrecompileTools: @setup_workload, @compile_workload
@setup_workload begin
@compile_workload begin
for dist in (Normal(), InverseGamma(2, 3), Beta(2, 2))
@model f() = x ~ dist
ldf = LogDensityFunction(
f(), getlogjoint_internal, LinkAll(); adtype=AutoMooncake()
)
DynamicPPL.LogDensityProblems.logdensity_and_gradient(ldf, [0.5])
# Julia does not guarantee transitive extensions are loaded while this
# extension precompiles, so skip the workload unless Mooncake's
# AbstractPPL methods are already available.
if !isnothing(Base.get_extension(AbstractPPL, :AbstractPPLMooncakeExt))
for dist in (Normal(), InverseGamma(2, 3), Beta(2, 2))
@model f() = x ~ dist
ldf = LogDensityFunction(
f(), getlogjoint_internal, LinkAll(); adtype=AutoMooncake()
)
DynamicPPL.LogDensityProblems.logdensity_and_gradient(ldf, [0.5])
end
end
end
end
Expand Down
Loading
Loading