Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 8
Mooncake testsuite refactor#175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
c69b57b734f390023cfed159da4ddeda60598c9fc064a42468b209c2f8d7cc6552559f9161bde6550d8bb3329de61e80610de37f02238bf87dd64c881d9d42bb4076dc7dadcda140eda4afc992fa33e57File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -239,7 +239,7 @@ for f in (:eig, :eigh) | ||
| _warn_pullback_truncerror(dϵ) | ||
| # compute pullbacks | ||
| $f_pullback!(dA, Ac, DVc, dDVtrunc, ind) | ||
| $f_pullback!(dA, Ac, DV, dDVtrunc, ind) | ||
| zero!.(dDVtrunc) # since this is allocated in this function this is probably not required | ||
| # restore state | ||
| @@ -351,8 +351,8 @@ for f in (:eig, :eigh) | ||
| dDVtrunc = last.(arrayify.(DVtrunc, Mooncake.tangent(DVtrunc_dDVtrunc))) | ||
| function $f_adjoint!(::NoRData) | ||
| # compute pullbacks | ||
| $f_pullback!(dA, Ac, DVc, dDVtrunc, ind) | ||
| zero!.(dDVtrunc) # since this is allocated in this function this is probably not required | ||
| $f_pullback!(dA, Ac, DV, dDVtrunc, ind) | ||
| zero!.(dDV) | ||
| # restore state | ||
| copy!(A, Ac) | ||
| @@ -425,7 +425,7 @@ for (f!, f) in ( | ||
| S, dS = arrayify(USVᴴ[2], dUSVᴴ[2]) | ||
| Vᴴ, dVᴴ = arrayify(USVᴴ[3], dUSVᴴ[3]) | ||
| USVᴴc = copy.(USVᴴ) | ||
| output = $f!(A, Mooncake.primal(alg_dalg)) | ||
| output = $f!(A, USVᴴ, Mooncake.primal(alg_dalg)) | ||
| function svd_adjoint(::NoRData) | ||
| copy!(A, Ac) | ||
| if $(f! == svd_compact!) | ||
| @@ -590,7 +590,7 @@ function Mooncake.rrule!!(::CoDual{typeof(svd_trunc!)}, A_dA::CoDual, USVᴴ_dUS | ||
| _warn_pullback_truncerror(dϵ) | ||
| # compute pullbacks | ||
| svd_pullback!(dA, Ac, USVᴴc, dUSVᴴtrunc, ind) | ||
| svd_pullback!(dA, Ac, USVᴴ, dUSVᴴtrunc, ind) | ||
| zero!.(dUSVᴴtrunc) # since this is allocated in this function this is probably not required | ||
| zero!.(dUSVᴴ) | ||
| @@ -717,8 +717,7 @@ function Mooncake.rrule!!(::CoDual{typeof(svd_trunc_no_error!)}, A_dA::CoDual, U | ||
| dUSVᴴtrunc = last.(arrayify.(USVᴴtrunc, Mooncake.tangent(USVᴴtrunc_dUSVᴴtrunc))) | ||
| function svd_trunc_adjoint(::NoRData) | ||
| # compute pullbacks | ||
| svd_pullback!(dA, Ac, USVᴴc, dUSVᴴtrunc, ind) | ||
| zero!.(dUSVᴴtrunc) # since this is allocated in this function this is probably not required | ||
| svd_pullback!(dA, Ac, USVᴴ, dUSVᴴtrunc, ind) | ||
Jutho marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| zero!.(dUSVᴴ) | ||
| # restore state | ||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| using MatrixAlgebraKit | ||
| using Test | ||
| using LinearAlgebra: Diagonal | ||
| using CUDA, AMDGPU | ||
| BLASFloats = (Float32, ComplexF64) # full suite is too expensive on CI | ||
| GenericFloats = () | ||
| @isdefined(TestSuite) || include("../testsuite/TestSuite.jl") | ||
| using .TestSuite | ||
| is_buildkite = get(ENV, "BUILDKITE", "false") == "true" | ||
| m = 19 | ||
| for T in (BLASFloats..., GenericFloats...) | ||
| TestSuite.seed_rng!(123) | ||
| if !is_buildkite | ||
| TestSuite.test_mooncake_eig(T, (m, m); atol = m * m * TestSuite.precision(T), rtol = m * m * TestSuite.precision(T)) | ||
| end | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| using MatrixAlgebraKit | ||
| using Test | ||
| using LinearAlgebra: Diagonal | ||
| using CUDA, AMDGPU | ||
| BLASFloats = (Float32, ComplexF64) # full suite is too expensive on CI | ||
| GenericFloats = () | ||
| @isdefined(TestSuite) || include("../testsuite/TestSuite.jl") | ||
| using .TestSuite | ||
| is_buildkite = get(ENV, "BUILDKITE", "false") == "true" | ||
| m = 19 | ||
| for T in (BLASFloats..., GenericFloats...) | ||
| TestSuite.seed_rng!(123) | ||
| if !is_buildkite | ||
| TestSuite.test_mooncake_eigh(T, (m, m); atol = m * m * TestSuite.precision(T), rtol = m * m * TestSuite.precision(T)) | ||
| end | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| using MatrixAlgebraKit | ||
| using Test | ||
| using LinearAlgebra: Diagonal | ||
| using CUDA, AMDGPU | ||
| BLASFloats = (Float32, ComplexF64) # full suite is too expensive on CI | ||
| GenericFloats = () | ||
| @isdefined(TestSuite) || include("../testsuite/TestSuite.jl") | ||
| using .TestSuite | ||
| is_buildkite = get(ENV, "BUILDKITE", "false") == "true" | ||
| m = 19 | ||
| for T in (BLASFloats..., GenericFloats...), n in (17, m, 23) | ||
| TestSuite.seed_rng!(123) | ||
| if !is_buildkite | ||
| TestSuite.test_mooncake_lq(T, (m, n); atol = m * n * TestSuite.precision(T), rtol = m * n * TestSuite.precision(T)) | ||
| end | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| using MatrixAlgebraKit | ||
| using Test | ||
| using LinearAlgebra: Diagonal | ||
| using CUDA, AMDGPU | ||
| BLASFloats = (Float32, ComplexF64) # full suite is too expensive on CI | ||
| GenericFloats = () | ||
| @isdefined(TestSuite) || include("../testsuite/TestSuite.jl") | ||
| using .TestSuite | ||
| is_buildkite = get(ENV, "BUILDKITE", "false") == "true" | ||
| m = 19 | ||
| for T in (BLASFloats..., GenericFloats...), n in (17, m, 23) | ||
| TestSuite.seed_rng!(123) | ||
| if !is_buildkite | ||
| TestSuite.test_mooncake_orthnull(T, (m, n); atol = m * n * TestSuite.precision(T), rtol = m * n * TestSuite.precision(T)) | ||
| end | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| using MatrixAlgebraKit | ||
| using Test | ||
| using LinearAlgebra: Diagonal | ||
| using CUDA, AMDGPU | ||
| BLASFloats = (Float32, ComplexF64) # full suite is too expensive on CI | ||
| GenericFloats = () | ||
| @isdefined(TestSuite) || include("../testsuite/TestSuite.jl") | ||
| using .TestSuite | ||
| is_buildkite = get(ENV, "BUILDKITE", "false") == "true" | ||
| m = 19 | ||
| for T in (BLASFloats..., GenericFloats...), n in (17, m, 23) | ||
| TestSuite.seed_rng!(123) | ||
| if !is_buildkite | ||
| atol = rtol = m * n * TestSuite.precision(T) | ||
| m >= n && TestSuite.test_mooncake_left_polar(T, (m, n); atol, rtol) | ||
| n >= m && TestSuite.test_mooncake_right_polar(T, (m, n); atol, rtol) | ||
| end | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| using MatrixAlgebraKit | ||
| using Test | ||
| using LinearAlgebra: Diagonal | ||
| using CUDA, AMDGPU | ||
| BLASFloats = (Float32, ComplexF64) # full suite is too expensive on CI | ||
| GenericFloats = () | ||
| @isdefined(TestSuite) || include("../testsuite/TestSuite.jl") | ||
| using .TestSuite | ||
| is_buildkite = get(ENV, "BUILDKITE", "false") == "true" | ||
| m = 19 | ||
| for T in (BLASFloats..., GenericFloats...), n in (17, m, 23) | ||
| TestSuite.seed_rng!(123) | ||
| if !is_buildkite | ||
| TestSuite.test_mooncake_qr(T, (m, n); atol = m * n * TestSuite.precision(T), rtol = m * n * TestSuite.precision(T)) | ||
| end | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| using MatrixAlgebraKit | ||
| using Test | ||
| using LinearAlgebra: Diagonal | ||
| using CUDA, AMDGPU | ||
| BLASFloats = (Float32, ComplexF64) # full suite is too expensive on CI | ||
| GenericFloats = () | ||
| @isdefined(TestSuite) || include("../testsuite/TestSuite.jl") | ||
| using .TestSuite | ||
| is_buildkite = get(ENV, "BUILDKITE", "false") == "true" | ||
| m = 19 | ||
| for T in (BLASFloats..., GenericFloats...), n in (17, m, 23) | ||
| TestSuite.seed_rng!(123) | ||
| if !is_buildkite | ||
| TestSuite.test_mooncake_svd(T, (m, n); atol = m * n * TestSuite.precision(T), rtol = m * n * TestSuite.precision(T)) | ||
| end | ||
| end |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.