fix GPU compat of BrownFullBasicInit#2911
Conversation
| algebraic_vars = mapreduce(iszero, &, M, dims = 1)[:] | ||
| algebraic_eqs = mapreduce(iszero, &, M, dims = 2)[:] |
There was a problem hiding this comment.
| algebraic_vars = mapreduce(iszero, &, M, dims = 1)[:] | |
| algebraic_eqs = mapreduce(iszero, &, M, dims = 2)[:] | |
| algebraic_vars = mapreduce(iszero, &, M, dims = 1) | |
| algebraic_eqs = mapreduce(iszero, &, M, dims = 2) |
Is that part needed?
There was a problem hiding this comment.
yes i think so, otherwise those are not vectors but 1xN and Nx1 matrices, the rest of the code assumes vectors. But i'll check again
There was a problem hiding this comment.
the vector is indeed needed. I changed it to
algebraic_vars = vec(all(iszero, M, dims = 1))
algebraic_eqs = vec(all(iszero, M, dims = 2))which is more readable and faster.
|
Hm the new testcase fails in CI weird, can't reproduce this locally, there the fix works |
|
Rebased version created at #2941 with resolved merge conflicts and added sources for the new test dependencies (OrdinaryDiffEqNonlinearSolve and OrdinaryDiffEqRosenbrock) to ensure proper package resolution. |
…-dae-gpu-pr2911 fix GPU compat of BrownFullBasicInit (rebased from #2911)
This PR adds a simple (mutating) DAE as a testcase for GPU compat. Mainly fixes BrownInit for mutating DAEs with mass matrix and cu arrays.
Not tested:
jac_prototypedoes not work, fails in rosenbrock init because of Default algs for CUSPARSE failing LinearSolve.jl#827 (comment)EDIT: the spares jacobian additionaly fails because
OrdinaryDiffEq.jl/lib/OrdinaryDiffEqNonlinearSolve/src/initialize_dae.jl
Lines 387 to 390 in e038be1
does not work for sparse cuda matrices (this type of indexing is not implemented).
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.