Shortcuts

RayActorTransport

class torchrl.weight_update.RayActorTransport(actor_ref=None, update_method: str = 'tensordict', tensor_transport: Literal['object_store', 'nixl'] = 'object_store')[source]

Ray transport for communicating with Ray actors (not collectors).

This transport is designed for updating models hosted within Ray actors, such as RayModuleTransform instances. It directly calls the actor’s update_weights method rather than going through collector update methods.

check_ack(message: str = 'updated') None[source]

No acknowledgment needed for Ray actors.

check_connection() bool[source]

Check if Ray is initialized and actor exists.

receive_weights(timeout: float = 1.0) tuple[str, Any] | None[source]

Ray actor workers receive weights through direct method calls.

send_ack(message: str = 'updated') None[source]

No acknowledgment needed for Ray actors.

send_weights(model_id: str, weights: Any) None[source]

Send weights to the Ray actor.

send_weights_async(model_id: str, weights: Any) None[source]

Send weights to Ray actor without waiting for completion.

Use wait_ack() to wait for completion after sending to all actors.

set_actor(actor_ref)[source]

Set the Ray actor reference to communicate with.

wait_ack() None[source]

Wait for Ray actor to finish applying weights.

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources