Skip to content

Commit 7b44111

Browse files
committed
turn back messages that don't have access to verbose to warn
1 parent b58b764 commit 7b44111

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

lib/NonlinearSolveBase/src/autodiff.jl

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,16 @@ function select_forward_mode_autodiff(
2424
!(ADTypes.mode(ad) isa ADTypes.ForwardOrReverseMode) &&
2525
!is_finite_differences_backend(ad)
2626

27-
@SciMLMessage("The chosen AD backend $(ad) is not a forward mode AD. Use with caution.",
28-
nonlinear_verbose[], :fd_ad_caution, :error_control)
27+
@warn "The chosen AD backend $(ad) is not a forward mode AD. Use with caution."
2928

3029
end
3130
if incompatible_backend_and_problem(prob, ad)
3231
adₙ = select_forward_mode_autodiff(prob, nothing; warn_check_mode)
3332

34-
@SciMLMessage("The chosen AD backend `$(ad)` does not support the chosen problem. This \
33+
@warn "The chosen AD backend `$(ad)` does not support the chosen problem. This \
3534
could be because the backend package for the chosen AD isn't loaded. After \
3635
running autodiff selection detected `$(adₙ)` as a potential forward mode \
37-
backend.", nonlinear_verbose[], :ad_backend_incompatible, :error_control)
38-
36+
backend."
3937
return adₙ
4038
end
4139
return ad
@@ -55,15 +53,14 @@ function select_reverse_mode_autodiff(
5553
if warn_check_mode && !(ADTypes.mode(ad) isa ADTypes.ReverseMode) &&
5654
!(ADTypes.mode(ad) isa ADTypes.ForwardOrReverseMode) &&
5755
!is_finite_differences_backend(ad)
58-
@SciMLMessage("The chosen AD backend $(ad) is not a forward mode AD. Use with caution.",
59-
nonlinear_verbose[], :fd_ad_caution, :error_control)
56+
@warn "The chosen AD backend $(ad) is not a forward mode AD. Use with caution."
6057
end
6158
if incompatible_backend_and_problem(prob, ad)
6259
adₙ = select_reverse_mode_autodiff(prob, nothing; warn_check_mode)
63-
@SciMLMessage("The chosen AD backend `$(ad)` does not support the chosen problem. This \
60+
@warn "The chosen AD backend `$(ad)` does not support the chosen problem. This \
6461
could be because the backend package for the chosen AD isn't loaded. After \
6562
running autodiff selection detected `$(adₙ)` as a potential forward mode \
66-
backend.", nonlinear_verbose[], :ad_backend_incompatible, :error_control)
63+
backend."
6764
return adₙ
6865
end
6966
return ad
@@ -81,10 +78,10 @@ end
8178
function select_jacobian_autodiff(prob::AbstractNonlinearProblem, ad::AbstractADType)
8279
if incompatible_backend_and_problem(prob, ad)
8380
adₙ = select_jacobian_autodiff(prob, nothing)
84-
@SciMLMessage("The chosen AD backend `$(ad)` does not support the chosen problem. This \
81+
@warn "The chosen AD backend `$(ad)` does not support the chosen problem. This \
8582
could be because the backend package for the chosen AD isn't loaded. After \
8683
running autodiff selection detected `$(adₙ)` as a potential forward mode \
87-
backend.", nonlinear_verbose[], :ad_backend_incompatible, :error_control)
84+
backend."
8885
return adₙ
8986
end
9087
return ad

lib/NonlinearSolveBase/src/jacobian.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,18 +223,18 @@ function construct_concrete_adtype(f::NonlinearFunction, ad::AbstractADType)
223223
sparsity_detector = f.sparsity
224224
if f.jac_prototype === nothing
225225
if SciMLBase.has_colorvec(f)
226-
@SciMLMessage("`colorvec` is provided but `jac_prototype` is not specified. \
227-
`colorvec` will be ignored.", nonlinear_verbose[], :colorvec_no_prototype, :performance)
226+
@warn "`colorvec` is provided but `jac_prototype` is not specified. \
227+
`colorvec` will be ignored."
228228
end
229229
coloring_algorithm = select_fastest_coloring_algorithm(nothing, f, ad)
230230
coloring_algorithm === nothing && return ad
231231
return AutoSparse(ad; sparsity_detector, coloring_algorithm)
232232
else
233233
if sparse_or_structured_prototype(f.jac_prototype)
234234
if !(sparsity_detector isa NoSparsityDetector)
235-
@SciMLMessage("`jac_prototype` is a sparse matrix but sparsity = $(f.sparsity) \
235+
@warn "`jac_prototype` is a sparse matrix but sparsity = $(f.sparsity) \
236236
has also been specified. Ignoring sparsity field and using \
237-
`jac_prototype` sparsity.", nonlinear_verbose[], :sparsity_using_jac_prototype, :performance)
237+
`jac_prototype` sparsity."
238238
end
239239
sparsity_detector = KnownJacobianSparsityDetector(f.jac_prototype)
240240
end
@@ -255,8 +255,8 @@ end
255255
function select_fastest_coloring_algorithm(
256256
prototype, f::NonlinearFunction, ad::AbstractADType)
257257
if !Utils.is_extension_loaded(Val(:SparseMatrixColorings))
258-
@SciMLMessage("`SparseMatrixColorings` must be explicitly imported for sparse automatic \
259-
differentiation to work. Proceeding with Dense Automatic Differentiation.", nonlinear_verbose[], :sparse_matrix_colorings_not_loaded, :performance)
258+
@warn "`SparseMatrixColorings` must be explicitly imported for sparse automatic \
259+
differentiation to work. Proceeding with Dense Automatic Differentiation."
260260
return nothing
261261
end
262262
return select_fastest_coloring_algorithm(Val(:SparseMatrixColorings), prototype, f, ad)

0 commit comments

Comments
 (0)