Update ParOpt interface to support sparse constraints #409
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.
Purpose
ParOpt now supports sparse constraints which should help some of the performance issues I've run into with it for problems with a lot of constraints.
To use this functionality, the ParOpt problem you create needs to define new methods for computing the sparse constraints separately and another for computing jac-vec products with the sparse constraint jacobian.
As a first step, I figured the best approach would be to treat the linear constraints as sparse and the nonlinear constraints as dense.
I'm opening this as a draft now as I'm not sure the best way to separate the evaluation of the linear and nonlinear constraints, hoping to get @ewu63 's opinion. In particular, I think ParOpt will call the jac-vec product function quite a lot so it might be important to make that quite efficient, ideally we would just have a single sparse mat for all the linear constraints and then do a single mat-vec product.
Closes #353
Expected time until merged
Type of change
Testing
Checklist
flake8
andblack
to make sure the Python code adheres to PEP-8 and is consistently formattedfprettify
or C/C++ code withclang-format
as applicable