Skip to content

Commit 7f42c30

Browse files
author
Katharine Hyatt
committed
More comments
1 parent 9ca33bf commit 7f42c30

4 files changed

Lines changed: 4 additions & 44 deletions

File tree

test/runtests.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ if filter_tests!(testsuite, args)
2525
delete!(testsuite, "codequality")
2626
else
2727
is_apple_ci = Sys.isapple() && get(ENV, "CI", "false") == "true"
28+
is_windows_ci = Sys.isapple() && get(ENV, "CI", "false") == "true"
2829
if is_apple_ci
2930
filter!(p -> !startswith(first(p), "mooncake/"), testsuite)
3031
delete!(testsuite, "chainrules")
3132
end
32-
(Sys.iswindows() || is_apple_ci) && filter!(p -> !startswith(first(p), "enzyme/"), testsuite)
33+
(is_windows_ci || is_apple_ci) && filter!(p -> !startswith(first(p), "enzyme/"), testsuite)
3334
end
3435
end
3536

test/testsuite/ad_utils.jl

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,3 @@
1-
"""
2-
remove_svd_gauge_dependence!(ΔV, D, V)
3-
4-
Remove the gauge-dependent part from the cotangents `ΔU` and ΔVᴴ` of the singular vector matrices `U`
5-
and `Vᴴ`. The singular vectors are only determined up to complex phase (and unitary mixing for degenerate
6-
eigenvalues), so the corresponding components of `ΔU` and `ΔVᴴ` are projected out.
7-
"""
8-
function remove_svd_gauge_dependence!(
9-
ΔU, ΔVᴴ, U, S, Vᴴ;
10-
degeneracy_atol = MatrixAlgebraKit.default_pullback_gauge_atol(S)
11-
)
12-
gaugepart = mul!(U' * ΔU, Vᴴ, ΔVᴴ', true, true)
13-
gaugepart = project_antihermitian!(gaugepart)
14-
gaugepart[abs.(transpose(diagview(S)) .- diagview(S)) .>= degeneracy_atol] .= 0
15-
mul!(ΔU, U, gaugepart, -1, 1)
16-
return ΔU, ΔVᴴ
17-
end
18-
191
"""
202
remove_eig_gauge_dependence!(ΔV, D, V)
213
@@ -254,11 +236,6 @@ function ad_qr_compact_setup(A::Diagonal)
254236
end
255237

256238
function ad_qr_null_setup(A)
257-
m, n = size(A)
258-
minmn = min(m, n)
259-
Q, R = qr_compact(A)
260-
T = eltype(A)
261-
ΔN = Q * randn!(similar(A, T, minmn, max(0, m - minmn)))
262239
N = qr_null(A)
263240
ΔN = randn!(copy(N))
264241
remove_qr_null_gauge_dependence!(ΔN, A, N)

test/testsuite/enzyme/enzyme.jl

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

test/testsuite/mooncake/eigh.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ function test_mooncake_eigh_vals(
5050
return @testset "eigh_vals" begin
5151
A = make_eigh_matrix(T, sz)
5252
alg = MatrixAlgebraKit.select_algorithm(eigh_vals, A)
53-
D, ΔD = ad_eigh_vals_setup(A)
54-
output_tangent = Mooncake.primal_to_tangent!!(Mooncake.zero_tangent(D), ΔD)
53+
D = eigh_vals(A, alg)
54+
output_tangent = Mooncake.randn_tangent(rng, D)
5555

5656
Mooncake.TestUtils.test_rule(
5757
rng, eigh_wrapper, eigh_vals, A, alg;

0 commit comments

Comments
 (0)