Skip to content

[Depends on #3991] Adding method for multistart initialization of nonlinear models. - #3994

Draft
stephenscini wants to merge 57 commits into
Pyomo:mainfrom
stephenscini:multistart-init
Draft

[Depends on #3991] Adding method for multistart initialization of nonlinear models.#3994
stephenscini wants to merge 57 commits into
Pyomo:mainfrom
stephenscini:multistart-init

Conversation

@stephenscini

@stephenscini stephenscini commented Jul 13, 2026

Copy link
Copy Markdown
Member

Fixes # .

Summary/Motivation:

Additional method in devel/initialization to use multistart optimization as a way for initializing nonliner models.

Changes proposed in this PR:

  • Updating contrib/multistart solver for reproducibility, and adding support for new solver interface.
  • Adding support for uniform, lhs, and sobol sampling within the multistart solver
  • Adding method to devel/initialization

AI-Use Disclosure

  • AI tools contributed to the development of this PR

    • AI tools generated code (apart from tests)

    Review process (select ONE):

    • Rewritten: All AI-generated content was rewritten by me before being committed.

Notes for reviewers (optional):

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@stephenscini

Copy link
Copy Markdown
Member Author

Opening PR, but still in active development. Dependent on #3991 first as it includes those changes.

@stephenscini

stephenscini commented Jul 21, 2026

Copy link
Copy Markdown
Member Author

Note for 7/21 Dev meeting

Method implemented with support for new solver interface. All original tests passing locally.

Tasks before ready for review:

  • It looks like there is an issue with changing the SolverFactory version in a different place, which I will address.
  • Try and simplify interface, check with mentors.
  • Add tests for new functionality

@stephenscini stephenscini left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Went through and added some questions in the code for design meeting.

from pyomo.core.expr.compare import assertExpressionsEqual
from pyomo.core.expr.numeric_expr import LinearExpression

from pyomo.contrib.multistart.multi import MultiStart

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I received an error message when I added the solver to the new SolverFactory that it needed to be in this list. This would mean it is tested with the other solvers from contrib/solver and I am not sure that if that is expected? If so, will all contrib solvers need to eventually be switched over or should the opt/solvers still be the best location.

In this case, I wanted to update it to use these solvers so thought it would also go here. Maybe Legacy?

Comment thread pyomo/contrib/multistart/reinit.py Outdated
Comment thread pyomo/contrib/multistart/reinit.py
Comment thread pyomo/contrib/multistart/multi.py
Comment thread pyomo/contrib/multistart/multi.py
Comment thread pyomo/contrib/multistart/multi.py Outdated
visibility=visibility,
)

self.strategy = self.declare(

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Could/should this also support a user supplying a list of initial points? Thinking of obj_at_theta in parmest. Goal in my head is to make as generalized as possible.

Comment thread pyomo/contrib/multistart/multi.py
Comment thread pyomo/contrib/multistart/multi.py
Comment thread pyomo/contrib/multistart/multi.py Outdated
@stephenscini

Copy link
Copy Markdown
Member Author

Had discussion with Bethany and Michael. Main takeaway points:

  • Invest to make this work for newer SolverFactory. Do not keep in opt.SolverFactory.
  • Try and resolve all test failures with the new SolverFactory as default. More discussion needed on expectations for contrib solvers as they transition to new SolverFactory.
  • If all results are infeasible/not optimal, have it throw the 'NoOptimalSolution' error.
    -Keep this PR focused on a minimum working version that has key functionality we want. Can always add additional touches later.
  • LHS makes sense to be default for all methods/strategies, and should be looped in to the old strategies too.
  • Availability of multistart should depend on availablility of chosen sub-solver (default is ipopt)
  • Version 0.1.0 makes sense for this new iteration.
  • Subsolver has its own configuration, but still needs to comply with 'meta-solver' configurations. If subsolver timelimit is 1 minute for 50 runs, but metasolver is 10 minutes, when metasolver time runs out the methods stop.

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