Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/src/benchmark.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Run a benchmark with OptimizationProblems.jl

> **Note:** When benchmarking, ensure that problems from ADNLP and PureJuMP implementations are strictly compatible (same initial point, bounds, constraints, and objective/constraint values within tolerance). Use meta fields for filtering and validation. Meta field completeness and accuracy are enforced by the test suite and are critical for reliable benchmarking.

Comment thread
arnavk23 marked this conversation as resolved.
Outdated
In this more advanced tutorial, we use the problems from `OptimizationProblems` to run a benchmark for unconstrained problems.
The tutorial will use:
- [JSOSolvers](https://github.com/JuliaSmoothOptimizers/JSOSolvers.jl): This package provides optimization solvers in pure Julia for unconstrained and bound-constrained optimization.
Expand Down
12 changes: 7 additions & 5 deletions docs/src/contributing.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Contributing to OptimizationProblems.jl

Comment thread
arnavk23 marked this conversation as resolved.
First off, thanks for taking the time to contribute!

## Bug reports and discussions
Expand All @@ -19,12 +18,12 @@ Here is a to-do list, to help you add new problems:
- `src/ADNLPProblems/problem_name.jl`
- `src/PureJuMP/problem_name.jl`
- `src/Meta/problem_name.jl`
In both cases, the function must have the same name `problem_name` as the file.
In both cases, the function must have the same name `problem_name` as the file and the objective must be callable at the starting point and should not return NaN unless expected.
Comment thread
arnavk23 marked this conversation as resolved.
Outdated
* When submitting a problem, please pay particular attention to the documentation. We would like to gather as much information as possible on the provenance of problems, other problem sets where the problems are present, and general information on the problem.
The documentation should be added to the file in the `PureJuMP` folder.
* New problems can be scalable, see [ADNLPProblems/arglina.jl](https://github.com/JuliaSmoothOptimizers/OptimizationProblems.jl/blob/main/src/ADNLPProblems/arglina.jl) and [PureJuMP/arglina.jl](https://github.com/JuliaSmoothOptimizers/OptimizationProblems.jl/blob/main/src/PureJuMP/arglina.jl) for examples. In that case, the first keyword parameter should be the number of variables `n::Int` and have the default value `default_nvar` (constant predefined in the module). If your problem has restrictions on the number of variables, e.g., `n` should be odd, or `n` should have the form `4k + 3`, then, instead of throwing errors when the restrictions are not satisfied, you should instead use the number of variables to be as close to `n` as possible. For example, if you want `n` odd and `n = 100` is passed, you can internally convert to `n = 99`. If you want `n = 4k + 3`, and `n = 100` is passed, then compute `k = round(Int, (n - 3) / 4)` and update `n`.
* A first version of the `meta` can be generated using `generate_meta`. A `String` is returned that can be copy-pasted into the `Meta` folder, and then edited.

* A first version of the `meta` can be generated using `generate_meta`. A `String` is returned that can be copy-pasted into the `Meta` folder, and then edited. Ensure all meta fields are accurate and complete including `nvar`, `ncon`, linear/nonlinear counts, feasibility, origin, objtype, contype and best-known bounds.
Comment thread
arnavk23 marked this conversation as resolved.
Outdated
* For problem implementation in both ADNLP and PureJuMP, use the same initial point, variable bounds, constraint bounds and ensure objective and constraint values match within a relative tolerance.
Comment thread
arnavk23 marked this conversation as resolved.
Outdated
```julia
using ADNLPModels, Distributed, NLPModels, NLPModelsJuMP, OptimizationProblems, Test
include("test/utils.jl")
Expand All @@ -33,7 +32,10 @@ The documentation should be added to the file in the `PureJuMP` folder.
create_meta_files(String["catmix", "gasoil", "glider", "methanol", "pinene", "rocket", "steering"])
```

* Problems modeled with `ADNLPModels` should be type-stable, i.e. they should all have keyword argument `type::Type{T} = Float64` where `T` is the type of the initial guess and the type used by the `NLPModel` API.
* Problems modeled with `ADNLPModels` should be type-stable, i.e. they should all have keyword argument `type::Type{T} = Float64` where `T` is the type of the initial guess and the type used by the `NLPModel` API
and should support the `nls=true/false` keyword to allow both `ADNLPModel` and `ADNLSModel` instantiation from the same problem.
* For least-squares problems, instantiate both `ADNLPModel` and `ADNLSModel` and ensure `residual!(nls, x, Fx)` is allocation-free with the objectives agree (or differ by a factor of 2 for LS).
* For variable-size problems, verify that different values of `n` produce correct `nvar`, meta formulas predict actual values and instantiation works at various sizes.
Comment thread
arnavk23 marked this conversation as resolved.
Outdated

## Templates for the new functions

Expand Down
1 change: 1 addition & 0 deletions docs/src/meta.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ using OptimizationProblems
```

Each problem has its own metadata structure, and there is a global metadata structure regrouping all the information.
All meta fields must be accurate and complete including `nvar`, `ncon`, linear/nonlinear counts, feasibility, origin, objtype, contype and best-known bounds. Meta validation is enforced by the test suite. Incomplete or incorrect meta fields may cause solver failures or benchmarking errors.
Comment thread
arnavk23 marked this conversation as resolved.
Outdated

## Problem's metadata

Expand Down
Loading