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

Revisit fixed variables treatment #360

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Revisit fixed variables treatment #360

wants to merge 1 commit into from

Conversation

frapac
Copy link
Collaborator

@frapac frapac commented Jul 25, 2024

  • Change the behavior of MakeParameter, depending on the callback:
    • SparseCallback: remove the fixed variables and reduce problem's dimension in MadNLP
    • DenseCallback: keep the fixed variables frozen (as done previously). On the contrary to SparseCallback, we don't remove the fixed variables as this would require duplicating the Hessian and the Jacobian matrices to evaluate the model, which could be expensive if we are memory bounded.
  • Add a new fixed_handler if the problem has no fixed variable: NoFixedVariable.
  • Ensure we always interact to the nonlinear program nlp through the callback wrapper cb to avoid side effect.
  • Remove the function get_index_constraint and stores indexes directly in the callback wrapper cb.
  • Fix the computation of the bound's multipliers for fixed variables.

Solve #70, #229

Warning: this PR adds a small breaking change in create_kkt_system (we remove ind_cons from the arguments) but I think it's worth the change, as the previous situation was error prone. Now, we make sure we store all the problem's information inside the callback wrapper cb.

Preliminary results on space_shuttle_reentry shows that the current PR improves slightly the convergence (less iterations, less feasibility restoration), see the logs in attachment:

Benchmark on CUTEst is under way.

* Change the behavior of MakeParameter, depending on the callback:
    - `SparseCallback`: remove the fixed variables and reduce problem's dimension in MadNLP
    - `DenseCallback`: keep the fixed variables frozen (as done previously)
* Add a new `fixed_handler` if the problem has no fixed variable: `NoFixedVariable`.
* Ensure we always interact to the nonlinear program `nlp` through the
  callback wrapper `cb` to avoid side effect.
* Remove the function `get_index_constraint` and stores indexes directly
  in the callback wrapper `cb`.
* Fix the computation of the bound's multipliers for fixed variables.
@frapac frapac requested a review from sshin23 July 25, 2024 10:15
@frapac
Copy link
Collaborator Author

frapac commented Jul 25, 2024

Results on CUTEst are out (comparing this PR with MadNLP 0.8.4). It looks like we just improve very slightly the total number of iterations. In terms of computation time, we are slower. Also we are less robust now than before.
pprof-iter.pdf
pprof-cpu.pdf

Currently investigating what's going on.

@frapac
Copy link
Collaborator Author

frapac commented Jul 29, 2024

Benchmark is improved if we use the fix in #361 in this PR:
pprof-cpu.pdf

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.

1 participant