Use AbstractPPL AD interface in tests.#460
Merged
Merged
Conversation
Contributor
|
Bijectors.jl documentation for PR #460 is available at: |
876b60e to
a0d363b
Compare
yebai
commented
May 18, 2026
| @testset "Mooncake bijector AD" begin | ||
| for c in generate_ad_testcases(), adtype in adtypes | ||
| run_ad_case(c, adtype) | ||
| # AbstractPPL's Mooncake extension routes `AutoMooncakeForward` through |
Member
Author
There was a problem hiding this comment.
This is a Mooncake bug -- hopefully it will get fixed as part of chalk-lab/Mooncake.jl#1151
a7a9eb1 to
4ccf99a
Compare
`src/vector/test_utils.jl` and `test/test_resources.jl` route all AD calls through `AbstractPPL.prepare` + `value_and_jacobian!!` / `value_and_gradient!!` in place of `DifferentiationInterface.jacobian` / `DI.gradient`. The package no longer depends on DifferentiationInterface directly; it remains a transitive test dep so AbstractPPL can dispatch to the DI extension for the `AutoForwardDiff` reference and for any other adtype that lacks a direct AbstractPPL extension. Other changes that follow from the routing switch: - `Project.toml` and the per-integration-suite `Project.toml`s bump `AbstractPPL = "0.15"` and add `ADTypes = "1"`; DI moves to a test-only dep. - `src/vector/test_utils.jl`: `test_optics` and `test_logjac` skip the AD-based check for discrete distributions — `AbstractPPL.prepare` rejects the integer vectors that `to_vec(d)` returns, and those checks are tautological for identity link transforms anyway. - `test/integration_tests/mooncake/main.jl`: PlanarLayer-inverse cases under `AutoMooncakeForward` hit Mooncake's batched NDual code path, which has no rule for `find_alpha`, so mark them `broken=true`. - `test/integration_tests/enzyme/main.jl`: the triple-nested product cases throw an Enzyme runtime `TypeError` that `@test_broken` doesn't reliably catch; switch to `skip=true` so non-AD checks still run. - `docs/src/defining_examples.md`: the StereographicProj example now uses `ForwardDiff.jacobian` directly instead of `DI.jacobian`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4ccf99a to
795cb59
Compare
Member
Author
|
@sunxd3, this should be ready for a final look. |
sunxd3
reviewed
May 21, 2026
Member
sunxd3
left a comment
There was a problem hiding this comment.
sorry for nagging,
Bijectors.jl/docs/src/vector.md
Lines 110 to 123 in ff2818a
need to be updated again on because
default_adtypes is now empty
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Member
Author
|
All addressed @sunxd3! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replacing #458
TODO
min/ LTS tests.