Skip to content

Commit 72b2f12

Browse files
remove sparsity detection
1 parent 7e13b6e commit 72b2f12

22 files changed

+7
-1069
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ os:
44
- linux
55
- osx
66
julia:
7-
- 1.2
7+
- 1.1
88
- nightly
99
matrix:
1010
allow_failures:

Project.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ VertexSafeGraphs = "19fa3120-7c27-5ec5-8db8-b0b0aa330d6f"
1818
julia = "1"
1919

2020
[extras]
21-
Cassette = "7057c7e9-c182-5462-911a-8362d720325c"
2221
IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153"
2322
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
2423
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"

README.md

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ like IterativeSolvers.jl for easy and efficient Newton-Krylov implementation. It
1010
possible to perform matrix coloring, and utilize coloring in Jacobian and Hessian
1111
construction.
1212

13-
Optionally, automatic and numerical differentiation are utilized and the ability to
14-
automatically detect the sparsity of a function is provided.
13+
Optionally, automatic and numerical differentiation are utilized.
1514

1615
## Example
1716

@@ -34,12 +33,12 @@ For this function, we know that the sparsity pattern of the Jacobian is a
3433
`Tridiagonal` matrix. However, if we didn't know the sparsity pattern for
3534
the Jacobian, we could use the `sparsity!` function to automatically
3635
detect the sparsity pattern. This function is only available if you
37-
load Cassette.jl as well. We declare that the function `f` outputs a
36+
load SparsityDetection.jl as well. We declare that the function `f` outputs a
3837
vector of length 30 and takes in a vector of length 30, and `sparsity!` spits
3938
out a `Sparsity` object which we can turn into a `SparseMatrixCSC`:
4039

4140
```julia
42-
using Cassette
41+
using SparsityDetection
4342
sparsity_pattern = sparsity!(f,output,input)
4443
jac = Float64.(sparse(sparsity_pattern))
4544
```
@@ -228,9 +227,9 @@ The `numauto` and `autonum` methods both mix numerical and automatic differentia
228227
the former almost always being more efficient and thus being recommended.
229228

230229
Optionally, if you load Zygote.jl, the following `numback`
231-
and `autoback` methods are available and allow numerical/ForwardDiff over reverse mode
230+
and `autoback` methods are available and allow numerical/ForwardDiff over reverse mode
232231
automatic differentiation respectively, where the reverse-mode AD is provided by Zygote.jl.
233-
Currently these methods are not competitive against `numauto`, but as Zygote.jl gets
232+
Currently these methods are not competitive against `numauto`, but as Zygote.jl gets
234233
optimized these will likely be the fastest.
235234

236235
```julia
@@ -266,33 +265,3 @@ These all have the same interface, where `J*v` utilizes the out-of-place
266265
Jacobian-vector or Hessian-vector function, whereas `mul!(res,J,v)` utilizes
267266
the appropriate in-place versions. To update the location of differentiation
268267
in the operator, simply mutate the vector `u`: `J.u .= ...`.
269-
270-
### Automated Sparsity Detection
271-
272-
Automated sparsity detection is provided by the `sparsity!` function. This requires
273-
`using Cassette` for Requires. The syntax is:
274-
275-
```julia
276-
`sparsity!(f, Y, X, args...; sparsity=Sparsity(length(X), length(Y)), verbose=true)`
277-
```
278-
279-
The arguments are:
280-
281-
- `f`: the function
282-
- `Y`: the output array
283-
- `X`: the input array
284-
- `args`: trailing arguments to `f`. They are considered subject to change, unless wrapped as `Fixed(arg)`
285-
- `S`: (optional) the sparsity pattern
286-
- `verbose`: (optional) whether to describe the paths taken by the sparsity detection.
287-
288-
The function `f` is assumed to take arguments of the form `f(dx,x,args...)`.
289-
`sparsity!` returns a `Sparsity` object which describes where the non-zeros
290-
of the Jacobian occur. `sparse(::Sparsity)` transforms the pattern into
291-
a sparse matrix.
292-
293-
This function utilizes non-standard interpretation, which we denote
294-
combinatoric concolic analysis, to directly realize the sparsity pattern from the program's AST. It requires that the function `f` is a Julia function. It does not
295-
work numerically, meaning that it is not prone to floating point error or
296-
cancelation. It allows for branching and will automatically check all of the
297-
branches. However, a while loop of indeterminate length which is dependent
298-
on the input argument is not allowed.

src/SparseDiffTools.jl

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -43,31 +43,6 @@ include("differentiation/compute_jacobian_ad.jl")
4343
include("differentiation/jaches_products.jl")
4444

4545
function __init__()
46-
@require Cassette="7057c7e9-c182-5462-911a-8362d720325c" begin
47-
using .Cassette
48-
using .Cassette: tag, untag, Tagged, metadata, hasmetadata, istagged, canrecurse
49-
using .Cassette: tagged_new_tuple, ContextTagged, BindingMeta, DisableHooks, nametype
50-
51-
using Core: SSAValue
52-
53-
export Sparsity, hsparsity, sparsity!
54-
55-
include("program_sparsity/program_sparsity.jl")
56-
include("program_sparsity/sparsity_tracker.jl")
57-
include("program_sparsity/path.jl")
58-
include("program_sparsity/take_all_branches.jl")
59-
include("program_sparsity/terms.jl")
60-
include("program_sparsity/linearity.jl")
61-
include("program_sparsity/hessian.jl")
62-
include("program_sparsity/blas.jl")
63-
64-
@require SpecialFunctions="276daf66-3868-5448-9aa4-cd146d93841b" begin
65-
using .SpecialFunctions
66-
67-
include("program_sparsity/linearity_special.jl")
68-
end
69-
end
70-
7146
@require Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" begin
7247
export numback_hesvec, numback_hesvec!, autoback_hesvec, autoback_hesvec!
7348

src/program_sparsity/blas.jl

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/program_sparsity/hessian.jl

Lines changed: 0 additions & 147 deletions
This file was deleted.

src/program_sparsity/linearity.jl

Lines changed: 0 additions & 78 deletions
This file was deleted.

src/program_sparsity/linearity_special.jl

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)