ODEs on the GPU with ArrayFire

[Old posts from the commercial version of ArrayFire] Discussion of ArrayFire using CUDA or OpenCL.

Moderator: pavanky

ODEs on the GPU with ArrayFire

Postby melonakos » Mon Jan 13, 2014 3:51 pm

I just received the following question via email.

I am developing ODE - based models of biological systems, and since I usually need to simulate such models many times (with different initial conditions), I am searching for ways to parallelize my process.

So far I use only parallel processing at the CPU level to speed up my process. Since an infrastructure of Nvidia GPUs is available in my department, I was exploring the possibility of using it. However, a crucial thing is to be able to use an ODE solver in the GPU, something that so far I have not found.

Therefore, I was wondering whether you have something available or if you are close to releasing ODE solvers for GPUs. I am looking forward to your answer, thank you in advance for your time.


I know that many ArrayFire users have been about to use GFOR along with other functions to implement ODEs for themselves on the GPU. I believe that the main parallelism is derived in 2 manners by those who have been successful:

1) when a batch of ODEs can be run simultaneously you can run them all in a GFOR loop,

or

2) when the linear algebra used to solve an individual ODE is sufficiently large that data-parallel benefits are available with straight-up ArrayFire linear algebra functions.

I'm posting here to see if anyone else has thoughts on ODEs with ArrayFire?!

Cheers,

John
John Melonakos (john@arrayfire.com)
User avatar
melonakos
 
Posts: 503
Joined: Tue Jun 10, 2008 9:49 am

Re: ODEs on the GPU with ArrayFire

Postby melonakos » Tue Jan 14, 2014 10:39 am

I received another follow-up email on this topic.

Thank you very much for your answer and for posting it in the forum so I can get some more feedback. However, I think I have not made myself 100% clear.

What I was asking is whether you have implemented an ODE solver that is GPU compatible. What I have a system of let's say 10 ODEs, which need to be solved for different initial conditions a few million times. These are independent tasks, which mean that I can parallelize my procedure which looks like this:

Code: Select all
for i=1:10000000
    solve ODE system % this is an independent task/function
end


What I would ideally like to have, is to give to each different GPU core a different ODE system to solve and thus make my process much faster. So far I use different CPU cores to solve the different ODE systems, but I am limited by the maximum cores of the servers I use. Since there is the proper infrastracture with hundreds of GPU cores in my department, I was thinking if I could use them.

Thus, to sum up, I am looking for already implemented ODE solvers or at least I would like to know whether you have something on the pipeline. If not, then the solution would be to implement the solver myself, which would be quite a big diversion from my main project, but doable.


Thanks for the email. The pseudo code you are describing fits the scenario I outlined as #1 previously. You can exactly make a for-loop and ArrayFire will automatically run all the iterations in parallel using all the GPU cores. You do not need to explicitly control each GPU core. ArrayFire does that automatically. You do need to: 1) create ArrayFire arrays from your data structures and use ArrayFire functions in the body of your loop, and 2) use GFOR so that the loop is parallelized.

There is not an explicit ODE function, but with GFOR and arrays you can write the loop you need to solve the problem.

Feel free to post directly on here too. It's always great to hear from people on the forums!

John
John Melonakos (john@arrayfire.com)
User avatar
melonakos
 
Posts: 503
Joined: Tue Jun 10, 2008 9:49 am


Return to [archive-commercial] Programming & Development with ArrayFire

cron