dask 如何在集群中分配工作?

How does dask distribute work amongst the cluster?

dask distributed能否处理不均匀的worker节点?

例如,如果在 4 核计算机上有一个 dask worker,在 2 核计算机上有第二个 dask worker,是否会使用所有 6 个内核?

另外,dask 是否严格要求在所有计算机之间分配工作?即dask是否可以选择将所有工作发送到一台计算机,因为它确定如果分布式通信开销太大?

Can dask distributed handle uneven worker nodes?

是的,节点的核心数量、内存量甚至可能具有特殊硬件(如 GPU),并且 Dask 中有机制来处理这种情况。

For example, if there is a dask worker on a 4 core computer and a second dask worker on a 2 core computer, will all 6 cores to be utilised?

是的,Dask 调度程序会根据每台机器的核心数自动进行负载平衡。如果由于某种原因这是错误的(例如核心数量不正确),那么工作窃取机制无论如何都会平衡它。

Also is it a strict requirement for dask to distribute the work amongst all the computers? That is, can dask choose to send all the work to one computer because it determines that there would be too much communication overhead if distributed?

Dask 调度程序维护每个中间结果的大小,并决定将数据移动到特定的机器,并考虑到这些大小和预期的运行时间。在某些情况下,Dask 会决定让工作人员保持闲置,因为中间结果太昂贵而无法沟通。

如果你愿意,你也可以手动控制它(尽管自动启发式应该没问题)。参见 http://distributed.readthedocs.io/en/latest/locality.html

http://distributed.readthedocs.io/en/latest/scheduling-policies.html

上有关于此主题的更多信息