Skip to content

Move FlexiChains ext to here#1379

Closed
penelopeysm wants to merge 4 commits into
mainfrom
py/fc
Closed

Move FlexiChains ext to here#1379
penelopeysm wants to merge 4 commits into
mainfrom
py/fc

Conversation

@penelopeysm
Copy link
Copy Markdown
Member

@penelopeysm penelopeysm commented May 1, 2026

This will almost certainly cause problems immediately because FlexiChains still has a DynamicPPL extension. I'll do a simultaneous release on FlexiChains to get rid of the duplicated code.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

Benchmark Report

  • this PR's head: 13e83763f29c899f9e312eb213f95f68df454d15
  • base branch: b854e0dace0aff9cebca817ace0d4a505dfb306e

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 │   280.42 │   270.62 │    1.04 │   7.59 │     8.66 │    0.88 │   2127.10 │     2344.71 │    0.91 │
│                   LDA │    12 │ reversediff │   true │  2627.18 │  2437.19 │    1.08 │   1.96 │     2.32 │    0.85 │   5152.34 │     5643.26 │    0.91 │
│   Loop univariate 10k │ 10000 │    mooncake │   true │ 30499.34 │ 29534.58 │    1.03 │   8.85 │     7.60 │    1.16 │ 269853.17 │   224485.10 │    1.20 │
├───────────────────────┼───────┼─────────────┼────────┼──────────┼──────────┼─────────┼────────┼──────────┼─────────┼───────────┼─────────────┼─────────┤
│    Loop univariate 1k │  1000 │    mooncake │   true │  4164.53 │  3006.67 │    1.39 │   6.41 │     7.41 │    0.86 │  26683.16 │    22290.39 │    1.20 │
│      Multivariate 10k │ 10000 │    mooncake │   true │ 36331.93 │ 29862.68 │    1.22 │   9.03 │    10.63 │    0.85 │ 327905.68 │   317498.87 │    1.03 │
│       Multivariate 1k │  1000 │    mooncake │   true │  4497.36 │  3326.83 │    1.35 │   7.75 │     9.68 │    0.80 │  34864.29 │    32189.93 │    1.08 │
├───────────────────────┼───────┼─────────────┼────────┼──────────┼──────────┼─────────┼────────┼──────────┼─────────┼───────────┼─────────────┼─────────┤
│ Simple assume observe │     1 │ forwarddiff │  false │     0.92 │     0.85 │    1.08 │  11.22 │    10.42 │    1.08 │     10.28 │        8.82 │    1.17 │
│           Smorgasbord │   201 │ forwarddiff │  false │   976.09 │   900.93 │    1.08 │  75.94 │ 37906.78 │    0.00 │  74120.75 │ 34151195.22 │    0.00 │
│           Smorgasbord │   201 │      enzyme │   true │  1347.60 │  1237.83 │    1.09 │   4.50 │     4.95 │    0.91 │   6059.44 │     6130.35 │    0.99 │
├───────────────────────┼───────┼─────────────┼────────┼──────────┼──────────┼─────────┼────────┼──────────┼─────────┼───────────┼─────────────┼─────────┤
│           Smorgasbord │   201 │ forwarddiff │   true │  1362.36 │  1248.46 │    1.09 │  71.48 │    72.50 │    0.99 │  97376.98 │    90513.09 │    1.08 │
│           Smorgasbord │   201 │    mooncake │   true │  1382.51 │  1239.76 │    1.12 │   4.88 │     5.16 │    0.95 │   6751.52 │     6400.73 │    1.05 │
│           Smorgasbord │   201 │ reversediff │   true │  1351.54 │  1244.57 │    1.09 │ 122.33 │   132.63 │    0.92 │ 165330.00 │   165064.83 │    1.00 │
├───────────────────────┼───────┼─────────────┼────────┼──────────┼──────────┼─────────┼────────┼──────────┼─────────┼───────────┼─────────────┼─────────┤
│              Submodel │     1 │    mooncake │   true │     0.92 │     0.85 │    1.09 │  32.58 │    28.86 │    1.13 │     30.03 │       24.43 │    1.23 │
└───────────────────────┴───────┴─────────────┴────────┴──────────┴──────────┴─────────┴────────┴──────────┴─────────┴───────────┴─────────────┴─────────┘

@codecov
Copy link
Copy Markdown

codecov Bot commented May 1, 2026

Codecov Report

❌ Patch coverage is 16.21622% with 155 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.08%. Comparing base (b854e0d) to head (13e8376).

Files with missing lines Patch % Lines
ext/DynamicPPLFlexiChainsExt.jl 14.83% 155 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1379      +/-   ##
==========================================
- Coverage   82.26%   79.08%   -3.18%     
==========================================
  Files          49       51       +2     
  Lines        3512     3692     +180     
==========================================
+ Hits         2889     2920      +31     
- Misses        623      772     +149     

☔ 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

github-actions Bot commented May 1, 2026

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

@yebai
Copy link
Copy Markdown
Member

yebai commented May 1, 2026

@penelopeysm, is there a reason why you prefer this to be in DynamicPPL?

@penelopeysm
Copy link
Copy Markdown
Member Author

Yes -- in fact I would prefer to keep it in FlexiChains. However, unfortunately, if FC has an extension (and thus a compat bound) on DPPL, DPPL will never be able to release a breaking version because there will be no version of FC that will work with it. This is the same problem as in #740.

@penelopeysm
Copy link
Copy Markdown
Member Author

(This is kinda what I meant when I said that it's a faff to make FlexiChains a hard dep of Turing -- I have to move the DPPL ext and Turing exts here.)

@penelopeysm
Copy link
Copy Markdown
Member Author

Hmmmmmmm, thinking about it, I might be wrong here. The DynamicPPL ext can still live there, but the Turing ext has to be moved to Turing. That would probably make life easier.

It does mean that the testing can only happen on the FlexiChains side, which one might consider a bit dangerous. But that's what happens now anyway, so it's no major loss compared to the current situation.

@penelopeysm penelopeysm closed this May 1, 2026
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