Skip to content

Adding Mooncake to the AD list. #936

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/src/API/ad.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The choices for the auto-AD fill-ins with quick descriptions are:
- `AutoFiniteDiff()`: Finite differencing, not optimal but always applicable
- `AutoModelingToolkit()`: The fastest choice for large scalar optimizations
- `AutoEnzyme()`: Highly performant AD choice for type stable and optimized code
- `AutoMooncake()`: Like Zygote and ReverseDiff, but supports GPU and mutating code

## Automatic Differentiation Choice API

Expand All @@ -22,4 +23,5 @@ OptimizationBase.AutoZygote
OptimizationBase.AutoTracker
OptimizationBase.AutoModelingToolkit
OptimizationBase.AutoEnzyme
OptimizationBase.AutoMooncake
```
6 changes: 3 additions & 3 deletions test/ADtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ end
@testset "No constraint" begin
for adtype in [AutoEnzyme(), AutoForwardDiff(), AutoZygote(), AutoReverseDiff(),
AutoFiniteDiff(), AutoModelingToolkit(), AutoSparseForwardDiff(),
AutoSparseReverseDiff(), AutoSparse(AutoZygote()), AutoModelingToolkit(true, true)]
AutoSparseReverseDiff(), AutoSparse(AutoZygote()), AutoModelingToolkit(true, true), AutoMooncake()]
optf = OptimizationFunction(rosenbrock, adtype)

prob = OptimizationProblem(optf, x0)
Expand Down Expand Up @@ -67,7 +67,7 @@ end
@testset "One constraint" begin
for adtype in [AutoEnzyme(), AutoForwardDiff(), AutoZygote(), AutoReverseDiff(),
AutoFiniteDiff(), AutoModelingToolkit(), AutoSparseForwardDiff(),
AutoSparseReverseDiff(), AutoSparse(AutoZygote()), AutoModelingToolkit(true, true)]
AutoSparseReverseDiff(), AutoSparse(AutoZygote()), AutoModelingToolkit(true, true), AutoMooncake()]
cons = (res, x, p) -> (res[1] = x[1]^2 + x[2]^2 - 1.0; return nothing)
optf = OptimizationFunction(rosenbrock, adtype, cons = cons)

Expand All @@ -85,7 +85,7 @@ end
@testset "Two constraints" begin
for adtype in [AutoForwardDiff(), AutoZygote(), AutoReverseDiff(),
AutoFiniteDiff(), AutoModelingToolkit(), AutoSparseForwardDiff(),
AutoSparseReverseDiff(), AutoSparse(AutoZygote()), AutoModelingToolkit(true, true)]
AutoSparseReverseDiff(), AutoSparse(AutoZygote()), AutoModelingToolkit(true, true), AutoMooncake()]
function con2_c(res, x, p)
res[1] = x[1]^2 + x[2]^2
res[2] = x[2] * sin(x[1]) - x[1]
Expand Down