指定任务资源:小数gpu [英] Specifying Task Resources: Fractional gpu
问题描述
是否可以为任务指定分数gpu要求?在Dask网页上的示例中,它指定了一个GPU.
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})
为小型模型分配一个GPU会很浪费.
It will be a waste to allocate one GPU for a small model.
射线库可以这个.
推荐答案
是的,允许使用少量资源.
Yes, fractional resources are allowed.
通常,资源是任意单位,因此如果使用"GPU = 2"实例化调度程序,则资源为任意单位.或某些"foo = 10&",调度器将在任务分配期间跟踪这些资源,但是调度器并不真正知道(或关心)什么"GPU".或"foo"是.提交任务时,您可以传递 {"GPU":0.25}
,并且调度程序将分配分配给GPU工作人员的多个任务,例如,如果通知调度程序每个工作人员都具有; foo = 10&;
,那么调度程序将要求每个工作程序最多同时运行十个通过 {" foo:1}
提交的任务.
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}
.
这篇关于指定任务资源:小数gpu的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!