From d3eafb25d81085482973028964061afe1f51be58 Mon Sep 17 00:00:00 2001 From: Penelope Yong Date: Wed, 6 Nov 2024 21:23:00 +0000 Subject: [PATCH] Un-re-enable 1.11 Enzyme tests --- test/Project.toml | 1 + test/ad/flows.jl | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/test/Project.toml b/test/Project.toml index 333070f4..dc1848a5 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -1,6 +1,7 @@ [deps] AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001" AdvancedHMC = "0bf59076-c3b1-5ca4-86bd-e02cd72cde3d" +Bijectors = "76274a88-744f-5084-9051-94815aaf08c4" ChainRulesTestUtils = "cdddcdb0-9152-4a09-a978-84456f9df70a" ChangesOfVariables = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0" Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa" diff --git a/test/ad/flows.jl b/test/ad/flows.jl index 243118a2..100c264b 100644 --- a/test/ad/flows.jl +++ b/test/ad/flows.jl @@ -1,6 +1,10 @@ @testset "PlanarLayer" begin - # TODO(mhauru) Remove the EnzymeReverse marks once this has been fixed: - # https://github.com/EnzymeAD/Enzyme.jl/issues/2030 + if v"1.11" <= VERSION < v"1.12" + broken = (:EnzymeForwardCrash,) + else + broken = () + end + # logpdf of a flow with a planar layer and two-dimensional inputs test_ad(randn(7)) do θ layer = PlanarLayer(θ[1:2], θ[3:4], θ[5:5]) @@ -8,7 +12,7 @@ x = θ[6:7] return logpdf(flow.dist, x) - logabsdetjac(flow.transform, x) end - test_ad(randn(11)) do θ + test_ad(randn(11), broken) do θ layer = PlanarLayer(θ[1:2], θ[3:4], θ[5:5]) flow = transformed(MvNormal(zeros(2), I), layer) x = reshape(θ[6:end], 2, :) @@ -22,7 +26,7 @@ x = θ[6:7] return logpdf(flow.dist, x) - logabsdetjac(flow.transform, x) end - test_ad(randn(11)) do θ + test_ad(randn(11), broken) do θ layer = PlanarLayer(θ[1:2], θ[3:4], θ[5:5]) flow = transformed(MvNormal(zeros(2), I), inverse(layer)) x = reshape(θ[6:end], 2, :)