nextflow-io / nextflow

A DSL for data-driven computational pipelines
http://nextflow.io
Apache License 2.0
2.61k stars 605 forks source link

variable task.gpus like task.cpus. #5059

Open alessiovignoli opened 2 weeks ago

alessiovignoli commented 2 weeks ago

New feature

Helllo. I could not find in the documentation a variable that hold the number of GPUs used by the process,. The closest i could find is this -> task.accelerator.request from here.

It would be nice to have a variable called task.gpus like there is for the cpu task.cpus.

Usage scenario

At running time of the process it can be useful to know the number of CPUs,GPUs and memory requested. The first and last have their own task variable associated with an intuitive name.

This could be useful metrics to know for GPU intensive processes like ML applications. A practical application could be in the case of ray.init() documentation, where an explicit hard limit can be set for resources.

bentsherman commented 2 weeks ago

Does task.accelerator.request not work for you?