-
Notifications
You must be signed in to change notification settings - Fork 37
FastLDF / InitContext unified #1132
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
Open
penelopeysm
wants to merge
48
commits into
breaking
Choose a base branch
from
py/ldf
base: breaking
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+932
−72
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
Benchmark Report for Commit 62a8746Computer InformationBenchmark Results |
Contributor
|
DynamicPPL.jl documentation for PR #1132 is available at: |
248f374 to
a4c71e6
Compare
This was referenced Nov 11, 2025
Closed
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## breaking #1132 +/- ##
============================================
+ Coverage 81.32% 81.67% +0.35%
============================================
Files 40 42 +2
Lines 3807 3919 +112
============================================
+ Hits 3096 3201 +105
- Misses 711 718 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
* Make InitContext work with OnlyAccsVarInfo * Do not convert NamedTuple to Dict * remove logging * Enable InitFromPrior and InitFromUniform too * Fix `infer_nested_eltype` invocation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This reimplements FastLDF, conceptually in the same way as #1113. Please see that PR for the bulk of the explanation. The difference is that this also unifies the implementation of
FastLDFandInitFromParams, such thatFastLDFis now actually justInitFromParamsbut backed by the combination of vector + ranges.Here's a slightly modified diagram from my slides yesterday:
Other speedups
Note that this unification also means that other initialisation strategies, i.e.
InitFromPrior,InitFromUniform, and other forms ofInitFromParams, can also benefit from the speedup (as shown in the top half of the diagram above). This was essentially done in #1125 but lumped into this PR as well. See that PR for benchmarks.Does this still need to be
Experimental?I'd suggest for this PR yes, if only just to prove correctness compared to old LDF. Making this replace old LDF should be a fairly trivial follow-up. Am open to other ideas.
Does this need to be
breaking?Yes, because the expected return value of
DynamicPPL.inithas changed. Technically, that wasn't exported, butAbstractInitStrategywas exported, soinitwas effectively public (it should have been exported).On top of that, this PR relies on changes in #1133, which are also breaking.
Benchmarks
Performance characteristics are exactly the same as in the original PR #1113. Benchmarks run on Julia 1.11.7, 1 thread.
Benchmarking code
Trivial model
Eight-schools centred
Lots of IndexLenses
Submodel
MCMC
is down from around 8.8 seconds to 1.7 seconds.