-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into gd/shared_hessian
- Loading branch information
Showing
43 changed files
with
943 additions
and
1,058 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# SparseConnectivityTracer.jl | ||
|
||
## Version `v0.6.0` | ||
* ![BREAKING][badge-breaking] Remove `ConnectivityTracer` ([#140][pr-140]) | ||
* ![BREAKING][badge-breaking] Remove legacy interface ([#140][pr-140]) | ||
* instead of `jacobian_pattern(f, x)`, use `jacobian_sparsity(f, x, TracerSparsityDetector())` | ||
* instead of `hessian_pattern(f, x)`, use `hessian_sparsity(f, x, TracerSparsityDetector())` | ||
* instead of `local_jacobian_pattern(f, x)`, use `jacobian_sparsity(f, x, TracerLocalSparsityDetector())` | ||
* instead of `local_hessian_pattern(f, x)`, use `hessian_sparsity(f, x, TracerLocalSparsityDetector())` | ||
* ![Bugfix][badge-bugfix] Remove overloads on `similar` to reduce amount of invalidations ([#132][pr-132]) | ||
* ![Enhancement][badge-enhancement] Add array overloads ([#131][pr-131]) | ||
* ![Enhancement][badge-enhancement] Generalize sparsity pattern representations ([#139][pr-139], [#119][pr-119]) | ||
* ![Enhancement][badge-enhancement] Reduce allocations of new tracers ([#128][pr-128]) | ||
* ![Enhancement][badge-enhancement] Reduce compile times ([#119][pr-119]) | ||
|
||
[pr-140]: https://github.com/adrhill/SparseConnectivityTracer.jl/pull/140 | ||
[pr-139]: https://github.com/adrhill/SparseConnectivityTracer.jl/pull/139 | ||
[pr-132]: https://github.com/adrhill/SparseConnectivityTracer.jl/pull/132 | ||
[pr-131]: https://github.com/adrhill/SparseConnectivityTracer.jl/pull/131 | ||
[pr-128]: https://github.com/adrhill/SparseConnectivityTracer.jl/pull/128 | ||
[pr-126]: https://github.com/adrhill/SparseConnectivityTracer.jl/pull/126 | ||
[pr-119]: https://github.com/adrhill/SparseConnectivityTracer.jl/pull/119 | ||
|
||
<!-- | ||
# Badges | ||
![BREAKING][badge-breaking] | ||
![Deprecation][badge-deprecation] | ||
![Feature][badge-feature] | ||
![Enhancement][badge-enhancement] | ||
![Bugfix][badge-bugfix] | ||
![Experimental][badge-experimental] | ||
![Maintenance][badge-maintenance] | ||
![Documentation][badge-docs] | ||
--> | ||
|
||
[badge-breaking]: https://img.shields.io/badge/BREAKING-red.svg | ||
[badge-deprecation]: https://img.shields.io/badge/deprecation-orange.svg | ||
[badge-feature]: https://img.shields.io/badge/feature-green.svg | ||
[badge-enhancement]: https://img.shields.io/badge/enhancement-blue.svg | ||
[badge-bugfix]: https://img.shields.io/badge/bugfix-purple.svg | ||
[badge-security]: https://img.shields.io/badge/security-black.svg | ||
[badge-experimental]: https://img.shields.io/badge/experimental-lightgrey.svg | ||
[badge-maintenance]: https://img.shields.io/badge/maintenance-gray.svg | ||
[badge-docs]: https://img.shields.io/badge/docs-orange.svg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name = "SparseConnectivityTracerBenchmarks" | ||
uuid = "fb1f6577-eb25-4e27-a243-7f62c22307d7" | ||
authors = ["Guillaume Dalle", "Adrian Hill"] | ||
version = "0.1.0" | ||
|
||
[deps] | ||
ADNLPModels = "54578032-b7ea-4c30-94aa-7cbd1cce6c9a" | ||
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" | ||
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" | ||
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" | ||
NLPModels = "a4795742-8479-5a88-8948-cc11e1c8c1a6" | ||
NLPModelsJuMP = "792afdf1-32c1-5681-94e0-d7bf7a5df49e" | ||
OptimizationProblems = "5049e819-d29b-5fba-b941-0eee7e64c1c6" | ||
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" | ||
SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5" |
27 changes: 27 additions & 0 deletions
27
benchmark/SparseConnectivityTracerBenchmarks/src/SparseConnectivityTracerBenchmarks.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module SparseConnectivityTracerBenchmarks | ||
|
||
module ODE | ||
include("brusselator.jl") | ||
export Brusselator!, brusselator_2d_loop! | ||
end | ||
|
||
module Optimization | ||
using ADTypes: ADTypes | ||
using SparseConnectivityTracer | ||
import SparseConnectivityTracer as SCT | ||
|
||
using ADNLPModels: ADNLPModels | ||
using NLPModels: NLPModels, AbstractNLPModel | ||
using NLPModelsJuMP: NLPModelsJuMP | ||
using OptimizationProblems: OptimizationProblems | ||
|
||
using LinearAlgebra | ||
using SparseArrays | ||
|
||
include("nlpmodels.jl") | ||
export optimization_problem_names | ||
export compute_jac_sparsity_sct, compute_hess_sparsity_sct | ||
export compute_jac_and_hess_sparsity_sct, compute_jac_and_hess_sparsity_and_value_jump | ||
end | ||
|
||
end # module SparseConnectivityTracerBenchmarks |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using Pkg | ||
Pkg.develop(; path=joinpath(@__DIR__, "SparseConnectivityTracerBenchmarks")) | ||
|
||
using BenchmarkTools | ||
using SparseConnectivityTracer | ||
using SparseConnectivityTracer: GradientTracer, HessianTracer | ||
using SparseConnectivityTracer: IndexSetGradientPattern, IndexSetHessianPattern | ||
using SparseConnectivityTracer: DuplicateVector, SortedVector, RecursiveSet | ||
|
||
SET_TYPES = (BitSet, Set{Int}, DuplicateVector{Int}, RecursiveSet{Int}, SortedVector{Int}) | ||
|
||
include("jacobian.jl") | ||
include("hessian.jl") | ||
include("nlpmodels.jl") | ||
|
||
suite = BenchmarkGroup() | ||
|
||
suite["OptimizationProblems"] = optbench([:britgas]) | ||
|
||
for S1 in SET_TYPES | ||
S2 = Set{Tuple{Int,Int}} | ||
|
||
PG = IndexSetGradientPattern{Int,S1} | ||
PH = IndexSetHessianPattern{Int,S1,S2} | ||
|
||
G = GradientTracer{PG} | ||
H = HessianTracer{PH} | ||
|
||
suite["Jacobian"]["Global"][nameof(S1)] = jacbench(TracerSparsityDetector(G, H)) | ||
suite["Jacobian"]["Local"][nameof(S1)] = jacbench(TracerLocalSparsityDetector(G, H)) | ||
suite["Hessian"]["Global"][(nameof(S1), nameof(S2))] = hessbench( | ||
TracerSparsityDetector(G, H) | ||
) | ||
suite["Hessian"]["Local"][(nameof(S1), nameof(S2))] = hessbench( | ||
TracerLocalSparsityDetector(G, H) | ||
) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,5 @@ | ||
using BenchmarkTools | ||
using PkgJogger | ||
using SparseConnectivityTracer | ||
using SparseConnectivityTracer: GradientTracer, HessianTracer | ||
using SparseConnectivityTracer: DuplicateVector, SortedVector, RecursiveSet | ||
|
||
SET_TYPES = (BitSet, Set{Int}, DuplicateVector{Int}, RecursiveSet{Int}, SortedVector{Int}) | ||
|
||
include("jacobian.jl") | ||
include("hessian.jl") | ||
include("nlpmodels.jl") | ||
|
||
SUITE = BenchmarkGroup() | ||
|
||
SUITE["OptimizationProblems"] = optbench([:britgas]) | ||
|
||
for S1 in SET_TYPES | ||
S2 = Set{Tuple{Int,Int}} | ||
|
||
G = GradientTracer{S1} | ||
H = HessianTracer{S1,S2,false} | ||
H_shared = HessianTracer{S1,S2,true} | ||
|
||
SUITE["Jacobian"]["Global"][nameof(S1)] = jacbench(TracerSparsityDetector(G, H)) | ||
SUITE["Jacobian"]["Local"][nameof(S1)] = jacbench(TracerLocalSparsityDetector(G, H)) | ||
SUITE["Hessian"]["Global"][(nameof(S1), nameof(S2))] = hessbench( | ||
TracerSparsityDetector(G, H) | ||
) | ||
SUITE["Hessian"]["Global (shared)"][(nameof(S1), nameof(S2))] = hessbench( | ||
TracerSparsityDetector(G, H_shared) | ||
) | ||
SUITE["Hessian"]["Local"][(nameof(S1), nameof(S2))] = hessbench( | ||
TracerLocalSparsityDetector(G, H) | ||
) | ||
end | ||
# Use PkgJogger.@jog to create the JogSparseConnectivityTracer module | ||
@jog SparseConnectivityTracer | ||
SUITE = JogSparseConnectivityTracer.suite() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.