Skip to content
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

Add JuMP extension #1337

Closed
wants to merge 5 commits into from
Closed

Add JuMP extension #1337

wants to merge 5 commits into from

Conversation

michel2323
Copy link
Collaborator

@michel2323 michel2323 commented Mar 8, 2024

This extends JuMP and allows a user in JuMP to differentiate an external function using Enzyme. I still should reduce the allocations. Feedback is very welcome.

Use case:

using Ipopt
using JuMP
using Enzyme

# Rosenbrock
rosenbrock(x...) = (1 - x[1])^2 + 100 * (x[2] - x[1]^2)^2

model = Model(Ipopt.Optimizer)
op_rosenbrock =  model[:op_rosenbrock] = add_nonlinear_operator(model, 2, rosenbrock; name=:op_rosenbrock) 
@variable(model, x[1:2])

@objective(model, Min, op_rosenbrock(x[1],x[2]))

optimize!(model)

@michel2323
Copy link
Collaborator Author

Since we're using the memory, I added the batched mode to get the Hessian in one go.

Copy link
Member

@wsmoses wsmoses left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this would be better suited as an extension to Jump

@odow
Copy link

odow commented Mar 14, 2024

This should be closed. We're discussing it over in jump-dev/JuMP.jl#3712.

@vchuravy vchuravy closed this Mar 19, 2024
@vchuravy vchuravy deleted the ms/jump branch March 19, 2024 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants