Description
rdt: enable ray.put() and free() from driver process with a one-sided transport
put_object():
Wrap ray.get_runtime_context().current_actor in try/except RuntimeError
so the driver context (which raises) cleanly sets src_actor=None.
Validate that driver-side puts require a one-sided transport - two-sided
transports (NCCL, GLOO) need an actor context to coordinate the send.
free_object_primary_copy():
When src_actor is None the primary copy lives in the driver's own RDT
store, not on a remote actor. Call ray_free directly in-process
instead of dispatching .remote() on a None handle (which would crash).
trigger_out_of_band_tensor_transfer():
Guard the "sent back to src" warning and the src==dst intra-process skip
with src_actor is not None to avoid AttributeError when the object
was created by the driver rather than an actor.
An implementation option can be found here: https://github.com/ray-project/ray/commit/088dc52412261ab9d95e9222d7dff89bc66f3551
Use case
Non ray actors can be the source of memory from where a ray actor would want to be reading with one sided transport.
current implementation requires a copy to a ray actor in the source side before calling ray.put .
enabling a non ray actor to call put and free with one sided transport will eliminate the copy
Description
rdt: enable ray.put() and free() from driver process with a one-sided transport
put_object():
Wrap ray.get_runtime_context().current_actor in try/except RuntimeError
so the driver context (which raises) cleanly sets src_actor=None.
Validate that driver-side puts require a one-sided transport - two-sided
transports (NCCL, GLOO) need an actor context to coordinate the send.
free_object_primary_copy():
When src_actor is None the primary copy lives in the driver's own RDT
store, not on a remote actor. Call ray_free directly in-process
instead of dispatching .remote() on a None handle (which would crash).
trigger_out_of_band_tensor_transfer():
Guard the "sent back to src" warning and the src==dst intra-process skip
with
src_actor is not Noneto avoid AttributeError when the objectwas created by the driver rather than an actor.
An implementation option can be found here: https://github.com/ray-project/ray/commit/088dc52412261ab9d95e9222d7dff89bc66f3551
Use case
Non ray actors can be the source of memory from where a ray actor would want to be reading with one sided transport.
current implementation requires a copy to a ray actor in the source side before calling ray.put .
enabling a non ray actor to call put and free with one sided transport will eliminate the copy