Skip to content

Implement values_as_in_model using an accumulator #908

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 5 commits into from
May 8, 2025

Conversation

mhauru
Copy link
Member

@mhauru mhauru commented May 2, 2025

Also adds a relevant test.

@mhauru mhauru requested a review from penelopeysm May 2, 2025 13:20
Copy link
Contributor

github-actions bot commented May 2, 2025

Benchmark Report for Commit c2a8e63

Computer Information

Julia Version 1.11.5
Commit 760b2e5b739 (2025-04-14 06:53 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.7 |
|           Smorgasbord |       201 | forwarddiff |             typed |  false |                703.4 |                36.9 |
|           Smorgasbord |       201 | forwarddiff | simple_namedtuple |   true |                432.5 |                47.8 |
|           Smorgasbord |       201 | forwarddiff |           untyped |   true |               1287.6 |                27.0 |
|           Smorgasbord |       201 | forwarddiff |       simple_dict |   true |               8273.4 |                20.1 |
|           Smorgasbord |       201 | reversediff |             typed |   true |               1576.4 |                26.5 |
|           Smorgasbord |       201 |    mooncake |             typed |   true |               1034.9 |                 4.9 |
|    Loop univariate 1k |      1000 |    mooncake |             typed |   true |               6045.1 |                 3.9 |
|       Multivariate 1k |      1000 |    mooncake |             typed |   true |               1040.3 |                 8.8 |
|   Loop univariate 10k |     10000 |    mooncake |             typed |   true |              67978.2 |                 3.5 |
|      Multivariate 10k |     10000 |    mooncake |             typed |   true |               9084.4 |                 9.8 |
|               Dynamic |        10 |    mooncake |             typed |   true |                144.2 |                12.3 |
|              Submodel |         1 |    mooncake |             typed |   true |                 13.1 |                 6.3 |
|                   LDA |        12 | reversediff |             typed |   true |               1532.4 |                 2.7 |

Copy link

codecov bot commented May 2, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 8 lines in your changes missing coverage. Please review.

Please upload report for BASE (breaking@326d7ed). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/compiler.jl 40.00% 6 Missing ⚠️
src/values_as_in_model.jl 90.90% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             breaking     #908   +/-   ##
===========================================
  Coverage            ?   84.67%           
===========================================
  Files               ?       37           
  Lines               ?     4040           
  Branches            ?        0           
===========================================
  Hits                ?     3421           
  Misses              ?      619           
  Partials            ?        0           

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

Copy link
Member

@penelopeysm penelopeysm left a comment

Choose a reason for hiding this comment

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

Broader comment, since we discussed the possibility of taking VAIMAcc further just now (I opened an issue to track that too TuringLang/Turing.jl#2545). Is ValuesAsInModelAccumulator the best name, or is there something more suitable? It is a bit of a mouthful and I feel like we have a chance to rename it here

@mhauru
Copy link
Member Author

mhauru commented May 8, 2025

I like that it has the same name as the only function that uses it, and renaming the function would be breaking.

@mhauru mhauru requested a review from penelopeysm May 8, 2025 11:29
@penelopeysm
Copy link
Member

The docs failure is because of GHA perms, I'll fix that on main

@mhauru mhauru merged commit d4ef1f2 into breaking May 8, 2025
16 of 18 checks passed
@mhauru mhauru deleted the mhauru/values-as-in-model-accumulator branch May 8, 2025 14:32
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.

2 participants