Skip to content

Commit 3d4482e

Browse files
Revert the SciMLLogging (#754)
* Revert SciMLLogging * also revert CUDA changes * Revert the fixes * More removals
1 parent b77b167 commit 3d4482e

32 files changed

+201
-561
lines changed

Project.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ Preferences = "21216c6a-2e73-6563-6e65-726566657250"
2323
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
2424
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
2525
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
26-
SciMLLogging = "a6db7da4-7206-11f0-1eab-35f2a5dbe1d1"
2726
SciMLOperators = "c0aeaf25-5076-4817-a8d5-81caf7dfa961"
2827
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
2928
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
@@ -124,7 +123,6 @@ RecursiveFactorization = "0.2.23"
124123
Reexport = "1.2.2"
125124
SafeTestsets = "0.1"
126125
SciMLBase = "2.70"
127-
SciMLLogging = "1"
128126
SciMLOperators = "1"
129127
Setfield = "1.1.1"
130128
SparseArrays = "1.10"

docs/src/advanced/developing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ struct MyLUFactorization{P} <: LinearSolve.SciMLLinearSolveAlgorithm end
1919

2020
function LinearSolve.init_cacheval(
2121
alg::MyLUFactorization, A, b, u, Pl, Pr, maxiters::Int, abstol, reltol,
22-
verbose::LinearVerbosity, assump::LinearSolve.OperatorAssumptions)
22+
verbose::Bool, assump::LinearSolve.OperatorAssumptions)
2323
lu!(convert(AbstractMatrix, A))
2424
end
2525

docs/src/basics/common_solver_opts.md

Lines changed: 0 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -26,92 +26,3 @@ solve completely. Error controls only apply to iterative solvers.
2626
- `maxiters`: The number of iterations allowed. Defaults to `length(prob.b)`
2727
- `Pl,Pr`: The left and right preconditioners, respectively. For more information,
2828
see [the Preconditioners page](@ref prec).
29-
30-
## Verbosity Controls
31-
32-
The verbosity system in LinearSolve.jl provides fine-grained control over the diagnostic messages, warnings, and errors that are displayed during the solution of linear systems.
33-
34-
The verbosity system is organized hierarchically into three main categories:
35-
36-
1. Error Control - Messages related to fallbacks and error handling
37-
2. Performance - Messages related to performance considerations
38-
3. Numerical - Messages related to numerical solvers and iterations
39-
40-
Each category can be configured independently, and individual settings can be adjusted to suit your needs.
41-
42-
### Verbosity Levels
43-
The following verbosity levels are available:
44-
45-
#### Individual Settings
46-
These settings are meant for individual settings within a category. These can also be used to set all of the individual settings in a group to the same value.
47-
- Verbosity.None() - Suppress all messages
48-
- Verbosity.Info() - Show message as log message at info level
49-
- Verbosity.Warn() - Show warnings (default for most settings)
50-
- Verbosity.Error() - Throw errors instead of warnings
51-
- Verbosity.Level(n) - Show messages with a log level setting of n
52-
53-
#### Group Settings
54-
These settings are meant for controlling a group of settings.
55-
- Verbosity.Default() - Use the default settings
56-
- Verbosity.All() - Show all possible messages
57-
58-
### Basic Usage
59-
60-
#### Global Verbosity Control
61-
62-
```julia
63-
using LinearSolve
64-
65-
# Suppress all messages
66-
verbose = LinearVerbosity(Verbosity.None())
67-
prob = LinearProblem(A, b)
68-
sol = solve(prob; verbose=verbose)
69-
70-
# Show all messages
71-
verbose = LinearVerbosity(Verbosity.All())
72-
sol = solve(prob; verbose=verbose)
73-
74-
# Use default settings
75-
verbose = LinearVerbosity(Verbosity.Default())
76-
sol = solve(prob; verbose=verbose)
77-
```
78-
79-
#### Group Level Control
80-
81-
```julia
82-
# Customize by category
83-
verbose = LinearVerbosity(
84-
error_control = Verbosity.Warn(), # Show warnings for error control related issues
85-
performance = Verbosity.None(), # Suppress performance messages
86-
numerical = Verbosity.Info() # Show all numerical related log messages at info level
87-
)
88-
89-
sol = solve(prob; verbose=verbose)
90-
```
91-
92-
#### Fine-grained Control
93-
The constructor for `LinearVerbosity` allows you to set verbosity for each specific message toggle, giving you fine-grained control.
94-
The verbosity settings for the toggles are automatically passed to the group objects.
95-
```julia
96-
# Set specific message types
97-
verbose = LinearVerbosity(
98-
default_lu_fallback = Verbosity.Info(), # Show info when LU fallback is used
99-
KrylovJL_verbosity = Verbosity.Warn(), # Show warnings from KrylovJL
100-
no_right_preconditioning = Verbosity.None(), # Suppress right preconditioning messages
101-
KrylovKit_verbosity = Verbosity.Level(KrylovKit.WARN_LEVEL) # Set KrylovKit verbosity level using KrylovKit's own verbosity levels
102-
)
103-
104-
sol = solve(prob; verbose=verbose)
105-
106-
```
107-
108-
#### Verbosity Levels
109-
##### Error Control Settings
110-
- default_lu_fallback: Controls messages when falling back to LU factorization (default: Warn)
111-
##### Performance Settings
112-
- no_right_preconditioning: Controls messages when right preconditioning is not used (default: Warn)
113-
##### Numerical Settings
114-
- using_IterativeSolvers: Controls messages when using the IterativeSolvers.jl package (default: Warn)
115-
- IterativeSolvers_iterations: Controls messages about iteration counts from IterativeSolvers.jl (default: Warn)
116-
- KrylovKit_verbosity: Controls messages from the KrylovKit.jl package (default: Warn)
117-
- KrylovJL_verbosity: Controls verbosity of the KrylovJL.jl package (default: None)

ext/LinearSolveAMDGPUExt.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ module LinearSolveAMDGPUExt
22

33
using AMDGPU
44
using LinearSolve: LinearSolve, LinearCache, AMDGPUOffloadLUFactorization,
5-
AMDGPUOffloadQRFactorization, init_cacheval, OperatorAssumptions,
6-
LinearVerbosity
5+
AMDGPUOffloadQRFactorization, init_cacheval, OperatorAssumptions
76
using LinearSolve.LinearAlgebra, LinearSolve.SciMLBase
87

98
# LU Factorization
@@ -26,7 +25,7 @@ function SciMLBase.solve!(cache::LinearSolve.LinearCache, alg::AMDGPUOffloadLUFa
2625
end
2726

2827
function LinearSolve.init_cacheval(alg::AMDGPUOffloadLUFactorization, A, b, u, Pl, Pr,
29-
maxiters::Int, abstol, reltol, verbose::LinearVerbosity,
28+
maxiters::Int, abstol, reltol, verbose::Bool,
3029
assumptions::OperatorAssumptions)
3130
AMDGPU.rocSOLVER.getrf!(AMDGPU.ROCArray(A))
3231
end
@@ -58,7 +57,7 @@ function SciMLBase.solve!(cache::LinearSolve.LinearCache, alg::AMDGPUOffloadQRFa
5857
end
5958

6059
function LinearSolve.init_cacheval(alg::AMDGPUOffloadQRFactorization, A, b, u, Pl, Pr,
61-
maxiters::Int, abstol, reltol, verbose::LinearVerbosity,
60+
maxiters::Int, abstol, reltol, verbose::Bool,
6261
assumptions::OperatorAssumptions)
6362
A_gpu = AMDGPU.ROCArray(A)
6463
tau = AMDGPU.ROCVector{eltype(A_gpu)}(undef, min(size(A_gpu)...))

ext/LinearSolveBLISExt.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ using LinearSolve
99
using LinearAlgebra: BlasInt, LU
1010
using LinearAlgebra.LAPACK: require_one_based_indexing, chkfinite, chkstride1,
1111
@blasfunc, chkargsok
12-
using LinearSolve: ArrayInterface, BLISLUFactorization, @get_cacheval, LinearCache, SciMLBase, LinearVerbosity
12+
using LinearSolve: ArrayInterface, BLISLUFactorization, @get_cacheval, LinearCache, SciMLBase
1313
using SciMLBase: ReturnCode
1414

1515
const global libblis = blis_jll.blis
@@ -204,13 +204,13 @@ const PREALLOCATED_BLIS_LU = begin
204204
end
205205

206206
function LinearSolve.init_cacheval(alg::BLISLUFactorization, A, b, u, Pl, Pr,
207-
maxiters::Int, abstol, reltol, verbose::LinearVerbosity,
207+
maxiters::Int, abstol, reltol, verbose::Bool,
208208
assumptions::OperatorAssumptions)
209209
PREALLOCATED_BLIS_LU
210210
end
211211

212212
function LinearSolve.init_cacheval(alg::BLISLUFactorization, A::AbstractMatrix{<:Union{Float32,ComplexF32,ComplexF64}}, b, u, Pl, Pr,
213-
maxiters::Int, abstol, reltol, verbose::LinearVerbosity,
213+
maxiters::Int, abstol, reltol, verbose::Bool,
214214
assumptions::OperatorAssumptions)
215215
A = rand(eltype(A), 0, 0)
216216
ArrayInterface.lu_instance(A), Ref{BlasInt}()

ext/LinearSolveBandedMatricesExt.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module LinearSolveBandedMatricesExt
33
using BandedMatrices, LinearAlgebra, LinearSolve
44
import LinearSolve: defaultalg,
55
do_factorization, init_cacheval, DefaultLinearSolver,
6-
DefaultAlgorithmChoice, LinearVerbosity
6+
DefaultAlgorithmChoice
77

88
# Defaults for BandedMatrices
99
function defaultalg(A::BandedMatrix, b, oa::OperatorAssumptions{Bool})
@@ -41,14 +41,14 @@ for alg in (:SVDFactorization, :MKLLUFactorization, :DiagonalFactorization,
4141
:AppleAccelerateLUFactorization, :CholeskyFactorization)
4242
@eval begin
4343
function init_cacheval(::$(alg), ::BandedMatrix, b, u, Pl, Pr, maxiters::Int,
44-
abstol, reltol, verbose::LinearVerbosity, assumptions::OperatorAssumptions)
44+
abstol, reltol, verbose::Bool, assumptions::OperatorAssumptions)
4545
return nothing
4646
end
4747
end
4848
end
4949

5050
function init_cacheval(::LUFactorization, A::BandedMatrix{T}, b, u, Pl, Pr, maxiters::Int,
51-
abstol, reltol, verbose::LinearVerbosity, assumptions::OperatorAssumptions) where {T}
51+
abstol, reltol, verbose::Bool, assumptions::OperatorAssumptions) where {T}
5252
(T <: BigFloat) && return qr(similar(A, 0, 0))
5353
return lu(similar(A, 0, 0))
5454
end
@@ -61,7 +61,7 @@ for alg in (:SVDFactorization, :MKLLUFactorization, :DiagonalFactorization,
6161
:AppleAccelerateLUFactorization, :QRFactorization, :LUFactorization)
6262
@eval begin
6363
function init_cacheval(::$(alg), ::Symmetric{<:Number, <:BandedMatrix}, b, u, Pl,
64-
Pr, maxiters::Int, abstol, reltol, verbose::LinearVerbosity,
64+
Pr, maxiters::Int, abstol, reltol, verbose::Bool,
6565
assumptions::OperatorAssumptions)
6666
return nothing
6767
end

ext/LinearSolveCUDAExt.jl

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
module LinearSolveCUDAExt
22

33
using CUDA
4-
using CUDA: CuVector, CuMatrix
54
using LinearSolve: LinearSolve, is_cusparse, defaultalg, cudss_loaded, DefaultLinearSolver,
65
DefaultAlgorithmChoice, ALREADY_WARNED_CUDSS, LinearCache,
76
needs_concrete_A,
87
error_no_cudss_lu, init_cacheval, OperatorAssumptions,
98
CudaOffloadFactorization, CudaOffloadLUFactorization, CudaOffloadQRFactorization,
109
CUDAOffload32MixedLUFactorization,
11-
SparspakFactorization, KLUFactorization, UMFPACKFactorization,
12-
LinearVerbosity
10+
SparspakFactorization, KLUFactorization, UMFPACKFactorization
1311
using LinearSolve.LinearAlgebra, LinearSolve.SciMLBase, LinearSolve.ArrayInterface
14-
using LinearAlgebra: LU
1512
using SciMLBase: AbstractSciMLOperator
1613

1714
function LinearSolve.is_cusparse(A::Union{
@@ -54,7 +51,7 @@ function SciMLBase.solve!(cache::LinearSolve.LinearCache, alg::CudaOffloadLUFact
5451
end
5552

5653
function LinearSolve.init_cacheval(alg::CudaOffloadLUFactorization, A::AbstractArray, b, u, Pl, Pr,
57-
maxiters::Int, abstol, reltol, verbose::LinearVerbosity,
54+
maxiters::Int, abstol, reltol, verbose::Bool,
5855
assumptions::OperatorAssumptions)
5956
T = eltype(A)
6057
noUnitT = typeof(zero(T))
@@ -77,7 +74,7 @@ function SciMLBase.solve!(cache::LinearSolve.LinearCache, alg::CudaOffloadQRFact
7774
end
7875

7976
function LinearSolve.init_cacheval(alg::CudaOffloadQRFactorization, A, b, u, Pl, Pr,
80-
maxiters::Int, abstol, reltol, verbose::LinearVerbosity,
77+
maxiters::Int, abstol, reltol, verbose::Bool,
8178
assumptions::OperatorAssumptions)
8279
qr(CUDA.CuArray(A))
8380
end
@@ -96,26 +93,26 @@ function SciMLBase.solve!(cache::LinearSolve.LinearCache, alg::CudaOffloadFactor
9693
end
9794

9895
function LinearSolve.init_cacheval(alg::CudaOffloadFactorization, A::AbstractArray, b, u, Pl, Pr,
99-
maxiters::Int, abstol, reltol, verbose::LinearVerbosity,
96+
maxiters::Int, abstol, reltol, verbose::Bool,
10097
assumptions::OperatorAssumptions)
10198
qr(CUDA.CuArray(A))
10299
end
103100

104101
function LinearSolve.init_cacheval(
105102
::SparspakFactorization, A::CUDA.CUSPARSE.CuSparseMatrixCSR, b, u,
106-
Pl, Pr, maxiters::Int, abstol, reltol, verbose::LinearVerbosity, assumptions::OperatorAssumptions)
103+
Pl, Pr, maxiters::Int, abstol, reltol, verbose::Bool, assumptions::OperatorAssumptions)
107104
nothing
108105
end
109106

110107
function LinearSolve.init_cacheval(
111108
::KLUFactorization, A::CUDA.CUSPARSE.CuSparseMatrixCSR, b, u,
112-
Pl, Pr, maxiters::Int, abstol, reltol, verbose::LinearVerbosity, assumptions::OperatorAssumptions)
109+
Pl, Pr, maxiters::Int, abstol, reltol, verbose::Bool, assumptions::OperatorAssumptions)
113110
nothing
114111
end
115112

116113
function LinearSolve.init_cacheval(
117114
::UMFPACKFactorization, A::CUDA.CUSPARSE.CuSparseMatrixCSR, b, u,
118-
Pl, Pr, maxiters::Int, abstol, reltol, verbose::LinearVerbosity, assumptions::OperatorAssumptions)
115+
Pl, Pr, maxiters::Int, abstol, reltol, verbose::Bool, assumptions::OperatorAssumptions)
119116
nothing
120117
end
121118

@@ -143,7 +140,7 @@ function SciMLBase.solve!(cache::LinearSolve.LinearCache, alg::CUDAOffload32Mixe
143140
end
144141

145142
function LinearSolve.init_cacheval(alg::CUDAOffload32MixedLUFactorization, A, b, u, Pl, Pr,
146-
maxiters::Int, abstol, reltol, verbose::LinearVerbosity,
143+
maxiters::Int, abstol, reltol, verbose::Bool,
147144
assumptions::OperatorAssumptions)
148145
# Pre-allocate with Float32 arrays
149146
A_f32 = Float32.(A)

ext/LinearSolveCUSOLVERRFExt.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module LinearSolveCUSOLVERRFExt
22

3-
using LinearSolve: LinearSolve, @get_cacheval, pattern_changed, OperatorAssumptions, LinearVerbosity
3+
using LinearSolve: LinearSolve, @get_cacheval, pattern_changed, OperatorAssumptions
44
using CUSOLVERRF: CUSOLVERRF, RFLU, CUDA
55
using SparseArrays: SparseArrays, SparseMatrixCSC, nnz
66
using CUSOLVERRF.CUDA.CUSPARSE: CuSparseMatrixCSR
@@ -10,15 +10,15 @@ using SciMLBase: SciMLBase, LinearProblem, ReturnCode
1010
function LinearSolve.init_cacheval(alg::LinearSolve.CUSOLVERRFFactorization,
1111
A, b, u, Pl, Pr,
1212
maxiters::Int, abstol, reltol,
13-
verbose::LinearVerbosity, assumptions::OperatorAssumptions)
13+
verbose::Bool, assumptions::OperatorAssumptions)
1414
nothing
1515
end
1616

1717
function LinearSolve.init_cacheval(alg::LinearSolve.CUSOLVERRFFactorization,
1818
A::Union{CuSparseMatrixCSR{Float64, Int32}, SparseMatrixCSC{Float64, <:Integer}},
1919
b, u, Pl, Pr,
2020
maxiters::Int, abstol, reltol,
21-
verbose::LinearVerbosity, assumptions::OperatorAssumptions)
21+
verbose::Bool, assumptions::OperatorAssumptions)
2222
# Create initial factorization with appropriate options
2323
nrhs = b isa AbstractMatrix ? size(b, 2) : 1
2424
symbolic = alg.symbolic

ext/LinearSolveCliqueTreesExt.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ module LinearSolveCliqueTreesExt
22

33
using CliqueTrees: symbolic, cholinit, lininit, cholesky!, linsolve!
44
using LinearSolve
5-
using LinearSolve: LinearVerbosity
65
using SparseArrays
76

87
function _symbolic(A::AbstractMatrix, alg::CliqueTreesFactorization)
@@ -23,7 +22,7 @@ end
2322

2423
function LinearSolve.init_cacheval(
2524
alg::CliqueTreesFactorization, A::AbstractMatrix, b, u, Pl, Pr, maxiters::Int, abstol,
26-
reltol, verbose::LinearVerbosity, assumptions::OperatorAssumptions)
25+
reltol, verbose::Bool, assumptions::OperatorAssumptions)
2726
symbfact = _symbolic(A, alg)
2827
cholfact, cholwork = cholinit(A, symbfact)
2928
linwork = lininit(1, cholfact)

ext/LinearSolveFastAlmostBandedMatricesExt.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module LinearSolveFastAlmostBandedMatricesExt
33
using FastAlmostBandedMatrices, LinearAlgebra, LinearSolve
44
import LinearSolve: defaultalg,
55
do_factorization, init_cacheval, DefaultLinearSolver,
6-
DefaultAlgorithmChoice, LinearVerbosity
6+
DefaultAlgorithmChoice
77

88
function defaultalg(A::AlmostBandedMatrix, b, oa::OperatorAssumptions{Bool})
99
if oa.issq
@@ -21,7 +21,7 @@ for alg in (:SVDFactorization, :MKLLUFactorization, :DiagonalFactorization,
2121
:AppleAccelerateLUFactorization, :CholeskyFactorization, :LUFactorization)
2222
@eval begin
2323
function init_cacheval(::$(alg), ::AlmostBandedMatrix, b, u, Pl, Pr, maxiters::Int,
24-
abstol, reltol, verbose::LinearVerbosity, assumptions::OperatorAssumptions)
24+
abstol, reltol, verbose::Bool, assumptions::OperatorAssumptions)
2525
return nothing
2626
end
2727
end

0 commit comments

Comments
 (0)