Skip to content

Commit

Permalink
🤖 Format .jl files (#252)
Browse files Browse the repository at this point in the history
Co-authored-by: tmigot <[email protected]>
  • Loading branch information
github-actions[bot] and tmigot authored Jun 20, 2024
1 parent 86f6ad6 commit 6ea9186
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 19 deletions.
15 changes: 12 additions & 3 deletions benchmark/hessian/benchmarks_coloring.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,21 @@ using ForwardDiff, SparseConnectivityTracer, SparseMatrixColorings, Symbolics

include("additional_backends.jl")

data_types = [Float64]
data_types = [Float64]

benchmark_list = [:optimized]

benchmarked_hess_coloring_backend = Dict(
"sparse" => ADNLPModels.SparseADHessian,
"sparse_symbolics" => (nvar, f, ncon, c!; kwargs...) -> ADNLPModels.SparseADHessian(nvar, f, ncon, c!; detector = SymbolicsSparsityDetector(), kwargs...),
"sparse_symbolics" =>
(nvar, f, ncon, c!; kwargs...) -> ADNLPModels.SparseADHessian(
nvar,
f,
ncon,
c!;
detector = SymbolicsSparsityDetector(),
kwargs...,
),
# add ColPack?
)
get_backend_list(::Val{:optimized}) = keys(benchmarked_hess_coloring_backend)
Expand All @@ -42,7 +50,8 @@ for f in benchmark_list
n = eval(Meta.parse("OptimizationProblems.get_" * pb * "_nvar(n = $(nscal))"))
m = eval(Meta.parse("OptimizationProblems.get_" * pb * "_ncon(n = $(nscal))"))
@info " $(pb): $T with $n vars and $m cons"
SUITE["$(fun)"][f][T][s][b][pb] = @benchmarkable set_adnlp($pb, $(name_backend), $backend, $nscal, $T)
SUITE["$(fun)"][f][T][s][b][pb] =
@benchmarkable set_adnlp($pb, $(name_backend), $backend, $nscal, $T)
end
end
end
Expand Down
4 changes: 1 addition & 3 deletions benchmark/hessian/benchmarks_hessian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ data_types = [Float32, Float64]

benchmark_list = [:optimized]

benchmarked_hessian_backend = Dict(
"sparse" => ADNLPModels.SparseADHessian,
)
benchmarked_hessian_backend = Dict("sparse" => ADNLPModels.SparseADHessian)
get_backend_list(::Val{:optimized}) = keys(benchmarked_hessian_backend)
get_backend(::Val{:optimized}, b::String) = benchmarked_hessian_backend[b]

Expand Down
4 changes: 1 addition & 3 deletions benchmark/hessian/benchmarks_hessian_lagrangian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ data_types = [Float32, Float64]

benchmark_list = [:optimized]

benchmarked_hessian_backend = Dict(
"sparse" => ADNLPModels.SparseADHessian,
)
benchmarked_hessian_backend = Dict("sparse" => ADNLPModels.SparseADHessian)
get_backend_list(::Val{:optimized}) = keys(benchmarked_hessian_backend)
get_backend(::Val{:optimized}, b::String) = benchmarked_hessian_backend[b]

Expand Down
15 changes: 12 additions & 3 deletions benchmark/jacobian/benchmarks_coloring.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,21 @@ using ForwardDiff, SparseConnectivityTracer, SparseMatrixColorings, Symbolics

include("additional_backends.jl")

data_types = [Float64]
data_types = [Float64]

benchmark_list = [:optimized]

benchmarked_jac_coloring_backend = Dict(
"sparse" => ADNLPModels.SparseADJacobian,
"sparse_symbolics" => (nvar, f, ncon, c!; kwargs...) -> ADNLPModels.SparseADJacobian(nvar, f, ncon, c!; detector = SymbolicsSparsityDetector(), kwargs...),
"sparse_symbolics" =>
(nvar, f, ncon, c!; kwargs...) -> ADNLPModels.SparseADJacobian(
nvar,
f,
ncon,
c!;
detector = SymbolicsSparsityDetector(),
kwargs...,
),
# add ColPack?
)
get_backend_list(::Val{:optimized}) = keys(benchmarked_jac_coloring_backend)
Expand All @@ -42,7 +50,8 @@ for f in benchmark_list
n = eval(Meta.parse("OptimizationProblems.get_" * pb * "_nvar(n = $(nscal))"))
m = eval(Meta.parse("OptimizationProblems.get_" * pb * "_ncon(n = $(nscal))"))
@info " $(pb): $T with $n vars and $m cons"
SUITE["$(fun)"][f][T][s][b][pb] = @benchmarkable set_adnlp($pb, $(name_backend), $backend, $nscal, $T)
SUITE["$(fun)"][f][T][s][b][pb] =
@benchmarkable set_adnlp($pb, $(name_backend), $backend, $nscal, $T)
end
end
end
Expand Down
4 changes: 1 addition & 3 deletions benchmark/jacobian/benchmarks_jacobian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ data_types = [Float32, Float64]

benchmark_list = [:optimized]

benchmarked_jacobian_backend = Dict(
"sparse" => ADNLPModels.SparseADJacobian,
)
benchmarked_jacobian_backend = Dict("sparse" => ADNLPModels.SparseADJacobian)
get_backend_list(::Val{:optimized}) = keys(benchmarked_jacobian_backend)
get_backend(::Val{:optimized}, b::String) = benchmarked_jacobian_backend[b]

Expand Down
4 changes: 1 addition & 3 deletions benchmark/jacobian/benchmarks_jacobian_residual.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ data_types = [Float32, Float64]

benchmark_list = [:optimized]

benchmarked_jacobian_backend = Dict(
"sparse" => ADNLPModels.SparseADJacobian,
)
benchmarked_jacobian_backend = Dict("sparse" => ADNLPModels.SparseADJacobian)
get_backend_list(::Val{:optimized}) = keys(benchmarked_jacobian_backend)
get_backend(::Val{:optimized}, b::String) = benchmarked_jacobian_backend[b]

Expand Down
5 changes: 4 additions & 1 deletion benchmark/problems_sets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ all_problems = meta[meta.nvar .> 5, :name] # all problems with ≥ 5 variables
all_problems = setdiff(all_problems, scalable_problems) # avoid duplicate problems

# all scalable least squares problems with ≥ 5 variables
scalable_nls_problems = meta[(meta.variable_nvar .== true) .&& (meta.nvar .> 5) .&& (meta.objtype .== :least_squares), :name]
scalable_nls_problems = meta[
(meta.variable_nvar .== true) .&& (meta.nvar .> 5) .&& (meta.objtype .== :least_squares),
:name,
]

all_cons_problems = meta[(meta.nvar .> 5) .&& (meta.ncon .> 5), :name] # all problems with ≥ 5 variables
scalable_cons_problems = meta[(meta.variable_nvar .== true) .&& (meta.ncon .> 5), :name] # problems that are scalable
Expand Down

0 comments on commit 6ea9186

Please sign in to comment.