cmdstanr
cmdstanr copied to clipboard
Utilize multiple GPUs
I am testing stan on a system with three A100 GPUs. It appears all of the jobs run on the first GPU, ignoring the others. It seems this code:
if (!is.null(self$opencl_ids)) {
args$opencl <- c("opencl", paste0("platform=", self$opencl_ids[1]), paste0("device=", self$opencl_ids[2]))
}
could be generalized to iterate over a vector of device ids.
There are a few things that need to change on the backend but yes this is very doable. I need to make the OpenCL context in the math library thread local then each chain can get a gpu