1

Is there a way to specify a fractional gpu requirement for a task? In the example at Dask webpage, it specifies a single GPU.

from distributed import Client
client = Client('scheduler:8786')

data = [client.submit(load, fn) for fn in filenames]
processed = [client.submit(process, d, resources={'GPU': 1}) for d in data]
final = client.submit(aggregate, processed, resources={'MEMORY': 70e9})

It will be a waste to allocate one GPU for a small model.

Ray library has a way of doing this.

1 Answers1

1

Yes, fractional resources are allowed.

In general, resources are arbitrary units, so if you instantiate the scheduler with "GPU=2" or some "foo=10", the scheduler will keep track of these resources during task assignment, but scheduler does not really know (or care) what "GPU" or "foo" is. When submitting tasks you can pass {"GPU": 0.25} and the scheduler will assign multiple tasks assigned to the GPU worker, For example, if the scheduler is told that each worker has "foo=10", then the scheduler will ask each worker to run concurrently up to ten tasks submitted with {"foo":1}.

SultanOrazbayev
  • 14,900
  • 3
  • 16
  • 46