Skip to content

Commit 313dff4

Browse files
kshyattKatharine Hyatt
andauthored
Consolidate Enzyme TO and VI tests and retry stuff on 1.10 (#497)
* Consolidate Enzyme TO and VI tests * Cut CI burden and retry things on 1.10 * Try trimming scale tests a bit more --------- Co-authored-by: Katharine Hyatt <katharine.s.hyatt@gmail.com>
1 parent b82fbbf commit 313dff4

7 files changed

Lines changed: 231 additions & 240 deletions

File tree

‎test/enzyme-tensoroperations/contract.jl‎

Lines changed: 0 additions & 140 deletions
This file was deleted.

‎test/enzyme-tensoroperations/trace.jl‎

Lines changed: 0 additions & 62 deletions
This file was deleted.
Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,46 @@ using TensorKit, Enzyme, EnzymeTestUtils
33
using TensorOperations
44
using Random
55

6-
#spacelist = ad_spacelist(fast_tests)
7-
spacelist = [ad_spacelist(fast_tests)[1]]
6+
spacelist = ad_spacelist(fast_tests)
87
eltypes = (Float64, ComplexF64)
98

9+
is_ci = get(ENV, "CI", "false") == "true"
10+
11+
rTαs = is_ci ? (Active,) : (Active, Const)
12+
rTβs = is_ci ? (Active,) : (Active, Const)
13+
fTαs = is_ci ? (Duplicated,) : (Duplicated, Const)
14+
fTβs = is_ci ? (Duplicated,) : (Duplicated, Const)
15+
1016
@testset "Enzyme - VectorInterface (add!) $(TensorKit.type_repr(sectortype(eltype(V)))) ($T)" for V in spacelist, T in eltypes
1117
atol = default_tol(T)
1218
rtol = default_tol(T)
1319

1420
α = randn(T)
1521
β = randn(T)
1622

17-
# see https://github.com/QuantumKitHub/TensorKit.jl/issues/457
18-
if VERSION < v"1.11.0-rc" && sectortype(eltype(V)) == Trivial
19-
CV = V[1] ⊗ V[2] ← V[4] ⊗ V[5]
20-
else
21-
CV = V[1] ⊗ V[2] ← V[3] ⊗ V[4] ⊗ V[5]
22-
end
23+
CV = V[1] ⊗ V[2] ← V[3] ⊗ V[4] ⊗ V[5]
2324
C = randn(T, CV)
2425
A = randn(T, CV)
2526
for TC in (Duplicated,), TA in (Duplicated,)
2627
C = randn(T, CV)
2728
A = randn(T, CV)
2829
EnzymeTestUtils.test_reverse(add!, TC, (C, TC), (A, TA); atol, rtol, testset_name = "add! reverse TC $TC TA $TA no α no β")
2930
EnzymeTestUtils.test_forward(add!, TC, (C, TC), (A, TA); atol, rtol, testset_name = "add! forward TC $TC TA $TA no α no β")
30-
for Tα in (Active, Const)
31+
for Tα in rTαs
3132
C = randn(T, CV)
3233
A = randn(T, CV)
3334
EnzymeTestUtils.test_reverse(add!, TC, (C, TC), (A, TA), (α, Tα); atol, rtol, testset_name = "add! reverse TC $TC TA $TA Tα $Tα no β")
34-
for Tβ in (Active, Const)
35+
for Tβ in rTβs
3536
C = randn(T, CV)
3637
A = randn(T, CV)
3738
EnzymeTestUtils.test_reverse(add!, TC, (C, TC), (A, TA), (α, Tα), (β, Tβ); atol, rtol, testset_name = "add! reverse TC $TC TA $TA Tα $Tα Tβ $Tβ")
3839
end
3940
end
40-
for Tα in (Duplicated, Const)
41+
for Tα in fTαs
4142
C = randn(T, CV)
4243
A = randn(T, CV)
4344
EnzymeTestUtils.test_forward(add!, TC, (C, TC), (A, TA), (α, Tα); atol, rtol, testset_name = "add! forward TC $TC TA $TA Tα $Tα no β")
44-
for Tβ in (Duplicated, Const)
45+
for Tβ in fTβs
4546
C = randn(T, CV)
4647
A = randn(T, CV)
4748
EnzymeTestUtils.test_forward(add!, TC, (C, TC), (A, TA), (α, Tα), (β, Tβ); atol, rtol, testset_name = "add! forward TC $TC TA $TA Tα $Tα Tβ $Tβ")

0 commit comments

Comments
 (0)