-
Notifications
You must be signed in to change notification settings - Fork 119
Add dense and sparse wrappers for ParOpt from ParOpt directly #414
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
Conversation
…ns CSR data instead of passing through
|
@marcomangano @ewu63 the actual pyoptsparse wrapper that this will end up using is here |
|
The tests are failing because our docker images are pinned to an older version of ParOpt. But if we update the ParOpt version in the docker images before merging this PR then the image builds will fail and so the tests here will still fail. So I guess we need to test this PR locally, merge it even with failing azure tests, and then update the docker images. Opinions @ewu63 @eirikurj ? |
|
@gjkennedy I've run the pyoptsparse tests locally, the dense version of your wrapper seems to work fine, but when using the sparse version the constraints seem to be ignored if you use the trust region algorithm which is the default, interior-point and mma work fine. Try running |
|
Specific test errors aside, I have mixed feelings about moving the actual pyOptSparse wrapper to the parOpt repo. On the one hand, outsourcing it could make things a bit easier for us in terms of maintenance, especially if the SMDO group plans to update the python API on a regular basis. This would also avoid the kind of "circular import" happening now, where pyoptsparse imports paropt but the imported wrapper is also importing pyoptsparse components - but this is a minor note. |
|
|
Hey guys, this is a PR. Feel free to accept or reject it. Do not feel free to copy code from the wrapper I wrote into your repo! Thanks! |
|
@gjkennedy we can go with this approach, but there are currently some issues with the wrapper in the ParOpt. I opened smdogroup/paropt#51 to fix them. With those fixes I can get the paropt tests in this repo to pass. Once that PR is merged and you make a new release of ParOpt, we can figure out how to get things working in our docker images. @ewu63 , the MPI environment variable tests below are now failing because this PR removed this code, I had a look at adding it back but I can't understand the logic behind the code, could you take a look? pyoptsparse/tests/test_require_mpi_env_var.py Lines 45 to 73 in f66e9fb
|
|
Marking this as a draft until smdogroup/paropt#51 is fixed and a new ParOpt release is available |
|
There is one more PR on ParOpt (smdogroup/paropt#55) that needs to be merged to fix some small remaining issues and then the v2.1.5 release of ParOpt updated to the latest commit. Even once that is done, the tests here will continue to fail because the docker images use an old version of ParOpt. Previously we said we'd test this PR locally, merge it, then update the ParOpt version in the docker images. I added a new set of tests that tests the three different ParOpt algorithms with both the dense and sparse versions of the wrapper on a constrained and unconstrained version of the Rosenbrock function. I also updated the tests related to the MPI environment variable. |
|
This test is failing because the docker images are not updated to the latest |
|
After discussion with @marcomangano and @ewu63, we decided that any testing of the ParOpt wrapper should be in the same repo as the wrapper itself. So I have removed the ParOpt optimiser tests from this repo, and opened smdogroup/paropt#56 to move them to the ParOpt repo. |
|
Hey @A-CGray , I'm not entirely sure of the behavior we're checking for here, relative to OpenMDAO. If ParOpt tests are being moved out of ParOpt I think I'm ok with this test being removed. |
Sorry, I wasn't very clear, specifically we're asking whether OpenMDAO still relies on the behaviour added by Herb in #118 where pyOptSparse can be required to use or not use MPI using the |
|
Thanks for the reminder. We don't currently have any tests that set this variable...we only use OPENMDAO_USE_MPI for our purposes. I think we can skip or remove this for now. I like the ability to disable it but honestly we haven't used paropt much lately. |
This reverts commit 32fb778.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #414 +/- ##
===========================================
- Coverage 85.97% 74.75% -11.22%
===========================================
Files 22 24 +2
Lines 3315 3399 +84
===========================================
- Hits 2850 2541 -309
- Misses 465 858 +393 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@ewu63 @marcomangano , I believe this is ready for you to look at now. |
marcomangano
left a comment
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.
ewu63
left a comment
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.
LGTM! We'll have to be extra careful now with the API since this effectively makes our Optimizer class part of the public API.
Purpose
This PR adds the ParOpt sparse and dense constraint wrappers for pyOptSparse from ParOpt directly.
Expected time until merged
Type of change
Testing
Checklist
flake8andblackto make sure the Python code adheres to PEP-8 and is consistently formattedfprettifyor C/C++ code withclang-formatas applicable