Skip to content

Configure GPU usage on WorkerRun

Refs https://redmine.teklia.com/issues/7534

We now want to configure GPU assignation on ponos tasks directly from worker runs, thus removing the use_gpu configuration on the Process model.

Model changes & migration:

  • remove use_gpu from Process
  • add a boolean field use_gpu on WorkerRun , default to False
  • for processes where Process.use_gpu is set to True, migrate the information to worker runs of these processes when their version gpu_usage is either required|supported

Upon WorkerRun creation, the following rules are applied (through a pre_save signal ?):

  • when worker version gpu usage is required, it's forced to True
  • when worker version gpu usage is disabled, it's forced to False
  • when worker version gpu usage is supported, it's set to False but will be modfiable

The WorkerRun.use_gpu field can only be changed by UpdateWorkerRun endpoint, when and only when the worker run version gpu usage is supported . The user can either set it to true or false.

When process tasks are starting they now must get a GPU assigned if their worker run has use_gpu set to True. Otherwise they stay pending