From 9f0c407728e1768a8805e54ae31bdad7232f7ff2 Mon Sep 17 00:00:00 2001 From: ST John Date: Fri, 19 Nov 2021 15:07:33 +0200 Subject: [PATCH 1/6] restrict Zygote to <0.6.30 --- test/Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Project.toml b/test/Project.toml index ef3a56dc2..86d16ed83 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -27,4 +27,4 @@ LogExpFunctions = "0.2, 0.3" PDMats = "0.9, 0.10, 0.11" ReverseDiff = "1.2" SpecialFunctions = "0.10, 1" -Zygote = "0.4, 0.5, 0.6" +Zygote = "0.4, 0.5, <0.6.30" From bc534786fc8db030f9826874becbc3667e2ebee0 Mon Sep 17 00:00:00 2001 From: ST John Date: Fri, 19 Nov 2021 16:31:12 +0200 Subject: [PATCH 2/6] revert Zygote test restriction and add finer-grained testset --- test/Project.toml | 2 +- test/utils.jl | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/test/Project.toml b/test/Project.toml index 86d16ed83..ef3a56dc2 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -27,4 +27,4 @@ LogExpFunctions = "0.2, 0.3" PDMats = "0.9, 0.10, 0.11" ReverseDiff = "1.2" SpecialFunctions = "0.10, 1" -Zygote = "0.4, 0.5, <0.6.30" +Zygote = "0.4, 0.5, 0.6" diff --git a/test/utils.jl b/test/utils.jl index aacd27348..1cbb3d1ec 100644 --- a/test/utils.jl +++ b/test/utils.jl @@ -59,12 +59,16 @@ y = ColVecs(randn(2, 3)) # Ensure KernelFunctions.pairwise rather than Distances.pairwise is used. - check_zygote_type_stability( - x -> KernelFunctions.pairwise(SqEuclidean(), x), x; ctx=ctx - ) - check_zygote_type_stability( - (x, y) -> KernelFunctions.pairwise(SqEuclidean(), x, y), x, y; ctx=ctx - ) + @testset "single-argument" begin + check_zygote_type_stability( + x -> KernelFunctions.pairwise(SqEuclidean(), x), x; ctx=ctx + ) + end + @testset "two-argument" begin + check_zygote_type_stability( + (x, y) -> KernelFunctions.pairwise(SqEuclidean(), x, y), x, y; ctx=ctx + ) + end end end end From a63445bd3247614863da6fbd1615e5b5173ca864 Mon Sep 17 00:00:00 2001 From: st-- Date: Fri, 19 Nov 2021 16:36:27 +0200 Subject: [PATCH 3/6] Update test/utils.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- test/utils.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/utils.jl b/test/utils.jl index 1cbb3d1ec..e288c5f0c 100644 --- a/test/utils.jl +++ b/test/utils.jl @@ -66,7 +66,10 @@ end @testset "two-argument" begin check_zygote_type_stability( - (x, y) -> KernelFunctions.pairwise(SqEuclidean(), x, y), x, y; ctx=ctx + (x, y) -> KernelFunctions.pairwise(SqEuclidean(), x, y), + x, + y; + ctx=ctx, ) end end From 153aa5f05da46adb913403a7937d3d6456e5e80d Mon Sep 17 00:00:00 2001 From: ST John Date: Mon, 22 Nov 2021 17:12:18 +0200 Subject: [PATCH 4/6] revert testset --- test/utils.jl | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/test/utils.jl b/test/utils.jl index e288c5f0c..aacd27348 100644 --- a/test/utils.jl +++ b/test/utils.jl @@ -59,19 +59,12 @@ y = ColVecs(randn(2, 3)) # Ensure KernelFunctions.pairwise rather than Distances.pairwise is used. - @testset "single-argument" begin - check_zygote_type_stability( - x -> KernelFunctions.pairwise(SqEuclidean(), x), x; ctx=ctx - ) - end - @testset "two-argument" begin - check_zygote_type_stability( - (x, y) -> KernelFunctions.pairwise(SqEuclidean(), x, y), - x, - y; - ctx=ctx, - ) - end + check_zygote_type_stability( + x -> KernelFunctions.pairwise(SqEuclidean(), x), x; ctx=ctx + ) + check_zygote_type_stability( + (x, y) -> KernelFunctions.pairwise(SqEuclidean(), x, y), x, y; ctx=ctx + ) end end end From fa820f4ee55a337f816d9e2743c0f234b6cd8cd0 Mon Sep 17 00:00:00 2001 From: ST John Date: Mon, 22 Nov 2021 17:12:30 +0200 Subject: [PATCH 5/6] mark test_broken --- test/test_utils.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_utils.jl b/test/test_utils.jl index 22fe9fb08..ab9ee1632 100644 --- a/test/test_utils.jl +++ b/test/test_utils.jl @@ -100,7 +100,7 @@ function check_zygote_type_stability(f, args...; ctx=Zygote.Context()) @inferred f(args...) @inferred Zygote._pullback(ctx, f, args...) out, pb = Zygote._pullback(ctx, f, args...) - @inferred pb(out) + @test_broken @inferred pb(out) end function test_ADs( From b135c7abc112d419db0451f87470256e859e9653 Mon Sep 17 00:00:00 2001 From: David Widmann Date: Wed, 24 Nov 2021 17:34:56 +0100 Subject: [PATCH 6/6] Use `@test_throws` instead of `@test_broken` --- test/test_utils.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_utils.jl b/test/test_utils.jl index ab9ee1632..141fcb96e 100644 --- a/test/test_utils.jl +++ b/test/test_utils.jl @@ -100,7 +100,7 @@ function check_zygote_type_stability(f, args...; ctx=Zygote.Context()) @inferred f(args...) @inferred Zygote._pullback(ctx, f, args...) out, pb = Zygote._pullback(ctx, f, args...) - @test_broken @inferred pb(out) + @test_throws ErrorException @inferred pb(out) end function test_ADs(