连接到多个ray.io遥控地址同时连接
我有一个运行远程光线任务的服务。 当前,所有任务都在同一射线群集上运行,但是我希望能够在另一个射线群集上运行其他任务。
今天初始化的方式是使用ray.init(address = ray_cluster_1)
在初始化服务时,然后在代码中,我使用foo.remote()调用装饰的功能()
。
是否可以初始化两个地址并确定要拨打哪个地址?
类似:
ray.init(addresses=[ray_cluster_1, ray_cluster_2])
@ray.remote
def foo()
pass
foo.remote(address=ray_cluster_1)
foo.remote(address=ray_cluster_2)
如果没有,我看到的唯一选择是拥有两种不同的服务,一个射线。建议?
I have a service that runs remote ray tasks.
Currently, all tasks run on the same ray cluster, but I want to be able to run some other tasks on another ray cluster.
The way it's initialized today is using ray.init(address=ray_cluster_1)
while initializing the service, and then in the code, I call decorated functions using foo.remote()
.
Is it possible to initialize two addresses and decide which one to call?
Something like:
ray.init(addresses=[ray_cluster_1, ray_cluster_2])
@ray.remote
def foo()
pass
foo.remote(address=ray_cluster_1)
foo.remote(address=ray_cluster_2)
if not, the only option that I see is to have two different services, one per ray. Suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
雷通过将
ray.init
作为上下文管理器的输出来对此进行实验支持。请注意,您必须使用Ray Client连接到射线簇 https://docs.ray.io/en/latest/latest/cluster/ray-client.html#connect-to-multiple-ray-ray-clusters-clusters-profentiment
Ray has experimental support with this by treating the output of
ray.init
as a context manager.Note that you must be using Ray Client to connect to your ray cluster https://docs.ray.io/en/latest/cluster/ray-client.html#connect-to-multiple-ray-clusters-experimental