[core] feat(rdt): enable driver-side ray.put with NIXL tensor transport - #65072
[core] feat(rdt): enable driver-side ray.put with NIXL tensor transport#65072n3sfan wants to merge 2 commits into
Conversation
Allow ray.put(value, _tensor_transport='nixl') from a driver process. Previously this failed because get_runtime_context().current_actor raises RuntimeError in a non-actor context. Changes: - Make RDTMeta.src_actor and TransferMetadata.src_actor Optional - Catch RuntimeError in put_object and set src_actor=None for driver - Reject two-sided transports (NCCL/GLOO) from driver with clear error - Guard src_actor dereferences in _abort_transport and transfer paths - Handle free_object_primary_copy locally for driver-owned objects - Raise ValueError for _use_object_store=True on driver-owned RDT objects - Align worker.py error to RuntimeError with 'one-sided transport' message Fixes ray-project#64714 Signed-off-by: n3sfan <quangminhcantho43@gmail.com>
There was a problem hiding this comment.
Code Review
This pull request introduces support for driver-owned RDT (Ray Distributed Tensor) objects, allowing ray.put() to be called from the driver using one-sided transports like NIXL. It updates the RDT manager to handle cases where src_actor is None during transport abortion, actor cleanup, and object freeing, and adds corresponding unit tests. The review feedback suggests correcting a misleading error message in worker.py regarding two-sided transports and changing a ValueError to RuntimeError in rdt_manager.py for consistency.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 9f2d119. Configure here.
- worker.py: Fix misleading two-sided transport error message; ray.put() never supports two-sided transports, not just from driver - rdt_manager.py: Change ValueError to RuntimeError for consistency with other RDT transport checks Signed-off-by: n3sfan <quangminhcantho43@gmail.com>

Allow ray.put(value, _tensor_transport='nixl') from a driver process. Previously this failed because get_runtime_context().current_actor raises RuntimeError in a non-actor context.
Changes:
Fixes #64714
Tests
Three new tests in
python/ray/tests/rdt/test_rdt_nixl.py:test_driver_put_nixlEnd-to-end driver-side NIXL flow:
ray.put(tensor, _tensor_transport="nixl")from the driversrc_actor is Nonein RDT metadataactor.sum.remote(ref)ray.get(ref)returns the original tensordel ref+gc.collect(), verify cleanup: tensor freed, RDT metadata removed, NIXL metadata removed, tensor descriptor cache clearedtest_driver_owned_rdt_rejects_object_store_fallbackVerify
_use_object_store=Trueon a driver-owned RDT object raisesValueErrormatching_use_object_store=Trueinstead of crashing withAttributeErroronNone.__ray_call__.test_driver_rejects_two_sided_transportVerify
ray.put(tensor, _tensor_transport="nccl")from the driver raisesRuntimeErrormatchingone-sided transport. Two-sided transports require an actor context to coordinate the send.Running
Results
test_driver_put_nixltest_driver_owned_rdt_rejects_object_store_fallbacktest_driver_rejects_two_sided_transport