Skip to content

check length on unflatten!!#1341

Merged
penelopeysm merged 2 commits intomainfrom
py/unflatten-checks
Mar 30, 2026
Merged

check length on unflatten!!#1341
penelopeysm merged 2 commits intomainfrom
py/unflatten-checks

Conversation

@penelopeysm
Copy link
Copy Markdown
Member

@penelopeysm penelopeysm commented Mar 30, 2026

Closes #987

Uncovered a bug in the test suite ....

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 30, 2026

Benchmark Report

  • this PR's head: 1d499c480193ecea2a020ac2846f871bd3f84a72
  • base branch: 23bd87cb89359b5ca9e45eb956165b12ae3c10d4

Computer Information

Julia Version 1.11.9
Commit 53a02c0720c (2026-02-06 00:27 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 │ Linked │     base │  this PR │ speedup │   base │ this PR │ speedup │      base │   this PR │ speedup │
├───────────────────────┼───────┼─────────────┼────────┼──────────┼──────────┼─────────┼────────┼─────────┼─────────┼───────────┼───────────┼─────────┤
│               Dynamic │    10 │    mooncake │   true │   257.67 │   275.74 │    0.93 │  11.10 │    7.58 │    1.46 │   2859.12 │   2089.97 │    1.37 │
│                   LDA │    12 │ reversediff │   true │  2350.67 │  2595.02 │    0.91 │   2.18 │    1.97 │    1.11 │   5135.38 │   5112.12 │    1.00 │
│   Loop univariate 10k │ 10000 │    mooncake │   true │ 28586.78 │ 30429.96 │    0.94 │   6.32 │    6.52 │    0.97 │ 180695.25 │ 198294.30 │    0.91 │
├───────────────────────┼───────┼─────────────┼────────┼──────────┼──────────┼─────────┼────────┼─────────┼─────────┼───────────┼───────────┼─────────┤
│    Loop univariate 1k │  1000 │    mooncake │   true │  2905.88 │  3087.52 │    0.94 │   6.17 │    6.37 │    0.97 │  17938.63 │  19678.82 │    0.91 │
│      Multivariate 10k │ 10000 │    mooncake │   true │ 29250.91 │ 31652.56 │    0.92 │   9.86 │    9.82 │    1.00 │ 288472.60 │ 310681.00 │    0.93 │
│       Multivariate 1k │  1000 │    mooncake │   true │  3188.37 │  3350.65 │    0.95 │   9.22 │    9.36 │    0.99 │  29395.59 │  31348.93 │    0.94 │
├───────────────────────┼───────┼─────────────┼────────┼──────────┼──────────┼─────────┼────────┼─────────┼─────────┼───────────┼───────────┼─────────┤
│ Simple assume observe │     1 │ forwarddiff │  false │     1.02 │     0.86 │    1.18 │   8.32 │   10.39 │    0.80 │      8.48 │      8.95 │    0.95 │
│           Smorgasbord │   201 │ forwarddiff │  false │   896.66 │   929.93 │    0.96 │  74.16 │   73.98 │    1.00 │  66494.12 │  68796.14 │    0.97 │
│           Smorgasbord │   201 │      enzyme │   true │  1197.34 │  1269.31 │    0.94 │   4.90 │    4.90 │    1.00 │   5862.92 │   6217.75 │    0.94 │
├───────────────────────┼───────┼─────────────┼────────┼──────────┼──────────┼─────────┼────────┼─────────┼─────────┼───────────┼───────────┼─────────┤
│           Smorgasbord │   201 │ forwarddiff │   true │  1599.68 │  1694.48 │    0.94 │  58.97 │   52.79 │    1.12 │  94338.24 │  89456.37 │    1.05 │
│           Smorgasbord │   201 │    mooncake │   true │  1213.89 │  1290.88 │    0.94 │   4.75 │    4.63 │    1.03 │   5771.87 │   5970.76 │    0.97 │
│           Smorgasbord │   201 │ reversediff │   true │  1252.72 │  1641.82 │    0.76 │ 123.14 │   98.52 │    1.25 │ 154261.30 │ 161748.88 │    0.95 │
├───────────────────────┼───────┼─────────────┼────────┼──────────┼──────────┼─────────┼────────┼─────────┼─────────┼───────────┼───────────┼─────────┤
│              Submodel │     1 │    mooncake │   true │     0.93 │     0.86 │    1.08 │  23.26 │   26.98 │    0.86 │     21.71 │     23.22 │    0.93 │
└───────────────────────┴───────┴─────────────┴────────┴──────────┴──────────┴─────────┴────────┴─────────┴─────────┴───────────┴───────────┴─────────┘

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.43%. Comparing base (61eda05) to head (1d499c4).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1341      +/-   ##
==========================================
+ Coverage   78.13%   78.43%   +0.29%     
==========================================
  Files          50       50              
  Lines        3590     3593       +3     
==========================================
+ Hits         2805     2818      +13     
+ Misses        785      775      -10     

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

@github-actions
Copy link
Copy Markdown
Contributor

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

@penelopeysm penelopeysm merged commit 2748445 into main Mar 30, 2026
22 checks passed
@penelopeysm penelopeysm deleted the py/unflatten-checks branch March 30, 2026 17: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.

unflatten doesn't tell you if there are too many parameters

1 participant