Skip to content

Commit 024546e

Browse files
committed
fix: skip zygote on 1.12
1 parent fc8a586 commit 024546e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

lib/LuxTestUtils/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "LuxTestUtils"
22
uuid = "ac9de150-d08f-4546-94fb-7472b5760531"
3-
version = "2.1.0"
3+
version = "2.2.0"
44
authors = ["Avik Pal <avikpal@mit.edu>"]
55

66
[deps]

lib/LuxTestUtils/src/autodiff.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,11 @@ function test_gradients(
181181

182182
# Choose the backends to test
183183
backends = []
184-
push!(backends, AutoZygote())
184+
if ZYGOTE_TESTING_ENABLED[]
185+
push!(backends, AutoZygote())
186+
end
185187
if !on_gpu
186188
total_length 32 && push!(backends, AutoForwardDiff())
187-
# TODO: Move Enzyme out of here once it supports GPUs
188189
if enable_enzyme_reverse_mode || ENZYME_TESTING_ENABLED[]
189190
mode = if enzyme_set_runtime_activity
190191
Enzyme.set_runtime_activity(Enzyme.Reverse)
@@ -210,6 +211,11 @@ function test_gradients(
210211
typeof(backend).name.name != typeof(ground_truth_backend).name.name
211212
]
212213

214+
if isempty(backends)
215+
@warn "No backends to test. Skipping test..."
216+
return nothing
217+
end
218+
213219
return @testset "gradtest($(f))" begin
214220
@testset "$(nameof(typeof(backend)))()" for backend in backends
215221
local_test_expr = :([$(nameof(typeof(backend)))] - $(test_expr))

0 commit comments

Comments
 (0)