Kernels for SimpleTauLeaping#490
Conversation
|
Can Github CI test GPU code for free? |
|
No we have to setup the Buildkite |
|
Rebase onto latest master and accept the new runtests.yml and buildkite changes. With that, then add gpu tests into the gpu folder |
Co-authored-by: Christopher Rackauckas <accounts@chrisrackauckas.com>
|
|
||
| # Poisson sampling | ||
| @inbounds for k in 1:num_jumps | ||
| counts[k] = pois_rand(rng, rate_cache[k]) |
There was a problem hiding this comment.
https://docs.nvidia.com/cuda/curand/device-api-overview.html
CUDA has a builtin Poisson RNG, wouldn't we expect that to be more appropriate for GPU use?
There was a problem hiding this comment.
but in that case we can't use kernels for other GPUs
There was a problem hiding this comment.
AMD offers it too in ROCRAND: differentiable programming for odes review. Can we not dispatch between NVDIA vs. AMD, and otherwise then fall back to pois_rand if in neither of those? I'd imagine there might be substantial performance benefits to using the vendor provided versions.
There was a problem hiding this comment.
This needs some actual correctness tests for statistics of the obtained solutions (compare to CPU tau-leaping or Gillespie). All this is testing right now is that the code doesn't crash.
There was a problem hiding this comment.
https://github.com/SciML/JumpProcesses.jl/blob/master/test/regular_jumps.jl SimpleTauLeaping needed to be tested too
| local_dc_buf = allocate(backend, Float64, (state_dim, n_trajectories)) | ||
|
|
||
| # Initialize current_u_buf with u0 values | ||
| @kernel function init_buffers_kernel(@Const(probs_data), current_u_buf) |
There was a problem hiding this comment.
This part should probably just be on CPU
There was a problem hiding this comment.
This can't be done in CPU as we are allocating GPU memory (for current_u_buf) which can only be accessed inside kernels
|
Sorry, I don’t really have much gpu experience so I’ll have to leave this for @ChrisRackauckas to review. |
| end | ||
|
|
||
| # GPU-compatible Poisson sampling | ||
| @inline function poisson_rand(lambda::T) where T |
There was a problem hiding this comment.
Did you make the upstream issue on PoissonRandom.jl?
There was a problem hiding this comment.
No, I thought @oscardssmith will take that. I will create an issue now
There was a problem hiding this comment.
|
Buildkite doesn't run on forks, so what we can do here is merge as the code seems finished now, but I'll open a master test to double check the test passes. |
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
Add any other context about the problem here.