Skip to content
Open
Changes from all 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
94 changes: 91 additions & 3 deletions .github/julia/runtests_uno_filtersqp_highs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ function Optimizer(options)
end

# Note: the HiGHS QP solver tolerates only positive semi-definite Hessians.
# We therefore run only on convex instances (for now)
Optimizer_Uno_filtersqp() = Optimizer(["logger=SILENT", "preset=filtersqp", "QP_solver=HiGHS", "max_iterations=10000", "unbounded_objective_threshold=-1e15"])
# We therefore use primal regularization.
Optimizer_Uno_filtersqp() = Optimizer(["logger=SILENT", "preset=filtersqp", "regularization_strategy=primal", "QP_solver=HiGHS", "max_iterations=10000", "unbounded_objective_threshold=-1e15"])

# This testset runs https://github.com/jump-dev/MINLPTests.jl
@testset "MINLPTests" begin
Expand All @@ -34,15 +34,103 @@ Optimizer_Uno_filtersqp() = Optimizer(["logger=SILENT", "preset=filtersqp", "QP_
)
primal_tol = 1e-4
objective_tol = 1e-4
# This function tests (potentially) non-convex nonlinear programs. The tests
# are meant to be "easy" in the sense that most NLP solvers can find the
# same global minimum, but a test failure can sometimes be allowed.
MINLPTests.test_nlp_expr(
Optimizer_Uno_filtersqp;
exclude = [
"003_014", # Local solution
"004_010", # Local solution
"004_011", # Local solution
# Remove once https://github.com/cvanaret/Uno/issues/39 is fixed
"005_010",
"007_010",
"008_010", # Local solution
# Okay to exclude forever: AmplNLWriter does not support
# user-defined functions.
"006_010",
],
primal_target,
)
# This function tests convex nonlinear programs. Test failures here should
# never be allowed, because even local NLP solvers should find the global
# optimum.
MINLPTests.test_nlp_cvx_expr(Optimizer_Uno_filtersqp;
exclude = [
"102_010", "105_010", "201_011", "501_010", # negative curvature
"110_010" # HiGHS cannot solve the first QP (https://github.com/ERGO-Code/HiGHS/issues/2489)
],
primal_target,
primal_tol,
objective_tol)
end

# This testset runs the full gamut of MOI.Test.runtests. There are a number of
# tests in here with weird edge cases, so a variety of exclusions are expected.
@testset "MathOptInterface.test" begin
optimizer = MOI.instantiate(
Optimizer_Uno_filtersqp;
with_cache_type = Float64,
with_bridge_type = Float64,
)
MOI.Test.runtests(
optimizer,
MOI.Test.Config(
# These are pretty loose tolerances so that all tests pass. There
# are few tests with weird numerics. If tests fail because of
# tolerances, it might be okay to make these looser, or you could
# tighten the tolerances used by Uno.
atol = 1e-4,
rtol = 1e-4,
optimal_status = MOI.LOCALLY_SOLVED,
infeasible_status = MOI.LOCALLY_INFEASIBLE,
exclude = Any[
# It's okay to exclude BasisStatus, since AmplNLWriter doesn't
# support this information, so too with ObjectiveBound, since
# Uno is a local NLP solver.
MOI.VariableBasisStatus,
MOI.ConstraintBasisStatus,
MOI.ObjectiveBound,
],
);
exclude = [
# ==================================================================
# The following tests are bugs.
#
# We should fix issues in Uno, and then try removing these lines.
#
# These tests return OTHER_LIMIT instead of LOCALLY_INFEASIBLE. It
# might be acceptable to leave this as-is, but it would be better to
# fix.
r"^test_conic_NormInfinityCone_INFEASIBLE$",
r"^test_conic_NormOneCone_INFEASIBLE$",
r"^test_conic_linear_INFEASIBLE$",
r"^test_conic_linear_INFEASIBLE_2$",
r"^test_linear_INFEASIBLE$",
r"^test_linear_INFEASIBLE_2$",
r"^test_quadratic_SecondOrderCone_basic$",
r"^test_quadratic_nonconvex_constraint_basic$",
r"^test_linear_DUAL_INFEASIBLE$",
r"^test_linear_DUAL_INFEASIBLE_2$",
r"^test_solve_TerminationStatus_DUAL_INFEASIBLE$",
r"^test_solve_DualStatus_INFEASIBILITY_CERTIFICATE_",
# ==================================================================
# The following tests are okay to exclude forever.
#
# Uno does not support integrality, and AmplNLWriter has no way of
# telling if a particular binary supports integers or not (it
# defaults to assuming yes).
"Indicator",
r"[Ii]nteger",
"Semicontinuous",
"Semiinteger",
"SOS1",
"SOS2",
"ZeroOne",
r"^test_cpsat_",
r"^test_attribute_SolverVersion$",
r"^test_nonlinear_invalid$",
r"^test_basic_VectorNonlinearFunction_",
],
)
end
Loading