Skip to content

Commit 9466b78

Browse files
committed
test: more test fixes
1 parent 088d65c commit 9466b78

File tree

7 files changed

+10
-23
lines changed

7 files changed

+10
-23
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ LeastSquaresOptim = "0.8.5"
8181
LineSearches = "7.2"
8282
LinearAlgebra = "1.10"
8383
LinearSolve = "2.30"
84-
MINPACK = "=1.2"
84+
MINPACK = "1.2"
8585
MaybeInplace = "0.1.3"
8686
ModelingToolkit = "9.15.0"
8787
NLSolvers = "0.5"

lib/SciMLJacobianOperators/Project.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ authors = ["Avik Pal <[email protected]> and contributors"]
44
version = "0.1.0"
55

66
[deps]
7-
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
87
ConcreteStructs = "2569d6c7-a4a2-43d3-a901-331e8e4be471"
98
ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
109
DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
@@ -15,7 +14,6 @@ SciMLOperators = "c0aeaf25-5076-4817-a8d5-81caf7dfa961"
1514
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
1615

1716
[compat]
18-
ADTypes = "1.8.1"
1917
ConcreteStructs = "0.2.3"
2018
ConstructionBase = "1.5"
2119
DifferentiationInterface = "0.5"

lib/SciMLJacobianOperators/src/SciMLJacobianOperators.jl

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
module SciMLJacobianOperators
22

3-
using ADTypes: ADTypes
43
using ConcreteStructs: @concrete
54
using ConstructionBase: ConstructionBase
65
using DifferentiationInterface: DifferentiationInterface
@@ -117,8 +116,8 @@ function JacobianOperator(prob::AbstractNonlinearProblem, fu, u; jvp_autodiff =
117116
vjp_op = prepare_vjp(skip_vjp, prob, f, u, fu; autodiff = vjp_autodiff)
118117
jvp_op = prepare_jvp(skip_jvp, prob, f, u, fu; autodiff = jvp_autodiff)
119118

120-
output_cache = similar(fu, T)
121-
input_cache = similar(u, T)
119+
output_cache = fu isa Number ? T(fu) : similar(fu, T)
120+
input_cache = u isa Number ? T(u) : similar(u, T)
122121

123122
return JacobianOperator{iip, T}(
124123
JVP(), jvp_op, vjp_op, (length(fu), length(u)), output_cache, input_cache)
@@ -290,12 +289,6 @@ function prepare_vjp(::Val{false}, prob::AbstractNonlinearProblem,
290289

291290
@assert autodiff!==nothing "`vjp_autodiff` must be provided if `f` doesn't have \
292291
analytic `vjp` or `jac`."
293-
294-
if ADTypes.mode(autodiff) isa ADTypes.ForwardMode
295-
@warn "AD Backend: $(autodiff) is a Forward Mode backend. Computing VJPs using \
296-
this will be slow!"
297-
end
298-
299292
# TODO: Once DI supports const params we can use `p`
300293
fₚ = SciMLBase.JacobianWrapper{SciMLBase.isinplace(f)}(f, prob.p)
301294
if SciMLBase.isinplace(f)
@@ -337,12 +330,6 @@ function prepare_jvp(::Val{false}, prob::AbstractNonlinearProblem,
337330

338331
@assert autodiff!==nothing "`jvp_autodiff` must be provided if `f` doesn't have \
339332
analytic `vjp` or `jac`."
340-
341-
if ADTypes.mode(autodiff) isa ADTypes.ReverseMode
342-
@warn "AD Backend: $(autodiff) is a Reverse Mode backend. Computing JVPs using \
343-
this will be slow!"
344-
end
345-
346333
# TODO: Once DI supports const params we can use `p`
347334
fₚ = SciMLBase.JacobianWrapper{SciMLBase.isinplace(f)}(f, prob.p)
348335
if SciMLBase.isinplace(f)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

src/NonlinearSolve.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ using Preferences: Preferences, @load_preference, @set_preferences!
4040
using RecursiveArrayTools: recursivecopy!, recursivefill!
4141
using SciMLBase: AbstractNonlinearAlgorithm, JacobianWrapper, AbstractNonlinearProblem,
4242
AbstractSciMLOperator, _unwrap_val, has_jac, isinplace, NLStats
43-
using SciMLJacobianOperators: JacobianOperator, VecJacOperator, JacVecOperator,
44-
StatefulJacobianOperator
43+
using SciMLJacobianOperators: AbstractJacobianOperator, JacobianOperator, VecJacOperator,
44+
JacVecOperator, StatefulJacobianOperator
4545
using SparseArrays: AbstractSparseMatrix, SparseMatrixCSC
4646
using SparseDiffTools: SparseDiffTools, AbstractSparsityDetection,
4747
ApproximateJacobianSparsity, JacPrototypeSparsityDetection,

src/utils.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ end
4848
return deepcopy(x)
4949
end
5050
@inline __maybe_unaliased(x::AbstractNonlinearSolveOperator, alias::Bool) = x
51+
@inline __maybe_unaliased(x::AbstractJacobianOperator, alias::Bool) = x
5152

5253
@inline __cond(J::AbstractMatrix) = cond(J)
5354
@inline __cond(J::SVector) = __cond(Diagonal(MVector(J)))

test/runtests.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const RETESTITEMS_NWORKER_THREADS = parse(Int,
1010
get(ENV, "RETESTITEMS_NWORKER_THREADS",
1111
string(max(Hwloc.num_virtual_cores() ÷ RETESTITEMS_NWORKERS, 1))))
1212

13-
@info "Running tests for group: $LUXLIB_TEST_GROUP with $RETESTITEMS_NWORKERS workers"
13+
@info "Running tests for group: $(GROUP) with $(RETESTITEMS_NWORKERS) workers"
1414

1515
ReTestItems.runtests(NonlinearSolve; tags = (GROUP == "all" ? nothing : [Symbol(GROUP)]),
16-
nworkers = RETESTITEMS_NWORKERS,
17-
nworker_threads = RETESTITEMS_NWORKER_THREADS, testitem_timeout = 3600, retries=4)
16+
nworkers = RETESTITEMS_NWORKERS, nworker_threads = RETESTITEMS_NWORKER_THREADS,
17+
testitem_timeout = 3600, retries = 4)

0 commit comments

Comments
 (0)