Skip to content

Commit 5aaed92

Browse files
authored
Sort tests into single and double backends (#245)
* Sort tests into single and double backends * Fix test deps * Fix paths * Fix ENzyme * DIT * DataFrame
1 parent c8e6bd5 commit 5aaed92

26 files changed

Lines changed: 89 additions & 135 deletions

DifferentiationInterface/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
8080
PolyesterForwardDiff = "98d1487c-24ca-40b6-b7ab-df2af84e126b"
8181
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
8282
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
83+
SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
8384
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
8485
Tapir = "07d77754-e150-4737-8c94-cd238a1fb45b"
8586
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
@@ -104,6 +105,7 @@ test = [
104105
"PolyesterForwardDiff",
105106
"ReverseDiff",
106107
"SparseArrays",
108+
"SparseConnectivityTracer",
107109
"Symbolics",
108110
"Tapir",
109111
"Test",

DifferentiationInterface/test/second_order/enzyme_forwarddiff.jl renamed to DifferentiationInterface/test/Double/Enzyme-ForwardDiff.jl

File renamed without changes.

DifferentiationInterface/test/translation/forwarddiff_zygote.jl renamed to DifferentiationInterface/test/Double/ForwardDiff-Zygote.jl

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,32 @@
11
using DifferentiationInterface, DifferentiationInterfaceTest
2+
import DifferentiationInterface as DI
23
import DifferentiationInterfaceTest as DIT
34
using ForwardDiff: ForwardDiff
45
using Zygote: Zygote
56

7+
backends = [
8+
SecondOrder(AutoForwardDiff(), AutoZygote()),
9+
MyAutoSparse(SecondOrder(AutoForwardDiff(), AutoZygote())),
10+
]
11+
12+
for backend in backends
13+
@test check_available(backend)
14+
@test !check_twoarg(backend)
15+
@test check_hessian(backend)
16+
end
17+
18+
test_differentiation(backends; first_order=false, logging=LOGGING);
19+
20+
test_differentiation(
21+
MyAutoSparse(SecondOrder(AutoForwardDiff(), AutoZygote())),
22+
sparse_scenarios();
23+
first_order=false,
24+
sparsity=true,
25+
logging=LOGGING,
26+
);
27+
28+
## Translation
29+
630
function zygote_breaking_scenarios()
731
onearg_scens = filter(default_scenarios()) do scen
832
DIT.nb_args(scen) == 1

DifferentiationInterface/test/second_order/reversediff_zygote.jl renamed to DifferentiationInterface/test/Double/ReverseDiff-Zygote.jl

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

DifferentiationInterface/test/first_order/enzyme.jl renamed to DifferentiationInterface/test/Single/Enzyme.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ end
1616

1717
test_differentiation(backends; second_order=false, logging=LOGGING);
1818

19+
test_differentiation(
20+
MyAutoSparse(AutoEnzyme(Enzyme.Reverse)),
21+
sparse_scenarios();
22+
second_order=false,
23+
sparsity=true,
24+
logging=LOGGING,
25+
);
26+
1927
test_differentiation(
2028
AutoEnzyme(; mode=Enzyme.Forward); # TODO: add more
2129
correctness=false,

0 commit comments

Comments
 (0)