提到了一个可能的解决方案,即设置环境变量RAY_DISABLE_MEMORY_MONITOR为1来禁用内存监控。
hello_world.py
import ray
ray.init(redis_address="192.168.1.6:6379")
@ray.remote
def hello():
return "Hello"
@ray.remote
def world():
return "world!"
@ray.remote
def hello_world(a, b):
return a + " " + b
a_id = hello.remote()
b_id = world.remote()
c_id = hello_world.remote(a_id, b_id)
hello = ray.get(c_id)
print(hello)
运行:python hello_world.py
输出:
Hello world!