Skip to content

BatchExaModel#216

Open
amontoison wants to merge 4 commits intomainfrom
am/batch
Open

BatchExaModel#216
amontoison wants to merge 4 commits intomainfrom
am/batch

Conversation

@amontoison
Copy link
Member

@amontoison amontoison commented Feb 5, 2026

@michel2323 michel2323 marked this pull request as ready for review February 13, 2026 21:18
@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

Your PR no longer requires formatting changes. Thank you for your contribution!

@amontoison amontoison changed the title First draft of BatchExaModel BatchExaModel Feb 14, 2026
@amontoison
Copy link
Member Author

@michel2323 Do you know how we can adapt the objective function to return a vector of nscenario instead of a scalar that is the sum of all objectives?
It is what we need for the new API of NLPModels.jl.

@michel2323
Copy link
Member

michel2323 commented Feb 18, 2026

Right. Forgot about the primal. How about the constraints?

I'll give it a try. Should be easy.

@amontoison
Copy link
Member Author

For the constraints, we want to a strided API where the cosntraints of each scenarios are stored in the same vector.
It is like TwoStageExaModel and exactly what we do.

@michel2323
Copy link
Member

For the objective, I've added the API below. This should be aligned with what be discussed back here.

    obj(model::TwoStageExaModel, x_global, s)  scalar

Evaluate the objective contribution of scenario s (for 1 ≤ s ≤ ns), or
the shared/design-only objective terms (for s = 0).

Per-scenario terms are Objective nodes whose iterator length is evenly divisible
by ns. Design-only terms (where length(itr) % ns != 0) are returned when s = 0.

The invariant obj(m, x) ≈ sum(obj(m, x, s) for s in 1:ns) + obj(m, x, 0) holds.

@michel2323
Copy link
Member

We decided on a vectorized API obj(::BatchExaModel, x, result) where result is a vector of size ns.

@michel2323 michel2323 force-pushed the am/batch branch 6 times, most recently from a17fa88 to 019aa55 Compare March 3, 2026 14:52
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.

2 participants