Driver program runs on node A, actor can only be created on node B (because only B can satisfy this resource). But why can’t node A get object across nodes through ref, this ref is valid, node B can get object.
import ray
import numpy as np
ray.init(address='auto')
@ray.remote(num_cpus=1, resources={"node": 1})
class Actor:
def foo(self):
pass
def put(self):
ref = ray.put(np.ones(2**29, dtype=np.uint8))
return ref
def get(self, ref):
x = ray.get(ref)
print(x)
actor = Actor.remote()
ref = actor.put.remote()
actor.get.remote(ref) # output is array
arr = ray.get(ref)
print(np.sum(arr)) # output is nothing