Skip to content

Add KNITRO persistent solver#3795

Draft
eminyouskn wants to merge 13 commits intoPyomo:mainfrom
eminyouskn:knitro-persistent
Draft

Add KNITRO persistent solver#3795
eminyouskn wants to merge 13 commits intoPyomo:mainfrom
eminyouskn:knitro-persistent

Conversation

@eminyouskn
Copy link
Contributor

Fixes NA

Summary/Motivation

This PR adds a persistent solver implementation for KNITRO.

Changes proposed in this PR

  • New persistent solver implementation for KNITRO that supports incremental addition of variables and constraints
  • Limitations of this implementation:
    • Does not support removal or modification of variables, constraints, or parameters (KNITRO itself does not support removal operations)
    • Does not automatically detect which components have been added or removed

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.

@blnicho blnicho requested a review from michaelbynum December 16, 2025 19:42
Comment on lines -52 to -53
CONFIG = KnitroConfig()
config: KnitroConfig
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason that you are taking this out of base? It seems like it makes more sense here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved it because the config of the persistent interface needs to inherit from the PersistentSolverConfig and the direct interface needs to not inherit from that class. So I moved the typehint to each implementation.

@mrmundt mrmundt self-requested a review January 27, 2026 19:43
@blnicho blnicho removed this from Pyomo 6.10 Feb 3, 2026
@jsiirola
Copy link
Member

jsiirola commented Feb 5, 2026

Overall, this looks good. My biggest question is why do so many solver tests need to be skipped for the persistent interface? Some of them look like they are testing pretty fundamental functionality,

@eminyouskn
Copy link
Contributor Author

@jsiirola Totally agree with you. I’ll rework this PR and remove those skips.

@eminyouskn eminyouskn marked this pull request as draft February 11, 2026 18:34
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.

3 participants