Can we create a Dask cluster having multiple CPU machines as well as multiple GPU machines both.?

不打扰是莪最后的温柔 提交于 2019-12-11 08:04:02

问题


Can we create a dask-cluster with some CPU and some GPU machines together. If yes, how to control a certain task must run only on CPU machine, or some other type of task should run only on GPU machine, and if not specified, it should pick whichever machine is free.?

does dask support such type of cluster.? what is the command that controls the task to run on a specific CPU/GPU machine.?


回答1:


You can specify that a Dask worker has certain abstract resources

dask-worker scheduler:8786 --resources "GPU=2"
dask-worker scheduler:8786 --resources "GPU=2"
dask-worker scheduler:8786 --resources "MEMORY=100e9"

and that a task consumes those resources during execution.

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

You can use this to model machines with GPUs. Note that these terms GPU and MEMORY are just abstract terms. They could just as easily been FOO and BAR.

See documentation on worker resources for more information.



来源:https://stackoverflow.com/questions/49854695/can-we-create-a-dask-cluster-having-multiple-cpu-machines-as-well-as-multiple-gp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!