WeightSyncScheme¶
- class torchrl.weight_update.WeightSyncScheme(strategy: Literal['state_dict', 'tensordict'] = 'state_dict')[source]¶
Configuration for how to synchronize ONE model across workers.
A scheme is a pure configuration object that specifies: - The transmission strategy (state_dict vs tensordict) - How to create the transport for communication
Each scheme is responsible for one model type but is shared across all workers.
- create_receiver() WeightReceiver[source]¶
Create a receiver for this scheme.
- Returns:
WeightReceiver instance configured for this scheme.
- create_sender() WeightSender[source]¶
Create a sender for this scheme.
- Returns:
WeightSender instance configured for this scheme.
- abstract create_transport(pipe_or_context: Any) TransportBackend[source]¶
Create transport for communication.
- Parameters:
pipe_or_context – Either a pipe connection or context object to extract pipe from.
- Returns:
A transport backend instance.