Skip to content

Commit

Permalink
Mark some 1.11 tests as broken
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Dec 30, 2024
1 parent fb36b65 commit 06ba99d
Showing 1 changed file with 26 additions and 10 deletions.
36 changes: 26 additions & 10 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3077,11 +3077,16 @@ end
@inbounds w[1] * x[1]
end

Enzyme.autodiff(Reverse, inactiveArg, Active, Duplicated(w, dw), Const(x), Const(false))
@static if VERSION < v"1.11-"
Enzyme.autodiff(Reverse, inactiveArg, Active, Duplicated(w, dw), Const(x), Const(false))

@test x [3.0]
@test w [1.0]
@test dw [3.0]
@test x [3.0]
@test w [1.0]
@test dw [3.0]
else
# TODO broken should not throw
@test_throws Enzyme.autodiff(Reverse, inactiveArg, Active, Duplicated(w, dw), Const(x), Const(false))
end

x = Float32[3]

Expand All @@ -3093,16 +3098,27 @@ end
res
end

dw = Enzyme.autodiff(Reverse, loss, Active, Active(1.0), Const(x), Const(false))[1]
@static if VERSION < v"1.11-"
dw = Enzyme.autodiff(Reverse, loss, Active, Active(1.0), Const(x), Const(false))[1]

@test x [3.0]
@test dw[1] 3.0
@test x [3.0]
@test dw[1] 3.0
else
# TODO broken should not throw
@test_throws Enzyme.autodiff(Reverse, loss, Active, Active(1.0), Const(x), Const(false))[1]
end

c = ones(3)
inner(e) = c .+ e
fres = Enzyme.autodiff(Enzyme.Forward, Const(inner), Duplicated{Vector{Float64}}, Duplicated([0., 0., 0.], [1., 1., 1.]))[1]
@test c [1.0, 1.0, 1.0]
@test fres [1.0, 1.0, 1.0]

@static if VERSION < v"1.11-"
fres = Enzyme.autodiff(Enzyme.Forward, Const(inner), Duplicated{Vector{Float64}}, Duplicated([0., 0., 0.], [1., 1., 1.]))[1]
@test c [1.0, 1.0, 1.0]
@test fres [1.0, 1.0, 1.0]
else
# TODO broken should not throw
@test_throws Enzyme.autodiff(Enzyme.Forward, Const(inner), Duplicated{Vector{Float64}}, Duplicated([0., 0., 0.], [1., 1., 1.]))
end
end

@testset "View Splat" begin
Expand Down

0 comments on commit 06ba99d

Please sign in to comment.