JuliaDynamics / DynamicalSystems.jl

Award winning software library for nonlinear dynamics and nonlinear timeseries analysis
https://juliadynamics.github.io/DynamicalSystemsDocs.jl/dynamicalsystems/dev/
Other
828 stars 90 forks source link

GPU and FPGA support? #212

Open wsphd opened 1 year ago

wsphd commented 1 year ago

Thank you for these libraries. They are very useful.

My experience is that none of the Dynamics family supports GPUs or similar natively. Please correct me if I'm wrong. Are there any plans to add GPU capability (e.g., w/ JuliaGPU or similar) to these Dynamical packages? We want to run them for big data/big computation issues on a federated hypercluster.

Datseris commented 1 year ago

Hi, you are welcome!

DynamicalSystems.jl does not support GPU in any particular application, however that also depends what you mean in the specific sense. Which part of the framework in particular did you expect to find in GPU?

For the algorithms that use DynamicalSystem, the majority of time is spend on solving the ODEs. So if you had an ODE solver that works on the GPU, that would apply here just as well. For DeterministicIteratedMaps with large dimensionality it would be possible to run the time evolution on the GPU if the GPU allows for inplace computations. The system state can be any arbitrary array in the case of in-place systems.

For the algorithms that use StateSpaceSet, each algorithm is unique and if you wanted a GPU version it would have to be written for each algorithm individually.

Are there any plans to add GPU capability

Not in the general sense, but of course if someone did a PR that implemented a GPU algorithm for a specific problem we would of course welcome it!

ChrisRackauckas commented 1 year ago

If you're using Ensembles internally then https://docs.sciml.ai/DiffEqGPU/stable/ should just work?

Datseris commented 1 year ago

Ah, awesome, I'll think about how I can make the interfacing of using this easier, as at the moment all algorithms use integrators not problems and solve.

ChrisRackauckas commented 1 year ago

It would in principle be compatible with EnsembleGPUArray, but not EnsembleGPUKernel. If you want the limited overhead you really need to have the solve be a single kernel call for the GPU overhead to be low.