Skip to content

Commit

Permalink
Update for proposed DynamicPPL 0.32 (#2419)
Browse files Browse the repository at this point in the history
* Add DynamicPPL integration tests

* Bump DynamicPPL compat -> 0.32

* Remove / export deprecated functions as needed

Including @submodel, to_submodel, link!, invlink!

* Update submodel names as per DPPL 0.32

* Enable concurrency on PR testing to avoid wastage

* Bump Turing patch version

* Improve descriptions of tests

Co-authored-by: Hong Ge <[email protected]>

* Update test/dynamicppl/compiler.jl

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: Hong Ge <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 18, 2024
1 parent 700a19a commit 2707d12
Show file tree
Hide file tree
Showing 11 changed files with 398 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/Tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
- master
pull_request:

# Cancel existing tests on the same PR if a new commit is added to a pull request
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
test:
# Use matrix.test.name here to avoid it taking up the entire window width
Expand Down
4 changes: 2 additions & 2 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.35.4"
version = "0.35.5"

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
Expand Down Expand Up @@ -63,7 +63,7 @@ Distributions = "0.23.3, 0.24, 0.25"
DistributionsAD = "0.6"
DocStringExtensions = "0.8, 0.9"
DynamicHMC = "3.4"
DynamicPPL = "0.29, 0.30.4, 0.31"
DynamicPPL = "0.32"
EllipticalSliceSampling = "0.5, 1, 2"
ForwardDiff = "0.10.3"
Libtask = "0.8.8"
Expand Down
10 changes: 5 additions & 5 deletions docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ even though [`Prior()`](@ref) is actually defined in the `Turing.Inference` modu

### Modelling

| Exported symbol | Documentation | Description |
|:--------------- |:--------------------------------- |:-------------------------------------------- |
| `@model` | [`DynamicPPL.@model`](@extref) | Define a probabilistic model |
| `@varname` | [`AbstractPPL.@varname`](@extref) | Generate a `VarName` from a Julia expression |
| `@submodel` | [`DynamicPPL.@submodel`](@extref) | Define a submodel |
| Exported symbol | Documentation | Description |
|:--------------- |:----------------------------------- |:-------------------------------------------- |
| `@model` | [`DynamicPPL.@model`](@extref) | Define a probabilistic model |
| `@varname` | [`AbstractPPL.@varname`](@extref) | Generate a `VarName` from a Julia expression |
| `to_submodel` | [`DynamicPPL.to_submodel`](@extref) | Define a submodel |

### Inference

Expand Down
6 changes: 4 additions & 2 deletions src/Turing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,17 @@ using DynamicPPL:
decondition,
fix,
unfix,
conditioned
conditioned,
to_submodel
using StatsBase: predict
using Bijectors: ordered
using OrderedCollections: OrderedDict

# Turing essentials - modelling macros and inference algorithms
export @model, # modelling
@varname,
@submodel,
@submodel, # Deprecated
to_submodel,
DynamicPPL,
Prior, # Sampling from the prior
MH, # classic sampling
Expand Down
2 changes: 0 additions & 2 deletions src/mcmc/Inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ using DynamicPPL:
VarInfo,
TypedVarInfo,
islinked,
invlink!,
link!,
setindex!!,
push!!,
setlogp!!,
Expand Down
4 changes: 3 additions & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[deps]
AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
AbstractPPL = "7a57a42e-76ec-4ea3-a279-07e840d6d9cf"
AdvancedMH = "5b7e9947-ddc0-4b3f-9b55-0d8042f74170"
AdvancedPS = "576499cb-2369-40b2-a588-c64705576edc"
AdvancedVI = "b5ca4192-6429-45e5-a2d9-87aec30a685c"
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
BangBang = "198e06fe-97b7-11e9-32a5-e1d131e6ad66"
Clustering = "aaaa29a8-35af-508c-8bc3-b662a17a0fe5"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
DistributionsAD = "ced4e74d-a319-5a8a-b0ac-84af2272839c"
Expand Down Expand Up @@ -45,7 +47,7 @@ Clustering = "0.14, 0.15"
Distributions = "0.25"
DistributionsAD = "0.6.3"
DynamicHMC = "2.1.6, 3.0"
DynamicPPL = "0.29, 0.30.4, 0.31"
DynamicPPL = "0.32.2"
FiniteDifferences = "0.10.8, 0.11, 0.12"
ForwardDiff = "0.10.12 - 0.10.32, 0.10"
HypothesisTests = "0.11"
Expand Down
Loading

2 comments on commit 2707d12

@penelopeysm
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/121620

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.35.5 -m "<description of version>" 2707d12207f6bf49381319df2859d22ef619deda
git push origin v0.35.5

Please sign in to comment.