Ray 没有将远程功能分发到本地机器上的所有节点

问题描述

我试图通过文件的路径将文件列表分发到远程 Ray 函数,该函数读取文件,然后调用自定义库中的其他函数以在文件上执行。但是,当我检查 Ray UI 中的进度时,仅使用了 8 个节点中的 2 个,并且处理时间与进行处理的节点数少于 8 个一致。我对 Ray 很陌生,因此无法理解正在发生的事情。下面是一个例子:

import ray
import custom_lib 
import glob

ray.init()

@ray.remote
def remote_func(path):
    with open(path) as file:
    s = file.read()
    custom_data = custom_lib.custom_func(s)
    return custom_data

paths = glob.glob('/location/of/text/files/'+'//*.txt')
data = ray.get([remote_func.remote(p) for p in paths])

我使用的是 python 3.8 和 ray 1.2。提前致谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)