Add optional jvp, vjp, hvp for vno#1
Open
andrewrosemberg wants to merge 5 commits intoar/vector-nonlinear-oraclefrom
Open
Add optional jvp, vjp, hvp for vno#1andrewrosemberg wants to merge 5 commits intoar/vector-nonlinear-oraclefrom
andrewrosemberg wants to merge 5 commits intoar/vector-nonlinear-oraclefrom
Conversation
…cks into ExaModel Introduces `VectorNonlinearOracle` (and the companion `ExaModelWithOracle`) so users can inject an arbitrary nonlinear constraint block — e.g. a GPU physics simulator or external ODE solver — without having to express it in ExaModels' SIMD generator language. Design: - `VectorNonlinearOracle` holds user callbacks `f!(c,x)`, `jac!(vals,x)`, `hess!(vals,x,y)` together with a pre-declared sparsity pattern and bounds. - `constraint(core, oracle)` registers an oracle in `ExaCore`, appending its constraint bounds and updating ncon/nnzj/nnzh. - `ExaModel(core)` automatically returns an `ExaModelWithOracle` (a new `AbstractExaModel` subtype) when oracles are registered, and the plain `ExaModel` otherwise. Existing code is unaffected. - `ExaModelWithOracle` carries the same SIMD fields as `ExaModel` (objs, cons, θ) plus a `Tuple` of oracles and pre-computed row/col offsets. All NLPModels callbacks (cons_nln!, jac_coord!, jac_structure!, hess_coord!, hess_structure!, jprod_nln!, jtprod_nln!, hprod!) are overloaded to first call the SIMD path then call each oracle's callback into the appropriate view. Sparsity convention (matching MadNLP/NLPModels): - `jac_rows/jac_cols` are 1-based within the oracle's own constraint block; the row-offset is applied automatically during `jac_structure!`. - `hess_rows/hess_cols` are 1-based variable indices (lower triangle of H). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
c492d0e to
bb78827
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
update exanauts#243