-
Notifications
You must be signed in to change notification settings - Fork 5
add AD (Enzyme) support via MeshIntegralsEnzymeExt #152
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
24 commits
Select commit
Hold shift + click to select a range
f1107cf
add Enzyme as a potential differentiation method for the jacobian
kylebeggs c776dc9
refactor check for enzyme support
kylebeggs 9f3aadc
add FP to _default_diff_method
kylebeggs dfe12a1
add `using Enzyme` to benchmarks.jl
kylebeggs 539500b
update CoordRefSystems.jl compat
kylebeggs 875356f
add Enzyme to Benchmark Project.toml
kylebeggs c221137
fix Meshes compat in Benchmark Project.toml
kylebeggs 8ecff85
use import Enzyme, not using Enzyme
kylebeggs 76999ac
fix typo in Benchmarks Project.toml
kylebeggs bd8174d
remove Meshes version check in combinations.jl
kylebeggs 1786576
Apply format suggestion
kylebeggs 3747154
Update test/Project.toml
kylebeggs 0d669a0
Bump compat of Enzyme to v0.13.19
JoshuaLampert f74aa98
test supports_autoenzyme to combinations; test both backends for wron…
kylebeggs 08b9bf2
Restore recently-updated FiniteDifference constructors
mikeingold 45949a1
Add docstrings, formatting
mikeingold e05c8ad
Formatting
mikeingold 8d19413
Add test for two-arg jacobian
mikeingold 570a53e
Use rest of MeshIntegrals namespace
mikeingold 71215f1
Disambiguate use of jacobian
mikeingold d2eff83
fix test
JoshuaLampert c4f6b92
use `import Enzyme`
kylebeggs 7f25b8a
use `import Enzyme`
kylebeggs 65dfe9c
remove unneeded MeshIntegrals.jl
kylebeggs 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,14 @@ | ||
| [deps] | ||
| BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" | ||
| Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9" | ||
| LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" | ||
| Meshes = "eacbb407-ea5a-433e-ab97-5258b1ca43fa" | ||
| Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" | ||
|
|
||
| [compat] | ||
| BenchmarkTools = "1.5" | ||
| Enzyme = "0.13.19" | ||
| LinearAlgebra = "1" | ||
| Meshes = "0.50, 0.51, 0.52" | ||
| Meshes = "0.51.20, 0.52" | ||
| Unitful = "1.19" | ||
| julia = "1.9" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| module MeshIntegralsEnzymeExt | ||
|
|
||
| using MeshIntegrals: MeshIntegrals, AutoEnzyme | ||
| using Meshes: Meshes | ||
| using Enzyme: Enzyme | ||
|
|
||
| function MeshIntegrals.jacobian( | ||
| geometry::Meshes.Geometry, | ||
| ts::Union{AbstractVector{T}, Tuple{T, Vararg{T}}}, | ||
| ::AutoEnzyme | ||
| ) where {T <: AbstractFloat} | ||
| Dim = Meshes.paramdim(geometry) | ||
| if Dim != length(ts) | ||
| throw(ArgumentError("ts must have same number of dimensions as geometry.")) | ||
| end | ||
| return Meshes.to.(Enzyme.jacobian(Enzyme.Forward, geometry, ts...)) | ||
| 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
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
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.
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.
Uh oh!
There was an error while loading. Please reload this page.