MPTransport¶
- class torchrl.weight_update.MPTransport(pipe_connection, timeout: float = 10.0)[source]¶
Multiprocessing transport using pipes.
- Parameters:
pipe_connection (mp.Pipe) – The pipe connection to use for communication.
timeout (float) – The timeout for waiting for acknowledgment. Default is 10 seconds.
- receive_weights(timeout: float = 1.0) tuple[str, Any] | None[source]¶
Receive weights from the pipe (used in worker process).
- send_weights(model_id: str, weights: Any) None[source]¶
Send weights through the pipe.
Sends weights and waits for acknowledgment to ensure delivery.