Hi all, is there any solution to run multiple inst...
# help
j
Hi all, is there any solution to run multiple instances of a process on 1 GPU at the same time? I have a process that runs on GPU and it only costs about ~20% GPU usage. So I want to run 4 instances simultaneously. Is there any way to do this in Nextflow? Currently, in my
nextflow.config
file:
Copy code
process {
    withName: 'IMPUTE' {
        container = "${params.container_registry}xgboost:v1"
        cpus   = { check_max(16 * task.attempt, 'cpus') }
        memory = { check_max(144.GB * task.attempt, 'memory') }
        accelerator = 1
    }
}
shall I set
accelerator = 4
or
accelerator = 0.25
to achieve this? Or is there any other way to do this in Nextflow? Thank you!
a
So there are a few things to consider here.
accelerator
only works for the AWS Batch, GCP Batch, HyperQueue, and Kubernetes
executor
. For anything else GPU allocation has to be handled more manually (i.e. via
clusterOptions
for
SLURM
). Furthermore
accelerator
can only take an integer, which means you cannot use it to request fractional GPUs. AWS does have some fractional GPU machines (
g6f
family) so in theory you can use those instances, but I think you might have to control it using a queue/compute env rather than
accelerator
as - due to the above integer constraint - you wouldn’t be able to request an instance with
0.25
GPU shares. I cannot speak for whether the other platforms which support
accelerator
have any fractional GPU instance capabilities, but the same issue with provision would exist. For e.g.
SLURM
due to the more manual system, if your setup allows requesting fractional GPUs via e.g. sharding then it is possible to request and run on fractional GPU shares.
j
Thanks for your help. I found that stating
maxForks 4
in the process definition can allow this. However I need to deal with the conflict among instances myself.
a
It all boils down to what executor you have and what your system configuration around GPUs is really
✅ 1