Skip to content

Conversation

@mhauru
Copy link
Member

@mhauru mhauru commented Dec 11, 2025

We define a number of models in TestUtils. Most of them are collected in the constant DEMO_MODELS, namely all the ones representing the one model with an InverseGamma and all that. However, there are a few other models as well. This PR collects all of them in a new constant ALL_MODELS, and starts using that in the test suite wherever the test isn't specific to the particular statistical model that DEMO_MODEL implements. It also fixes various issues that this expansion of the test suite brought up.

That this wasn't done before is the reason that in #1150 the issue with ranges wasn't caught by the test suite.

Not yet ready for review, need to understand remaining test failures.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 11, 2025

Benchmark Report

  • this PR's head: d46bbd0642373929e3b32fad1f19600c12db5695
  • base branch: 6266f644ce8caaa3b98fc65c1eb960f4f77243b1

Computer Information

Julia Version 1.11.7
Commit f2b3dbda30a (2025-09-08 12:10 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

┌───────────────────────┬───────┬─────────────┬───────────────────┬────────┬─────────────────────────────────┬───────────────────────────┬─────────────────────────────────┐
│                       │       │             │                   │        │        t(eval) / t(ref)         │     t(grad) / t(eval)     │        t(grad) / t(ref)         │
│                       │       │             │                   │        │ ──────────┬───────────┬──────── │ ──────┬─────────┬──────── │ ──────────┬───────────┬──────── │
│                 Model │   Dim │  AD Backend │           VarInfo │ Linked │      base │   this PR │ speedup │  base │ this PR │ speedup │      base │   this PR │ speedup │
├───────────────────────┼───────┼─────────────┼───────────────────┼────────┼───────────┼───────────┼─────────┼───────┼─────────┼─────────┼───────────┼───────────┼─────────┤
│               Dynamic │    10 │    mooncake │             typed │   true │    367.90 │    373.17 │    0.99 │ 10.69 │   10.53 │    1.01 │   3931.66 │   3931.03 │    1.00 │
│                   LDA │    12 │ reversediff │             typed │   true │   2605.12 │   2662.06 │    0.98 │  5.09 │    5.16 │    0.99 │  13257.24 │  13736.49 │    0.97 │
│   Loop univariate 10k │ 10000 │    mooncake │             typed │   true │ 106259.67 │ 104295.49 │    1.02 │  4.13 │    4.24 │    0.97 │ 439060.60 │ 442337.88 │    0.99 │
├───────────────────────┼───────┼─────────────┼───────────────────┼────────┼───────────┼───────────┼─────────┼───────┼─────────┼─────────┼───────────┼───────────┼─────────┤
│    Loop univariate 1k │  1000 │    mooncake │             typed │   true │   7979.76 │   8008.68 │    1.00 │  4.71 │    4.78 │    0.99 │  37603.23 │  38302.78 │    0.98 │
│      Multivariate 10k │ 10000 │    mooncake │             typed │   true │  33284.46 │  75318.18 │    0.44 │ 10.06 │    6.14 │    1.64 │ 334891.43 │ 462645.91 │    0.72 │
│       Multivariate 1k │  1000 │    mooncake │             typed │   true │   3645.94 │   3593.73 │    1.01 │ 12.76 │    9.29 │    1.37 │  46516.54 │  33375.74 │    1.39 │
├───────────────────────┼───────┼─────────────┼───────────────────┼────────┼───────────┼───────────┼─────────┼───────┼─────────┼─────────┼───────────┼───────────┼─────────┤
│ Simple assume observe │     1 │ forwarddiff │             typed │  false │      2.75 │      2.69 │    1.02 │  3.94 │    4.01 │    0.98 │     10.83 │     10.78 │    1.00 │
│           Smorgasbord │   201 │ forwarddiff │             typed │  false │   1216.41 │   1222.03 │    1.00 │ 63.26 │   64.23 │    0.98 │  76947.07 │  78491.54 │    0.98 │
│           Smorgasbord │   201 │ forwarddiff │       simple_dict │   true │       err │       err │     err │   err │     err │     err │       err │       err │     err │
├───────────────────────┼───────┼─────────────┼───────────────────┼────────┼───────────┼───────────┼─────────┼───────┼─────────┼─────────┼───────────┼───────────┼─────────┤
│           Smorgasbord │   201 │ forwarddiff │ simple_namedtuple │   true │       err │       err │     err │   err │     err │     err │       err │       err │     err │
│           Smorgasbord │   201 │      enzyme │             typed │   true │   1673.06 │   1690.43 │    0.99 │  6.76 │    5.40 │    1.25 │  11313.27 │   9136.45 │    1.24 │
│           Smorgasbord │   201 │    mooncake │             typed │   true │   1677.76 │   1685.75 │    1.00 │  5.28 │    5.40 │    0.98 │   8852.73 │   9110.41 │    0.97 │
├───────────────────────┼───────┼─────────────┼───────────────────┼────────┼───────────┼───────────┼─────────┼───────┼─────────┼─────────┼───────────┼───────────┼─────────┤
│           Smorgasbord │   201 │ reversediff │             typed │   true │   1697.35 │   1743.22 │    0.97 │ 86.95 │   89.83 │    0.97 │ 147586.82 │ 156586.08 │    0.94 │
│           Smorgasbord │   201 │ forwarddiff │      typed_vector │   true │   1676.98 │   1701.53 │    0.99 │ 59.95 │   58.92 │    1.02 │ 100530.75 │ 100257.95 │    1.00 │
│           Smorgasbord │   201 │ forwarddiff │           untyped │   true │   1687.95 │   1688.86 │    1.00 │ 64.85 │  125.87 │    0.52 │ 109468.97 │ 212569.83 │    0.51 │
├───────────────────────┼───────┼─────────────┼───────────────────┼────────┼───────────┼───────────┼─────────┼───────┼─────────┼─────────┼───────────┼───────────┼─────────┤
│           Smorgasbord │   201 │ forwarddiff │    untyped_vector │   true │   1672.63 │   1705.46 │    0.98 │ 60.95 │   58.53 │    1.04 │ 101941.68 │  99822.96 │    1.02 │
│              Submodel │     1 │    mooncake │             typed │   true │      7.53 │      7.19 │    1.05 │  4.87 │    5.14 │    0.95 │     36.67 │     36.95 │    0.99 │
└───────────────────────┴───────┴─────────────┴───────────────────┴────────┴───────────┴───────────┴─────────┴───────┴─────────┴─────────┴───────────┴───────────┴─────────┘

@github-actions
Copy link
Contributor

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

@codecov
Copy link

codecov bot commented Dec 12, 2025

Codecov Report

❌ Patch coverage is 58.33333% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.90%. Comparing base (6266f64) to head (d46bbd0).

Files with missing lines Patch % Lines
src/threadsafe.jl 0.00% 8 Missing ⚠️
src/test_utils/model_interface.jl 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1173      +/-   ##
==========================================
- Coverage   78.95%   78.90%   -0.06%     
==========================================
  Files          41       41              
  Lines        3896     3910      +14     
==========================================
+ Hits         3076     3085       +9     
- Misses        820      825       +5     

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

@mhauru mhauru marked this pull request as ready for review December 12, 2025 11:52
@mhauru mhauru requested a review from penelopeysm December 12, 2025 11:52
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.

Otherwise looks great!

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.

3 participants