From 95a97d24a3fc549b87d99cc395f3c5eeb797154b Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Fri, 8 Nov 2024 10:23:17 +1300 Subject: [PATCH 1/7] Enable LP subproblem in julia/runtests.jl --- .github/julia/runtests.jl | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/julia/runtests.jl b/.github/julia/runtests.jl index d3c4e6dd..f08333bd 100644 --- a/.github/julia/runtests.jl +++ b/.github/julia/runtests.jl @@ -18,11 +18,12 @@ import Uno_jll Create a new `AmplNLWriter.Optimizer` object that uses Uno as the backing solver. """ -function Optimizer() - options = String["logger=INFO"] +function Optimizer(options = String["logger=INFO"]) return AmplNLWriter.Optimizer(Uno_jll.amplexe, options) end +Optimizer_LP() = Optimizer(["logger=INFO", "subproblem=LP"]) + # This testset runs https://github.com/jump-dev/MINLPTests.jl @testset "MINLPTests" begin primal_target = Dict( @@ -34,23 +35,22 @@ end # 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; - exclude = [ - # Remove once https://github.com/cvanaret/Uno/issues/39 is fixed - "005_010", - # Okay to exclude forever: AmplNLWriter does not support - # user-defined functions. - "006_010", - # Remove once https://github.com/cvanaret/Uno/issues/38 is fixed - "007_010", - ], - primal_target = primal_target, - ) + exclude = [ + # Remove once https://github.com/cvanaret/Uno/issues/39 is fixed + "005_010", + # Okay to exclude forever: AmplNLWriter does not support + # user-defined functions. + "006_010", + # Remove once https://github.com/cvanaret/Uno/issues/38 is fixed + "007_010", + ] + MINLPTests.test_nlp_expr(Optimizer; exclude, primal_target) + MINLPTests.test_nlp_expr(Optimizer_LP; exclude, 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; primal_target) + MINLPTests.test_nlp_cvx_expr(Optimizer_LP; primal_target) end # This testset runs the full gamut of MOI.Test.runtests. There are a number of From 81a7b1d7dbb210d3d4b0415378651743b8ef7ba7 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Fri, 15 Nov 2024 10:15:24 +1300 Subject: [PATCH 2/7] Update .github/julia/runtests.jl --- .github/julia/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/julia/runtests.jl b/.github/julia/runtests.jl index f08333bd..4681a0f3 100644 --- a/.github/julia/runtests.jl +++ b/.github/julia/runtests.jl @@ -22,7 +22,7 @@ function Optimizer(options = String["logger=INFO"]) return AmplNLWriter.Optimizer(Uno_jll.amplexe, options) end -Optimizer_LP() = Optimizer(["logger=INFO", "subproblem=LP"]) +Optimizer_LP() = Optimizer(["logger=INFO", "preset=filterslp"]) # This testset runs https://github.com/jump-dev/MINLPTests.jl @testset "MINLPTests" begin From daf97bfa339d4a5211f3d863d9b68d32247495e7 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Fri, 15 Nov 2024 10:21:15 +1300 Subject: [PATCH 3/7] Apply suggestions from code review --- .github/julia/runtests.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/julia/runtests.jl b/.github/julia/runtests.jl index 4681a0f3..c6a4080f 100644 --- a/.github/julia/runtests.jl +++ b/.github/julia/runtests.jl @@ -18,11 +18,11 @@ import Uno_jll Create a new `AmplNLWriter.Optimizer` object that uses Uno as the backing solver. """ -function Optimizer(options = String["logger=INFO"]) +function Optimizer(options = String["logger=SILENT"]) return AmplNLWriter.Optimizer(Uno_jll.amplexe, options) end -Optimizer_LP() = Optimizer(["logger=INFO", "preset=filterslp"]) +Optimizer_LP() = Optimizer(["logger=SILENT", "preset=filterslp"]) # This testset runs https://github.com/jump-dev/MINLPTests.jl @testset "MINLPTests" begin From 5276975d638045a77029a3e9ac903f0800ed06b9 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Fri, 15 Nov 2024 10:35:00 +1300 Subject: [PATCH 4/7] Update runtests.jl --- .github/julia/runtests.jl | 48 +++++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/.github/julia/runtests.jl b/.github/julia/runtests.jl index c6a4080f..7a8e7427 100644 --- a/.github/julia/runtests.jl +++ b/.github/julia/runtests.jl @@ -35,22 +35,46 @@ Optimizer_LP() = Optimizer(["logger=SILENT", "preset=filterslp"]) # 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. - exclude = [ - # Remove once https://github.com/cvanaret/Uno/issues/39 is fixed - "005_010", - # Okay to exclude forever: AmplNLWriter does not support - # user-defined functions. - "006_010", - # Remove once https://github.com/cvanaret/Uno/issues/38 is fixed - "007_010", - ] - MINLPTests.test_nlp_expr(Optimizer; exclude, primal_target) - MINLPTests.test_nlp_expr(Optimizer_LP; exclude, primal_target) + MINLPTests.test_nlp_expr( + Optimizer; + exclude = [ + # Remove once https://github.com/cvanaret/Uno/issues/39 is fixed + "005_010", + # Okay to exclude forever: AmplNLWriter does not support + # user-defined functions. + "006_010", + # Remove once https://github.com/cvanaret/Uno/issues/38 is fixed + "007_010", + ], + primal_target, + ) + MINLPTests.test_nlp_expr( + Optimizer_LP; + exclude = [ + "001_010", # Local solution + "003_014", # Local solution + # Remove once https://github.com/cvanaret/Uno/issues/39 is fixed + "005_010", + # Okay to exclude forever: AmplNLWriter does not support + # user-defined functions. + "006_010", + # Remove once https://github.com/cvanaret/Uno/issues/38 is fixed + "007_010", + ], + primal_target, + objective_tol = 1e-4, + primal_tol = 1e-4, + ) # 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; primal_target) - MINLPTests.test_nlp_cvx_expr(Optimizer_LP; primal_target) + MINLPTests.test_nlp_cvx_expr( + Optimizer_LP; + primal_target, + objective_tol = 1e-4, + primal_tol = 1e-4, + ) end # This testset runs the full gamut of MOI.Test.runtests. There are a number of From 2b7998a9954eec6b6e3353001c05eb1bbb70a977 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Fri, 15 Nov 2024 10:42:55 +1300 Subject: [PATCH 5/7] Update runtests.jl --- .github/julia/runtests.jl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/julia/runtests.jl b/.github/julia/runtests.jl index 7a8e7427..eb187ab7 100644 --- a/.github/julia/runtests.jl +++ b/.github/julia/runtests.jl @@ -60,6 +60,8 @@ Optimizer_LP() = Optimizer(["logger=SILENT", "preset=filterslp"]) "006_010", # Remove once https://github.com/cvanaret/Uno/issues/38 is fixed "007_010", + # TODO: investigate why this fails + "008_010", ], primal_target, objective_tol = 1e-4, @@ -74,6 +76,12 @@ Optimizer_LP() = Optimizer(["logger=SILENT", "preset=filterslp"]) primal_target, objective_tol = 1e-4, primal_tol = 1e-4, + exclude = [ + # TODO: investigate why this fails + "501_010", + # TODO: investigate why this fails + "501_011", + ], ) end From 24b6b035ff4054cbc381e8b5c2bffa9eb2a7fe0e Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Fri, 15 Nov 2024 11:46:47 +1300 Subject: [PATCH 6/7] Update runtests.jl --- .github/julia/runtests.jl | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/julia/runtests.jl b/.github/julia/runtests.jl index eb187ab7..6321ab3a 100644 --- a/.github/julia/runtests.jl +++ b/.github/julia/runtests.jl @@ -22,7 +22,7 @@ function Optimizer(options = String["logger=SILENT"]) return AmplNLWriter.Optimizer(Uno_jll.amplexe, options) end -Optimizer_LP() = Optimizer(["logger=SILENT", "preset=filterslp"]) +Optimizer_LP() = Optimizer(["logger=SILENT", "preset=filterslp", "max_iterations=10000"]) # This testset runs https://github.com/jump-dev/MINLPTests.jl @testset "MINLPTests" begin @@ -53,6 +53,7 @@ Optimizer_LP() = Optimizer(["logger=SILENT", "preset=filterslp"]) exclude = [ "001_010", # Local solution "003_014", # Local solution + "008_010", # Local solution # Remove once https://github.com/cvanaret/Uno/issues/39 is fixed "005_010", # Okay to exclude forever: AmplNLWriter does not support @@ -60,8 +61,6 @@ Optimizer_LP() = Optimizer(["logger=SILENT", "preset=filterslp"]) "006_010", # Remove once https://github.com/cvanaret/Uno/issues/38 is fixed "007_010", - # TODO: investigate why this fails - "008_010", ], primal_target, objective_tol = 1e-4, @@ -76,12 +75,6 @@ Optimizer_LP() = Optimizer(["logger=SILENT", "preset=filterslp"]) primal_target, objective_tol = 1e-4, primal_tol = 1e-4, - exclude = [ - # TODO: investigate why this fails - "501_010", - # TODO: investigate why this fails - "501_011", - ], ) end From 653375b90677f7577eb69966ac0ab1476dd842d6 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Fri, 15 Nov 2024 12:06:48 +1300 Subject: [PATCH 7/7] Update runtests.jl --- .github/julia/runtests.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/julia/runtests.jl b/.github/julia/runtests.jl index 6321ab3a..dda903ed 100644 --- a/.github/julia/runtests.jl +++ b/.github/julia/runtests.jl @@ -75,6 +75,7 @@ Optimizer_LP() = Optimizer(["logger=SILENT", "preset=filterslp", "max_iterations primal_target, objective_tol = 1e-4, primal_tol = 1e-4, + exclude = ["501_011"], # Iteration limit ) end