From 38bf195ce96da238ae0b9cc72763caedd81d3fab Mon Sep 17 00:00:00 2001 From: WT Date: Tue, 20 Jul 2021 18:36:32 +0100 Subject: [PATCH 1/7] Make failing tests --- test/basekernels/fbm.jl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/basekernels/fbm.jl b/test/basekernels/fbm.jl index 3fe58dd0a..737c8abf3 100644 --- a/test/basekernels/fbm.jl +++ b/test/basekernels/fbm.jl @@ -13,7 +13,13 @@ test_interface(k) @test repr(k) == "Fractional Brownian Motion Kernel (h = $(h))" - test_ADs(FBMKernel; ADs=[:ReverseDiff, :Zygote]) - @test_broken "Tests failing for kernelmatrix(k, x) for ForwardDiff" + test_ADs(FBMKernel; ADs=[:ReverseDiff]) + + # Tests failing for ForwardDiff + @test_broken !isinf(ForwardDiff.gradient(x -> x[1]^x[2], [0.0, 0.9])[1]) + + # Zygote also doesn't work. + @test_broken !isinf(Zygote.gradient((x, y) -> sum(f.(x, y)), zeros(1), fill(0.9, 1))[1][1]) + test_params(k, ([h],)) end From 76957c2ee28c5840806d2a725a330892332175e4 Mon Sep 17 00:00:00 2001 From: WT Date: Tue, 20 Jul 2021 18:37:42 +0100 Subject: [PATCH 2/7] Document failures better --- test/basekernels/fbm.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/basekernels/fbm.jl b/test/basekernels/fbm.jl index 737c8abf3..1c4980ee1 100644 --- a/test/basekernels/fbm.jl +++ b/test/basekernels/fbm.jl @@ -15,10 +15,10 @@ @test repr(k) == "Fractional Brownian Motion Kernel (h = $(h))" test_ADs(FBMKernel; ADs=[:ReverseDiff]) - # Tests failing for ForwardDiff - @test_broken !isinf(ForwardDiff.gradient(x -> x[1]^x[2], [0.0, 0.9])[1]) - # Zygote also doesn't work. + # Tests failing for ForwardDiff and Zygote. + # Related to: https://github.com/FluxML/Zygote.jl/issues/1036 + @test_broken !isinf(ForwardDiff.gradient(x -> x[1]^x[2], [0.0, 0.9])[1]) @test_broken !isinf(Zygote.gradient((x, y) -> sum(f.(x, y)), zeros(1), fill(0.9, 1))[1][1]) test_params(k, ([h],)) From aef0d3a47c715b07a55db8c88b973aa6127c447b Mon Sep 17 00:00:00 2001 From: willtebbutt Date: Tue, 20 Jul 2021 18:40:03 +0100 Subject: [PATCH 3/7] Fix style suggestion Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- test/basekernels/fbm.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/basekernels/fbm.jl b/test/basekernels/fbm.jl index 1c4980ee1..80e4732a3 100644 --- a/test/basekernels/fbm.jl +++ b/test/basekernels/fbm.jl @@ -19,7 +19,9 @@ # Tests failing for ForwardDiff and Zygote. # Related to: https://github.com/FluxML/Zygote.jl/issues/1036 @test_broken !isinf(ForwardDiff.gradient(x -> x[1]^x[2], [0.0, 0.9])[1]) - @test_broken !isinf(Zygote.gradient((x, y) -> sum(f.(x, y)), zeros(1), fill(0.9, 1))[1][1]) + @test_broken !isinf( + Zygote.gradient((x, y) -> sum(f.(x, y)), zeros(1), fill(0.9, 1))[1][1] + ) test_params(k, ([h],)) end From bdd2365d5aa90590a64867da9aa5e88164a11c49 Mon Sep 17 00:00:00 2001 From: willtebbutt Date: Tue, 20 Jul 2021 18:40:12 +0100 Subject: [PATCH 4/7] Fix style suggestion Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- test/basekernels/fbm.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/test/basekernels/fbm.jl b/test/basekernels/fbm.jl index 80e4732a3..e94a51aa2 100644 --- a/test/basekernels/fbm.jl +++ b/test/basekernels/fbm.jl @@ -15,7 +15,6 @@ @test repr(k) == "Fractional Brownian Motion Kernel (h = $(h))" test_ADs(FBMKernel; ADs=[:ReverseDiff]) - # Tests failing for ForwardDiff and Zygote. # Related to: https://github.com/FluxML/Zygote.jl/issues/1036 @test_broken !isinf(ForwardDiff.gradient(x -> x[1]^x[2], [0.0, 0.9])[1]) From 162b6b2b92d061ffa8a3d458438975c7e23f471e Mon Sep 17 00:00:00 2001 From: willtebbutt Date: Tue, 20 Jul 2021 18:48:12 +0100 Subject: [PATCH 5/7] Define f Co-authored-by: st-- --- test/basekernels/fbm.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/test/basekernels/fbm.jl b/test/basekernels/fbm.jl index e94a51aa2..d34fde429 100644 --- a/test/basekernels/fbm.jl +++ b/test/basekernels/fbm.jl @@ -18,6 +18,7 @@ # Tests failing for ForwardDiff and Zygote. # Related to: https://github.com/FluxML/Zygote.jl/issues/1036 @test_broken !isinf(ForwardDiff.gradient(x -> x[1]^x[2], [0.0, 0.9])[1]) + f(x, y) = x ^ y @test_broken !isinf( Zygote.gradient((x, y) -> sum(f.(x, y)), zeros(1), fill(0.9, 1))[1][1] ) From f8a270fdda167bdff3651bb160e9f831f01bf986 Mon Sep 17 00:00:00 2001 From: willtebbutt Date: Tue, 20 Jul 2021 18:56:00 +0100 Subject: [PATCH 6/7] Style Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- test/basekernels/fbm.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/basekernels/fbm.jl b/test/basekernels/fbm.jl index d34fde429..c39534e21 100644 --- a/test/basekernels/fbm.jl +++ b/test/basekernels/fbm.jl @@ -18,7 +18,7 @@ # Tests failing for ForwardDiff and Zygote. # Related to: https://github.com/FluxML/Zygote.jl/issues/1036 @test_broken !isinf(ForwardDiff.gradient(x -> x[1]^x[2], [0.0, 0.9])[1]) - f(x, y) = x ^ y + f(x, y) = x^y @test_broken !isinf( Zygote.gradient((x, y) -> sum(f.(x, y)), zeros(1), fill(0.9, 1))[1][1] ) From fe1ad20514feac392bf41d2f8f57f5cc0925dd18 Mon Sep 17 00:00:00 2001 From: WT Date: Tue, 20 Jul 2021 19:37:02 +0100 Subject: [PATCH 7/7] Only run breaking test on 1.6 --- test/basekernels/fbm.jl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/basekernels/fbm.jl b/test/basekernels/fbm.jl index e94a51aa2..8239354f5 100644 --- a/test/basekernels/fbm.jl +++ b/test/basekernels/fbm.jl @@ -15,12 +15,17 @@ @test repr(k) == "Fractional Brownian Motion Kernel (h = $(h))" test_ADs(FBMKernel; ADs=[:ReverseDiff]) - # Tests failing for ForwardDiff and Zygote. + # Tests failing for ForwardDiff and Zygote@0.6 (obtained with Julia > 1.3). # Related to: https://github.com/FluxML/Zygote.jl/issues/1036 @test_broken !isinf(ForwardDiff.gradient(x -> x[1]^x[2], [0.0, 0.9])[1]) - @test_broken !isinf( - Zygote.gradient((x, y) -> sum(f.(x, y)), zeros(1), fill(0.9, 1))[1][1] - ) + if VERSION >= v"1.4.0" + f(x, y) = x ^ y + @test_broken !isinf( + Zygote.gradient((x, y) -> sum(f.(x, y)), zeros(1), fill(0.9, 1))[1][1] + ) + else + test_ADs(FBMKernel; ADs=[:Zygote]) + end test_params(k, ([h],)) end