SciML / DiffEqGPU.jl

GPU-acceleration routines for DifferentialEquations.jl and the broader SciML scientific machine learning ecosystem
https://docs.sciml.ai/DiffEqGPU/stable/
MIT License
272 stars 27 forks source link

Start implementation of kernels compatible with in-place problems #291

Open utkarsh530 opened 12 months ago

utkarsh530 commented 12 months ago

MWE:

using DiffEqGPU, DiffEqBase, StaticArrays

function lorenz!(du,u,p,t)
 du[1] = 10.0(u[2]-u[1])
 du[2] = u[1]*(28.0-u[3]) - u[2]
 du[3] = u[1]*u[2] - (8/3)*u[3]
end
u0 = @MArray [1.0;0.0;0.0]
tspan = (0.0,100.0)
prob = ODEProblem(lorenz!,u0,tspan)

ensembleProb = EnsembleProblem(prob)

using CUDA

sol = solve(ensembleProb, GPUTsit5(), EnsembleGPUKernel(CUDABackend()), dt = 0.01, adaptive = false, trajectories = 2)

Current issue:

Tries to dynamically allocate. Hence, it fails for high number of trajectories. Similar to https://github.com/SciML/DiffEqGPU.jl/issues/219