Skip to content

JET + Mooncake fixes for 1.12 #921

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
May 21, 2025
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
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
61 changes: 61 additions & 0 deletions .github/workflows/DocTest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# We want to only run doctests on a single version of Julia, because
# things like error messages / output can change between versions and
# is fragile to test against.
name: Doctests

on:
push:
branches:
- main
pull_request:
merge_group:
types: [checks_requested]

# needed to allow julia-actions/cache to delete old caches that it has created
permissions:
actions: write
contents: read

# 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:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: julia-actions/setup-julia@v2
with:
version: '1'

- uses: julia-actions/cache@v2

- uses: julia-actions/julia-buildpkg@v1

- name: Run doctests
shell: julia --color=yes --depwarn=yes --project=docs {0}
run: |
# Develop currently checked out version of DynamicPPL
using Pkg
Pkg.develop(path=pwd())
Pkg.instantiate()

using Documenter, DynamicPPL, Distributions

DocMeta.setdocmeta!(
DynamicPPL,
:DocTestSetup,
:(using DynamicPPL, Distributions);
recursive=true,
)
doctestfilters = [
# Ignore the source of a warning in the doctest output, since this is dependent on host.
# This is a line that starts with "└ @ " and ends with the line number.
r"└ @ .+:[0-9]+",
]

doctest(DynamicPPL; manual=false, doctestfilters=doctestfilters)
5 changes: 3 additions & 2 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

## 0.36.4

Added a compatibility entry for JET.jl 0.10.
This should only affect you if you are using DynamicPPL on the Julia 1.12 pre-release.
Added compatibility with DifferentiationInterface.jl 0.7, and also with JET.jl 0.10.

The JET compatibility entry should only affect you if you are using DynamicPPL on the Julia 1.12 pre-release.

## 0.36.3

Expand Down
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
Copy link
Member

Choose a reason for hiding this comment

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

Is this for the doctests? I didn't realise the docs project would need it, but if it's needed then it is.

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed, it depends on which env you call doctest() from. In the new workflow I was using the docs env. But I suppose I will move it back to the test env

AbstractPPL = "7a57a42e-76ec-4ea3-a279-07e840d6d9cf"
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Expand Down
6 changes: 0 additions & 6 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
DistributionsAD = "ced4e74d-a319-5a8a-b0ac-84af2272839c"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
Expand All @@ -28,9 +27,6 @@ StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[weakdeps]
Mooncake = "da2b9cff-9c12-43a0-ae48-6db2b0edb7d6"

[compat]
ADTypes = "1"
AbstractMCMC = "5"
Expand All @@ -43,14 +39,12 @@ Compat = "4.3.0"
DifferentiationInterface = "0.6.41, 0.7"
Distributions = "0.25"
DistributionsAD = "0.6.3"
Documenter = "1"
EnzymeCore = "0.6 - 0.8"
ForwardDiff = "0.10.12"
JET = "0.9, 0.10"
LogDensityProblems = "2"
MCMCChains = "6.0.4"
MacroTools = "0.5.6"
Mooncake = "0.4.95"
OrderedCollections = "1"
ReverseDiff = "1"
StableRNGs = "1"
Expand Down
18 changes: 0 additions & 18 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ using Bijectors
using DifferentiationInterface
using Distributions
using DistributionsAD
using Documenter
using ForwardDiff
using LogDensityProblems
using MacroTools
Expand Down Expand Up @@ -97,22 +96,5 @@ include("test_util.jl")
@test_throws ErrorException prob"..."
@test_throws ErrorException logprob"..."
end
if !IS_PRERELEASE
# Don't run doctests on prerelease as error messages etc. may vary
@testset "doctests" begin
DocMeta.setdocmeta!(
DynamicPPL,
:DocTestSetup,
:(using DynamicPPL, Distributions);
recursive=true,
)
doctestfilters = [
# Ignore the source of a warning in the doctest output, since this is dependent on host.
# This is a line that starts with "└ @ " and ends with the line number.
r"└ @ .+:[0-9]+",
]
doctest(DynamicPPL; manual=false, doctestfilters=doctestfilters)
end
end
Copy link
Member

Choose a reason for hiding this comment

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

Could we keep this but have it outside of both Group1 and Group2? I think it would still be good to run it when running tests locally. Didn't think of this earlier, sorry.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, sure, in that case it becomes even easier from the CI part.

end
end
Loading