Skip to content

Conversation

penelopeysm
Copy link
Member

@penelopeysm penelopeysm commented Aug 14, 2025

This PR reworks most of Bijectors' CI setup to be more manageable.

  • Use DifferentiationInterface instead of directly calling ForwardDiff.gradient, etc.

  • Test all AD backends in a single CI job. The tests don't take very long at all so this is not a problem in terms of time. It also allows us to restructure the test_ad function so that we can more surgically disable / enable tests. The previous one was very awkward to work with.

  • Disable / enable failing Enzyme tests as needed to make CI pass without the use of continue-on-error. Where possible we use @test_throws instead of just skipping the test as that will let us know if and when a test begins to work

  • Separate doctests into a standalone CI job that only runs on 1.11. Doctest output can depend on Julia version so it can be very fragile running doctests on multiple different CI setups.

  • Cache the Julia environment in CI. Saves time.

  • Add a couple of CI runners on Windows.

Closes #373
Closes #347 (not directly, but I think the intent behind that was really 'clean up the Enzyme tests', and this PR does so)

Copy link
Contributor

Bijectors.jl documentation for PR #406 is available at:
https://TuringLang.github.io/Bijectors.jl/previews/PR406/

@penelopeysm penelopeysm changed the title Refactor AD tests Refactor CI Aug 14, 2025
@TuringLang TuringLang deleted a comment from github-actions bot Aug 14, 2025
@TuringLang TuringLang deleted a comment from github-actions bot Aug 14, 2025
@penelopeysm penelopeysm marked this pull request as draft August 14, 2025 22:43
@TuringLang TuringLang deleted a comment from github-actions bot Aug 15, 2025
@TuringLang TuringLang deleted a comment from github-actions bot Aug 15, 2025
@penelopeysm
Copy link
Member Author

penelopeysm commented Aug 15, 2025

Well look at that those green ticks, not had that for a while on Bijectors.

@penelopeysm penelopeysm marked this pull request as ready for review August 15, 2025 00:47
Copy link
Member Author

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

Some comments (hopefully helpful)

Copy link
Member Author

Choose a reason for hiding this comment

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

Subsumed into CI.yml.

Comment on lines +19 to +20
# TODO: Remove this
warnonly=true,
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a replacement for strict=false which no longer works with Documenter.jl v1.0. It converts all docs errors into warnings. This is not good, but I didn't want fix this in this PR as well, it should be a separate PR.

@@ -29,43 +34,6 @@ end
test_frule(Bijectors.find_alpha, x, y, z)
test_rrule(Bijectors.find_alpha, x, y, z)

if @isdefined Mooncake
Copy link
Member Author

Choose a reason for hiding this comment

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

moved to test/ad/mooncake.jl

@@ -108,19 +108,3 @@ function test_functor(x, xs)
@test x == re(_xs)
@test _xs == xs
end

function test_bijector_parameter_gradient(b::Bijectors.Transform, x, y=b(x))
Copy link
Member Author

@penelopeysm penelopeysm Aug 15, 2025

Choose a reason for hiding this comment

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

this function was not being used anywhere so can be deleted

test/ad/utils.jl Outdated
Copy link
Member Author

Choose a reason for hiding this comment

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

this file is no longer needed, the test_ad function is directly defined in test/runtests.jl

@TuringLang TuringLang deleted a comment from github-actions bot Aug 22, 2025
@TuringLang TuringLang deleted a comment from github-actions bot Aug 22, 2025
@TuringLang TuringLang deleted a comment from github-actions bot Aug 22, 2025
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.

Replace ForwardDiff/ReverseDiff/Zygote/Mooncake/Enzyme gradient call with DifferentiationInterface. Move all Enzyme related tests into a seprate CI
1 participant