Add integration test for MatrixAlgebraKit#2935
Conversation
|
Missed to push some files? |
|
Yep working on it now |
|
its still missing? |
|
Sorry yes will push soon! Got distracted with another thing I'm working on 😓 |
|
bump @kshyatt |
|
We just had all our tests at MAK break (hmm...) so I'll try this again. Is there a way we could somehow use the existing |
|
@wsmoses Look ok now? |
| EnzymeCore = {path = "../../../lib/EnzymeCore"} | ||
|
|
||
| [compat] | ||
| FiniteDifferences = "0.12.32" |
There was a problem hiding this comment.
you should pin the exact version of matrix algebra kit
| @@ -0,0 +1,4 @@ | |||
| using Test, Pkg | |||
|
|
|||
| Pkg.develop("MatrixAlgebraKit") | |||
There was a problem hiding this comment.
this is possible, but really not desirable here since it isn't in any way actinoable from our side to debug/test if it fails -- what would be better is having some code which ideally directly calls enzyme
There was a problem hiding this comment.
The reason I didn't do that right out of the gate is we have a LOT of code which directly calls enzyme and which various parts of have failed in the past 😅. But I'll see if I can whittle something down to start
There was a problem hiding this comment.
yeah, imo here the reason is a maintainability/actionability thing -- such that if the test fails, can an enzyme person who has no idea what your code is, figure it out. Because if they can't and we let the test fail [and merge], the integration test isn't as useful
There was a problem hiding this comment.
Sounds good! I'll try to bring over stuff that doesn't require all our setup logic for the input derivatives
|
Your PR requires formatting changes to meet the project's style guidelines. Click here to view the suggested changes.diff --git a/test/integration/MatrixAlgebraKit/runtests.jl b/test/integration/MatrixAlgebraKit/runtests.jl
index 81568730..47f5eb15 100644
--- a/test/integration/MatrixAlgebraKit/runtests.jl
+++ b/test/integration/MatrixAlgebraKit/runtests.jl
@@ -17,7 +17,7 @@ structured_randn!(A::Diagonal) = (randn!(diagview(A)); return A)
instantiate_matrix(::Type{T}, size) where {T <: Number} = randn(rng, T, size)
instantiate_matrix(::Type{AT}, size) where {AT <: Diagonal} = Diagonal(randn(rng, eltype(AT), size))
-@testset "lq" for T in (Float64, ComplexF64), sz in ((19, 17), (19, 19), (19, 23))
+@testset "lq" for T in (Float64, ComplexF64), sz in ((19, 17), (19, 19), (19, 23))
A = instantiate_matrix(T, sz)
m, n = sz
atol = m * n * precision(T)
@@ -40,7 +40,7 @@ instantiate_matrix(::Type{AT}, size) where {AT <: Diagonal} = Diagonal(randn(rng
end
end
-@testset "qr" for T in (Float64, ComplexF64), sz in ((19, 17), (19, 19), (19, 23))
+@testset "qr" for T in (Float64, ComplexF64), sz in ((19, 17), (19, 19), (19, 23))
A = instantiate_matrix(T, sz)
alg = MatrixAlgebraKit.select_algorithm(qr_compact, A)
m, n = sz
@@ -51,7 +51,7 @@ end
MatrixAlgebraKit.remove_lq_gauge_dependence!(ΔQR..., A, QR...)
test_reverse(qr_compact, Duplicated, (A, Duplicated), (alg, Const); atol, rtol, output_tangent = ΔQR)
test_reverse(call_and_zero!, Duplicated, (qr_compact!, Const), (A, Duplicated), (alg, Const); atol, rtol, output_tangent = ΔQR)
-
+
if sz[1] == sz[2]
A = instantiate_matrix(Diagonal{T}, sz)
alg = MatrixAlgebraKit.select_algorithm(qr_compact, A)
@@ -63,7 +63,7 @@ end
end
end
-@testset "svd" for T in (Float64, ComplexF64), sz in ((19, 17), (19, 19), (19, 23))
+@testset "svd" for T in (Float64, ComplexF64), sz in ((19, 17), (19, 19), (19, 23))
A = instantiate_matrix(T, sz)
m, n = sz
atol = m * n * precision(T) |
|
We have a bunch of Enzyme rules over there that absolutely love to break and generate weird errors