Repository navigation
Reuse one memo when recovering the marginalized latents of a draw - #573
shravanngoswamii wants to merge 1 commit into
Conversation
|
JuliaBUGS.jl documentation for PR #573 is available at: |
Benchmark ResultsJulia 1.13.4 on AMD EPYC 9V74 80-Core Processor (Linux) Ratio = JuliaBUGS/Stan (lower is better for JuliaBUGS)
Log Density uses generated evaluation. Gradient columns measure log density + gradient. McRvs = Mooncake reverse mode with generated evaluation; FwdDiff = ForwardDiff with graph evaluation.
Note: Stan benchmarks use hand-optimized Stan models, not direct BUGS translations. Comparison is illustrative only. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #573 +/- ##
==========================================
- Coverage 88.49% 88.13% -0.37%
==========================================
Files 30 30
Lines 3851 3851
==========================================
- Hits 3408 3394 -14
- Misses 443 457 +14
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Each latent built a fresh memo for every candidate value, so recovering one draw summed out the rest of the model once per latent.
A memo key already holds the values of the earlier latents the rest of the model depends on, which is why one log density evaluation can share a memo across all its branches.
Recovering a draw drops from about 3 s to 7 ms on Eye Tracking and from about 110 s to 0.05 s on Cervix, with the same draws for a given seed.