Skip to content

DynamicPPL 0.36 #2535

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

DynamicPPL 0.36 #2535

wants to merge 5 commits into from

Conversation

penelopeysm
Copy link
Member

@penelopeysm penelopeysm commented Apr 27, 2025

This PR adds compatibility with DynamicPPL 0.36.

Given that there are some reasonably breaking changes in the way that submodels behave, I've decided to increment the minor version number.

This PR supersedes the CompatHelper ones at #2532 #2533


Two problems right now:

(1) Prefixing broke Gibbs - this MWE works with DPPL 0.35.9 (main), fails with 0.36.0 (this PR)

using Turing

@model inner(m, s) = a ~ Normal(m, s)
@model function outer()
    s ~ InverseGamma(2, 3)
    m ~ Normal(0, 1)
    x ~ to_submodel(inner(m, s))
end
model = outer()
spl = Gibbs(@varname(s) => NUTS(), @varname(m) => NUTS())

sample(model, spl, 100)

I pushed a fix for this with aaa20c2e, but I think I need to understand GibbsContext more carefully to make sure that it is the correct fix.

Note that it's also quite likely that the change in DynamicPPL submodel prefixing behaviour means that it's now no longer possible to use Gibbs to sample prefixed submodel variables, because submodel variables now no longer have identity lenses. The current simplest workaround is for the user to not use prefixing. The proper solution is to fix #2403.

(2) There's some nasty lack of reproducibility in HMCDA sampling in test/mcmc/Inference. It's not introduced by this PR because the last CI run on main was already failing. I can't yet repro this locally.

Copy link

codecov bot commented Apr 27, 2025

Codecov Report

Attention: Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 84.10%. Comparing base (fc32e10) to head (ce0e616).

Files with missing lines Patch % Lines
src/mcmc/Inference.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2535      +/-   ##
==========================================
+ Coverage   84.05%   84.10%   +0.05%     
==========================================
  Files          21       21              
  Lines        1455     1460       +5     
==========================================
+ Hits         1223     1228       +5     
  Misses        232      232              

☔ 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.

@coveralls
Copy link

coveralls commented Apr 27, 2025

Pull Request Test Coverage Report for Build 14697846792

Details

  • 9 of 10 (90.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.06%) to 84.11%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/mcmc/Inference.jl 0 1 0.0%
Totals Coverage Status
Change from base Build 14321422608: 0.06%
Covered Lines: 1228
Relevant Lines: 1460

💛 - Coveralls

@penelopeysm penelopeysm marked this pull request as draft April 28, 2025 00:51
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.

Allow Gibbs sampler to have non-identity lenses for target variables
2 participants