Skip to content

Add Turing integration tests (and more Bijectors tests)#2863

Merged
wsmoses merged 8 commits intoEnzymeAD:mainfrom
penelopeysm:main
Jan 6, 2026
Merged

Add Turing integration tests (and more Bijectors tests)#2863
wsmoses merged 8 commits intoEnzymeAD:mainfrom
penelopeysm:main

Conversation

@penelopeysm
Copy link
Copy Markdown
Contributor

Merry Christmas! 🙂

So, I've gotten the AD tests in Turing CI to work with Enzyme. This PR essentially contains a duplicate of those tests. #2528

I haven't timed this exact set of tests but I believe it should take around 15-20 minutes on a GitHub runner.

I would mention that Turing/DynamicPPL exclusively use Enzyme via DI. I could rewrite the first testset to use Enzyme directly without too much faff, but the second one would be very annoying to rewrite and would involve a lot of Turing internals, so I hope that this is okay.

Separately, Bijectors had some tests that used to fail, but this seems to have been fixed recently (I didn't investigate which patch fixed it), so I've added some of those tests here too.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 26, 2025

Your PR no longer requires formatting changes. Thank you for your contribution!

Comment on lines +11 to +14
adtypes = (
AutoEnzyme(; mode = Enzyme.set_runtime_activity(Enzyme.Forward), function_annotation = Enzyme.Const),
AutoEnzyme(; mode = Enzyme.set_runtime_activity(Enzyme.Reverse), function_annotation = Enzyme.Const),
)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

once TuringLang/DynamicPPL.jl#1172 is in it shouldn't need Const.

@wsmoses
Copy link
Copy Markdown
Member

wsmoses commented Dec 27, 2025

1.10 tests fail

@penelopeysm
Copy link
Copy Markdown
Contributor Author

Took a while to get through the sea of Gibbs sampler code. I've posted a minimiser in an issue, but I also think TuringLang/DynamicPPL.jl#1188 should fix it too. Will push a new commit when that's released!

@penelopeysm
Copy link
Copy Markdown
Contributor Author

Updated DynamicPPL version; tests on Julia 1.10 work locally for me now.

@penelopeysm
Copy link
Copy Markdown
Contributor Author

@wsmoses CI passed on the previous commit (at least for the Turing tests; I assume the Comrade tests are not mine to fix 🙂)

@wsmoses
Copy link
Copy Markdown
Member

wsmoses commented Jan 5, 2026

its all green!

one minor thing, in the bijectors tests where we set runtime activity to true, can we first check test_throws EnzymeRuntimeActivityError for that case [that way we confirm its required]

@penelopeysm
Copy link
Copy Markdown
Contributor Author

Good idea, done that! I also updated the Turing tests since we changed it to not need a closure and hence doesn't need Const

@penelopeysm
Copy link
Copy Markdown
Contributor Author

I reckon that should all be fine now, tested locally too with both versions 😅

@wsmoses wsmoses merged commit 4c838e0 into EnzymeAD:main Jan 6, 2026
24 checks passed
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