Closed mantasjk closed 3 years ago
This example doesn't make any sense. If you have large ODEs you just use CuArrays, not EnsembleGPUArray. Did you see the README?
https://github.com/SciML/DiffEqGPU.jl#within-method-gpu-parallelism-with-direct-cuarray-usage
The native Julia libraries, including (but not limited to) OrdinaryDiffEq, StochasticDiffEq, and DelayDiffEq, are compatible with u0 being a CuArray. When this occurs, all array operations take place on the GPU, including any implicit solves. This is independent of the DiffEqGPU library. These speedup the solution of a differential equation which is sufficiently large or expensive. This does not require DiffEqGPU.jl.
Parameter-parallel GPU methods are provided for the case where a single solve is too cheap to benefit from within-method parallelism, but the solution of the same structure (same f) is required for very many different choices of u0 or p.
You would not solve that problem with EnsembleGPUArray. Let me know if that needs to be clarified more.
I was hoping to utilize EnsembleGPUArray() to compute ensemble over different initial conditions, but as ODE system is hard and difficult, then this is not the best approach. Thanks for the clarification.
Yes it's only for small equations, like 200 ODEs or less. It fills your GPU by running them all simultaneously. So if you have a big PDE with a matmul operator kind of thing, it would just overflow the GPU memory. PDE discretizations = solve one at a time, parallelizing its operations on the GPU. Small ODEs = solve many at the same time, parallelizing across solves on the GPU.
Hello, can not get the EnsembleGPUArray() to work on any of my machines. Simple solve() function on CUDA array works fine, however, when asked to do ensemble on gpu, it gives error "unsupported call to the Julia runtime (call to jl_f_tuple)".
Code:
Output: