I want to use Celery to run jobs on a GPU server with four Tesla cards. I manage a celery worker with a pool of four workers, so each card always does one job.
My problem is how to instruct workers on each requirement for one GPU. Currently, I rely on the assumption that workflows should have continuous process identifiers:
device_id = os.getpid() % self.ndevices
However, I am not guaranteed to always work, i.e. when workflows restart over time. Therefore, ideally, I would like to get the identifier of each employee directly. Can someone tell me if it is possible to inspect an employee from a task or offer another solution for distributing tasks among GPUs?
python celery
oceanhug
source share