Best way to transfer Ray object refs

  • Medium: It contributes to significant difficulty to complete my task, but I can work around it.

Let’s say worker A puts an object into the object store and gets an object ref X. I would like to serialize X and give it to another worker B, who can then call ray.get(X).

Is this even ppossible?

You can just pass it to the other worker. In your case, I assume worker B is an actor (otherwise there is no worker). And you can pass object ref to B by calling B’s remote method. You should put the X into a list to defer the dereference.

Does this error make sense to you by any chance?

Traceback (most recent call last):
File “”, line 1, in
File “/home/ziheng/miniconda3/envs/quokka-dev/lib/python3.8/site-packages/ray/util/client/”, line 95, in init
File “/home/ziheng/miniconda3/envs/quokka-dev/lib/python3.8/site-packages/ray/util/client/”, line 186, in _set_id
AttributeError: ‘NoneType’ object has no attribute ‘call_retain’

I think I have a better understanding of what’s going on @yic . The thing that I am passing to ray.cloudpickle.dumps() is a ClientObjectRef. I am trying to loads it in a remote actor started by same client. If I just loads it in the client it works fine. But trying to load it in the remote actor causes problems. Makes sense to me since it’s called ClientObjectRef, and the error tries to go do some stuff in ray/util/client which presumably the remote Ray actor can’t do.

1 Like