Skip to content

Conversation

penelopeysm
Copy link
Member

@penelopeysm penelopeysm commented Sep 3, 2025

Closes #1033

Comment on lines +106 to +107
resume_from=nothing,
initial_state=loadstate(resume_from),
Copy link
Member Author

@penelopeysm penelopeysm Sep 3, 2025

Choose a reason for hiding this comment

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

Now if you call sample(..., MCMCThreads(), ...; resume_from=chn then initial_state will be correctly loaded before being sent to AbstractMCMC.

The only requirement for this to work is then that initial_state must be a vector containing exactly nchains final states. For MCMCChains this is not currently true, but it will be fixed by TuringLang/MCMCChains.jl#488, hence the need for that PR.

Copy link
Contributor

github-actions bot commented Sep 3, 2025

Benchmark Report for Commit c84699d

Computer Information

Julia Version 1.11.6
Commit 9615af0f269 (2025-07-09 12:58 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 4 × AMD EPYC 7763 64-Core Processor
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, znver3)
Threads: 1 default, 0 interactive, 1 GC (on 4 virtual cores)

Benchmark Results

|                 Model | Dimension |  AD Backend |      VarInfo Type | Linked | Eval Time / Ref Time | AD Time / Eval Time |
|-----------------------|-----------|-------------|-------------------|--------|----------------------|---------------------|
| Simple assume observe |         1 | forwarddiff |             typed |  false |                  8.9 |                 1.6 |
|           Smorgasbord |       201 | forwarddiff |             typed |  false |                664.9 |                42.0 |
|           Smorgasbord |       201 | forwarddiff | simple_namedtuple |   true |                438.1 |                53.6 |
|           Smorgasbord |       201 | forwarddiff |           untyped |   true |               1164.5 |                31.0 |
|           Smorgasbord |       201 | forwarddiff |       simple_dict |   true |               6809.4 |                28.0 |
|           Smorgasbord |       201 | reversediff |             typed |   true |               1067.4 |                41.2 |
|           Smorgasbord |       201 |    mooncake |             typed |   true |               1043.5 |                 4.5 |
|    Loop univariate 1k |      1000 |    mooncake |             typed |   true |               5932.7 |                 4.2 |
|       Multivariate 1k |      1000 |    mooncake |             typed |   true |               1007.9 |                 9.0 |
|   Loop univariate 10k |     10000 |    mooncake |             typed |   true |              67111.5 |                 3.8 |
|      Multivariate 10k |     10000 |    mooncake |             typed |   true |               8529.7 |                10.2 |
|               Dynamic |        10 |    mooncake |             typed |   true |                138.8 |                11.9 |
|              Submodel |         1 |    mooncake |             typed |   true |                 13.6 |                 4.9 |
|                   LDA |        12 | reversediff |             typed |   true |               1091.1 |                 6.8 |

@penelopeysm penelopeysm marked this pull request as ready for review September 4, 2025 10:14
Copy link
Contributor

github-actions bot commented Sep 4, 2025

DynamicPPL.jl documentation for PR #1035 is available at:
https://TuringLang.github.io/DynamicPPL.jl/previews/PR1035/

Copy link

codecov bot commented Sep 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.34%. Comparing base (7f802f3) to head (c84699d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1035      +/-   ##
==========================================
+ Coverage   82.26%   82.34%   +0.08%     
==========================================
  Files          38       38              
  Lines        3947     3949       +2     
==========================================
+ Hits         3247     3252       +5     
+ Misses        700      697       -3     

☔ 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

Pull Request Test Coverage Report for Build 17460622460

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-1.6%) to 80.966%

Totals Coverage Status
Change from base Build 17449211988: -1.6%
Covered Lines: 3186
Relevant Lines: 3935

💛 - Coveralls

@coveralls
Copy link

coveralls commented Sep 4, 2025

Pull Request Test Coverage Report for Build 17460622460

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.09%) to 82.601%

Totals Coverage Status
Change from base Build 17449211988: 0.09%
Covered Lines: 3252
Relevant Lines: 3937

💛 - Coveralls

@penelopeysm
Copy link
Member Author

@joelkandiah I think this should make resume_from work as well, and I added the test you suggested -- could I trouble you to give it a try?

@penelopeysm penelopeysm merged commit 7249158 into main Sep 5, 2025
20 of 22 checks passed
@penelopeysm penelopeysm deleted the py/resume-from-multiple branch September 5, 2025 13:36
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.

resume_from silently no-ops with multiple-chain sampling
2 participants