Skip to content

Commit 6593133

Browse files
Merge pull request #371 from ArnoStrouwen/doc1.0
try documenter 1.0 upgrade
2 parents 5a25b7d + daf7212 commit 6593133

19 files changed

+197
-120
lines changed

.github/workflows/CI.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@ on:
33
pull_request:
44
branches:
55
- main
6+
paths-ignore:
7+
- 'docs/**'
68
push:
79
branches:
810
- main
11+
paths-ignore:
12+
- 'docs/**'
913
jobs:
1014
test:
1115
runs-on: ubuntu-latest

benchmarks/applelu.jl

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ function luflop(m, n = m; innerflop = 2)
1818
end
1919
end
2020

21-
algs = [LUFactorization(), GenericLUFactorization(), RFLUFactorization(), AppleAccelerateLUFactorization(), MetalLUFactorization()]
21+
algs = [
22+
LUFactorization(),
23+
GenericLUFactorization(),
24+
RFLUFactorization(),
25+
AppleAccelerateLUFactorization(),
26+
MetalLUFactorization(),
27+
]
2228
res = [Float32[] for i in 1:length(algs)]
2329

2430
ns = 4:8:500
@@ -28,10 +34,14 @@ for i in 1:length(ns)
2834
rng = MersenneTwister(123)
2935
global A = rand(rng, Float32, n, n)
3036
global b = rand(rng, Float32, n)
31-
global u0= rand(rng, Float32, n)
32-
37+
global u0 = rand(rng, Float32, n)
38+
3339
for j in 1:length(algs)
34-
bt = @belapsed solve(prob, $(algs[j])).u setup=(prob = LinearProblem(copy(A), copy(b); u0 = copy(u0), alias_A=true, alias_b=true))
40+
bt = @belapsed solve(prob, $(algs[j])).u setup=(prob = LinearProblem(copy(A),
41+
copy(b);
42+
u0 = copy(u0),
43+
alias_A = true,
44+
alias_b = true))
3545
push!(res[j], luflop(n) / bt / 1e9)
3646
end
3747
end
@@ -41,11 +51,17 @@ __parameterless_type(T) = Base.typename(T).wrapper
4151
parameterless_type(x) = __parameterless_type(typeof(x))
4252
parameterless_type(::Type{T}) where {T} = __parameterless_type(T)
4353

44-
p = plot(ns, res[1]; ylabel = "GFLOPs", xlabel = "N", title = "GFLOPs for NxN LU Factorization", label = string(Symbol(parameterless_type(algs[1]))), legend=:outertopright)
54+
p = plot(ns,
55+
res[1];
56+
ylabel = "GFLOPs",
57+
xlabel = "N",
58+
title = "GFLOPs for NxN LU Factorization",
59+
label = string(Symbol(parameterless_type(algs[1]))),
60+
legend = :outertopright)
4561
for i in 2:length(res)
4662
plot!(p, ns, res[i]; label = string(Symbol(parameterless_type(algs[i]))))
4763
end
4864
p
4965

5066
savefig("metallubench.png")
51-
savefig("metallubench.pdf")
67+
savefig("metallubench.pdf")

benchmarks/cudalu.jl

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,14 @@ for i in 1:length(ns)
2828
rng = MersenneTwister(123)
2929
global A = rand(rng, Float32, n, n)
3030
global b = rand(rng, Float32, n)
31-
global u0= rand(rng, Float32, n)
32-
31+
global u0 = rand(rng, Float32, n)
32+
3333
for j in 1:length(algs)
34-
bt = @belapsed solve(prob, $(algs[j])).u setup=(prob = LinearProblem(copy(A), copy(b); u0 = copy(u0), alias_A=true, alias_b=true))
34+
bt = @belapsed solve(prob, $(algs[j])).u setup=(prob = LinearProblem(copy(A),
35+
copy(b);
36+
u0 = copy(u0),
37+
alias_A = true,
38+
alias_b = true))
3539
push!(res[j], luflop(n) / bt / 1e9)
3640
end
3741
end
@@ -41,11 +45,17 @@ __parameterless_type(T) = Base.typename(T).wrapper
4145
parameterless_type(x) = __parameterless_type(typeof(x))
4246
parameterless_type(::Type{T}) where {T} = __parameterless_type(T)
4347

44-
p = plot(ns, res[1]; ylabel = "GFLOPs", xlabel = "N", title = "GFLOPs for NxN LU Factorization", label = string(Symbol(parameterless_type(algs[1]))), legend=:outertopright)
48+
p = plot(ns,
49+
res[1];
50+
ylabel = "GFLOPs",
51+
xlabel = "N",
52+
title = "GFLOPs for NxN LU Factorization",
53+
label = string(Symbol(parameterless_type(algs[1]))),
54+
legend = :outertopright)
4555
for i in 2:length(res)
4656
plot!(p, ns, res[i]; label = string(Symbol(parameterless_type(algs[i]))))
4757
end
4858
p
4959

5060
savefig("cudaoffloadlubench.png")
51-
savefig("cudaoffloadlubench.pdf")
61+
savefig("cudaoffloadlubench.pdf")

benchmarks/lu.jl

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ function luflop(m, n = m; innerflop = 2)
1818
end
1919
end
2020

21-
algs = [LUFactorization(), GenericLUFactorization(), RFLUFactorization(), MKLLUFactorization(), FastLUFactorization(), SimpleLUFactorization()]
21+
algs = [
22+
LUFactorization(),
23+
GenericLUFactorization(),
24+
RFLUFactorization(),
25+
MKLLUFactorization(),
26+
FastLUFactorization(),
27+
SimpleLUFactorization(),
28+
]
2229
res = [Float64[] for i in 1:length(algs)]
2330

2431
ns = 4:8:500
@@ -28,10 +35,14 @@ for i in 1:length(ns)
2835
rng = MersenneTwister(123)
2936
global A = rand(rng, n, n)
3037
global b = rand(rng, n)
31-
global u0= rand(rng, n)
32-
38+
global u0 = rand(rng, n)
39+
3340
for j in 1:length(algs)
34-
bt = @belapsed solve(prob, $(algs[j])).u setup=(prob = LinearProblem(copy(A), copy(b); u0 = copy(u0), alias_A=true, alias_b=true))
41+
bt = @belapsed solve(prob, $(algs[j])).u setup=(prob = LinearProblem(copy(A),
42+
copy(b);
43+
u0 = copy(u0),
44+
alias_A = true,
45+
alias_b = true))
3546
push!(res[j], luflop(n) / bt / 1e9)
3647
end
3748
end
@@ -41,11 +52,17 @@ __parameterless_type(T) = Base.typename(T).wrapper
4152
parameterless_type(x) = __parameterless_type(typeof(x))
4253
parameterless_type(::Type{T}) where {T} = __parameterless_type(T)
4354

44-
p = plot(ns, res[1]; ylabel = "GFLOPs", xlabel = "N", title = "GFLOPs for NxN LU Factorization", label = string(Symbol(parameterless_type(algs[1]))), legend=:outertopright)
55+
p = plot(ns,
56+
res[1];
57+
ylabel = "GFLOPs",
58+
xlabel = "N",
59+
title = "GFLOPs for NxN LU Factorization",
60+
label = string(Symbol(parameterless_type(algs[1]))),
61+
legend = :outertopright)
4562
for i in 2:length(res)
4663
plot!(p, ns, res[i]; label = string(Symbol(parameterless_type(algs[i]))))
4764
end
4865
p
4966

5067
savefig("lubench.png")
51-
savefig("lubench.pdf")
68+
savefig("lubench.pdf")

benchmarks/metallu.jl

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,14 @@ for i in 1:length(ns)
2828
rng = MersenneTwister(123)
2929
global A = rand(rng, Float32, n, n)
3030
global b = rand(rng, Float32, n)
31-
global u0= rand(rng, Float32, n)
32-
31+
global u0 = rand(rng, Float32, n)
32+
3333
for j in 1:length(algs)
34-
bt = @belapsed solve(prob, $(algs[j])).u setup=(prob = LinearProblem(copy(A), copy(b); u0 = copy(u0), alias_A=true, alias_b=true))
34+
bt = @belapsed solve(prob, $(algs[j])).u setup=(prob = LinearProblem(copy(A),
35+
copy(b);
36+
u0 = copy(u0),
37+
alias_A = true,
38+
alias_b = true))
3539
GC.gc()
3640
push!(res[j], luflop(n) / bt / 1e9)
3741
end
@@ -42,11 +46,17 @@ __parameterless_type(T) = Base.typename(T).wrapper
4246
parameterless_type(x) = __parameterless_type(typeof(x))
4347
parameterless_type(::Type{T}) where {T} = __parameterless_type(T)
4448

45-
p = plot(ns, res[1]; ylabel = "GFLOPs", xlabel = "N", title = "GFLOPs for NxN LU Factorization", label = string(Symbol(parameterless_type(algs[1]))), legend=:outertopright)
49+
p = plot(ns,
50+
res[1];
51+
ylabel = "GFLOPs",
52+
xlabel = "N",
53+
title = "GFLOPs for NxN LU Factorization",
54+
label = string(Symbol(parameterless_type(algs[1]))),
55+
legend = :outertopright)
4656
for i in 2:length(res)
4757
plot!(p, ns, res[i]; label = string(Symbol(parameterless_type(algs[i]))))
4858
end
4959
p
5060

5161
savefig("metal_large_lubench.png")
52-
savefig("metal_large_lubench.pdf")
62+
savefig("metal_large_lubench.pdf")

docs/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
33
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
44

55
[compat]
6-
Documenter = "0.27"
6+
Documenter = "1"
77
LinearSolve = "1, 2"

docs/make.jl

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,7 @@ makedocs(sitename = "LinearSolve.jl",
1212
authors = "Chris Rackauckas",
1313
modules = [LinearSolve, LinearSolve.SciMLBase],
1414
clean = true, doctest = false, linkcheck = true,
15-
strict = [
16-
:doctest,
17-
:linkcheck,
18-
:parse_error,
19-
:example_block,
20-
# Other available options are
21-
# :autodocs_block, :cross_references, :docs_block, :eval_block, :example_block, :footnote, :meta_block, :missing_docs, :setup_block
22-
],
15+
warnonly = [:docs_block, :missing_docs],
2316
format = Documenter.HTML(assets = ["assets/favicon.ico"],
2417
canonical = "https://docs.sciml.ai/LinearSolve/stable/"),
2518
pages = pages)

docs/src/index.md

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -84,32 +84,19 @@ Pkg.status(; mode = PKGMODE_MANIFEST) # hide
8484
</details>
8585
```
8686

87-
```@raw html
88-
You can also download the
89-
<a href="
90-
```
91-
9287
```@eval
9388
using TOML
89+
using Markdown
9490
version = TOML.parse(read("../../Project.toml", String))["version"]
9591
name = TOML.parse(read("../../Project.toml", String))["name"]
96-
link = "https://github.com/SciML/" * name * ".jl/tree/gh-pages/v" * version *
97-
"/assets/Manifest.toml"
98-
```
99-
100-
```@raw html
101-
">manifest</a> file and the
102-
<a href="
103-
```
104-
105-
```@eval
106-
using TOML
107-
version = TOML.parse(read("../../Project.toml", String))["version"]
108-
name = TOML.parse(read("../../Project.toml", String))["name"]
109-
link = "https://github.com/SciML/" * name * ".jl/tree/gh-pages/v" * version *
110-
"/assets/Project.toml"
111-
```
112-
113-
```@raw html
114-
">project</a> file.
92+
link_manifest = "https://github.com/SciML/" * name * ".jl/tree/gh-pages/v" * version *
93+
"/assets/Manifest.toml"
94+
link_project = "https://github.com/SciML/" * name * ".jl/tree/gh-pages/v" * version *
95+
"/assets/Project.toml"
96+
Markdown.parse("""You can also download the
97+
[manifest]($link_manifest)
98+
file and the
99+
[project]($link_project)
100+
file.
101+
""")
115102
```

docs/src/solvers/solvers.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ but one may need to change this to receive more performance or precision. If
1414
more precision is necessary, `QRFactorization()` and `SVDFactorization()` are
1515
the best choices, with SVD being the slowest but most precise.
1616

17-
For efficiency, `RFLUFactorization` is the fastest for dense LU-factorizations until around
17+
For efficiency, `RFLUFactorization` is the fastest for dense LU-factorizations until around
1818
150x150 matrices, though this can be dependent on the exact details of the hardware. After this
1919
point, `MKLLUFactorization` is usually faster on most hardware. Note that on Mac computers
2020
that `AppleAccelerateLUFactorization` is generally always the fastest. `LUFactorization` will
21-
use your base system BLAS which can be fast or slow depending on the hardware configuration.
21+
use your base system BLAS which can be fast or slow depending on the hardware configuration.
2222
`SimpleLUFactorization` will be fast only on very small matrices but can cut down on compile times.
2323

2424
For very large dense factorizations, offloading to the GPU can be preferred. Metal.jl can be used
25-
on Mac hardware to offload, and has a cutoff point of being faster at around size 20,000 x 20,000
25+
on Mac hardware to offload, and has a cutoff point of being faster at around size 20,000 x 20,000
2626
matrices (and only supports Float32). `CudaOffloadFactorization` can be more efficient at a
2727
much smaller cutoff, possibly around size 1,000 x 1,000 matrices, though this is highly dependent
2828
on the chosen GPU hardware. `CudaOffloadFactorization` requires a CUDA-compatible NVIDIA GPU.
@@ -31,9 +31,9 @@ CUDA offload supports Float64 but most consumer GPU hardware will be much faster
3131
this is only recommended for Float32 matrices.
3232

3333
!!! note
34-
35-
Performance details for dense LU-factorizations can be highly dependent on the hardware configuration.
36-
For details see [this issue](https://github.com/SciML/LinearSolve.jl/issues/357).
34+
35+
Performance details for dense LU-factorizations can be highly dependent on the hardware configuration.
36+
For details see [this issue](https://github.com/SciML/LinearSolve.jl/issues/357).
3737
If one is looking to best optimize their system, we suggest running the performance
3838
tuning benchmark.
3939

@@ -65,19 +65,19 @@ The interface is detailed [here](@ref custom).
6565
### Lazy SciMLOperators
6666

6767
If the linear operator is given as a lazy non-concrete operator, such as a `FunctionOperator`,
68-
then using a Krylov method is preferred in order to not concretize the matrix.
68+
then using a Krylov method is preferred in order to not concretize the matrix.
6969
Krylov.jl generally outperforms IterativeSolvers.jl and KrylovKit.jl, and is compatible
7070
with CPUs and GPUs, and thus is the generally preferred form for Krylov methods. The
7171
choice of Krylov method should be the one most constrained to the type of operator one
7272
has, for example if positive definite then `Krylov_CG()`, but if no good properties then
7373
use `Krylov_GMRES()`.
7474

7575
!!! tip
76-
76+
7777
If your materialized operator is a uniform block diagonal matrix, then you can use
7878
`SimpleGMRES(; blocksize = <known block size>)` to further improve performance.
7979
This often shows up in Neural Networks where the Jacobian wrt the Inputs (almost always)
80-
is a Uniform Block Diagonal matrix of Block Size = size of the input divided by the
80+
is a Uniform Block Diagonal matrix of Block Size = size of the input divided by the
8181
batch size.
8282

8383
## Full List of Methods

ext/LinearSolveBlockDiagonalsExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ using LinearSolve, BlockDiagonals
44

55
function LinearSolve.init_cacheval(alg::SimpleGMRES{false}, A::BlockDiagonal, b, args...;
66
kwargs...)
7-
@assert ndims(A) == 2 "ndims(A) == $(ndims(A)). `A` must have ndims == 2."
7+
@assert ndims(A)==2 "ndims(A) == $(ndims(A)). `A` must have ndims == 2."
88
# We need to perform this check even when `zeroinit == true`, since the type of the
99
# cache is dependent on whether we are able to use the specialized dispatch.
1010
bsizes = blocksizes(A)

0 commit comments

Comments
 (0)