-
Notifications
You must be signed in to change notification settings - Fork 5
Refactor Enzyme testsuite #177
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
2b58bc4
Refactor Enzyme testsuite
kshyatt bd6ecf9
Mark more functions inactive
kshyatt 938231b
Temporarily use Float64 for some tests due to Enzyme issue
kshyatt d1a9c2f
Don't keep re-initing A for SVD tests
kshyatt 9ca33bf
Update test/testsuite/enzyme/enzyme.jl
kshyatt 7f42c30
More comments
3dc2eee
Move enzyme_fdm to new function
72d1c6d
Add projections tests for Enzyme
effff75
Whoops
2290b5f
Try projections without A to A methods
97abceb
Fix
kshyatt cedeae8
Update test/testsuite/mooncake/eig.jl
kshyatt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| using MatrixAlgebraKit | ||
| using Test | ||
| using LinearAlgebra: Diagonal | ||
| using CUDA, AMDGPU | ||
|
|
||
| # infinity-norm doesn't play nicely with Float32, Enzyme, and 1.12 | ||
| # see https://github.com/EnzymeAD/Enzyme.jl/issues/2985 | ||
| BLASFloats = (Float64, 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_enzyme_eig(T, (m, m); atol = m * m * TestSuite.precision(T), rtol = m * m * TestSuite.precision(T)) | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| using MatrixAlgebraKit | ||
| using Test | ||
| using LinearAlgebra: Diagonal | ||
| using CUDA, AMDGPU | ||
|
|
||
| # infinity-norm doesn't play nicely with Float32, Enzyme, and 1.12 | ||
| # see https://github.com/EnzymeAD/Enzyme.jl/issues/2985 | ||
| BLASFloats = (Float64, 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_enzyme_eigh(T, (m, m); atol = m * m * TestSuite.precision(T), rtol = m * m * TestSuite.precision(T)) | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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_enzyme_lq(T, (m, n); atol = m * n * TestSuite.precision(T), rtol = m * n * TestSuite.precision(T)) | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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_enzyme_orthnull(T, (m, n); atol = m * n * TestSuite.precision(T), rtol = m * n * TestSuite.precision(T)) | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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_enzyme_polar(T, (m, n); atol = m * n * TestSuite.precision(T), rtol = m * n * TestSuite.precision(T)) | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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...) | ||
| TestSuite.seed_rng!(123) | ||
| atol = rtol = m * m * TestSuite.precision(T) | ||
| if !is_buildkite | ||
| TestSuite.test_enzyme_projections(T, (m, m); atol, rtol) | ||
| TestSuite.test_enzyme_projections(Diagonal{T, Vector{T}}, (m, m); atol, rtol) | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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_enzyme_qr(T, (m, n); atol = m * n * TestSuite.precision(T), rtol = m * n * TestSuite.precision(T)) | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| using MatrixAlgebraKit | ||
| using Test | ||
| using LinearAlgebra: Diagonal | ||
| using CUDA, AMDGPU | ||
|
|
||
| # infinity-norm doesn't play nicely with Float32, Enzyme, and 1.12 | ||
| # see https://github.com/EnzymeAD/Enzyme.jl/issues/2985 | ||
| BLASFloats = (Float64, 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!(1234) | ||
| if !is_buildkite | ||
| TestSuite.test_enzyme_svd(T, (m, n); atol = m * n * TestSuite.precision(T), rtol = m * n * TestSuite.precision(T)) | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have probably made this a multiline function, it's quite long for a single line, but this is really just aesthetics at this point 😉