rlightning.weights.weight_transfer_manager¶
- class rlightning.weights.weight_transfer_manager.WeightTransferManager(buffer_strategy: str)[source]¶
Bases:
object- recv_weights(weight_buffer, metadata_by_dtype)[source]¶
Receive weights from the train policy, grouped by dtype. Delegates the buffering and application logic to the configured WeightBuffer. This method is called by policies that do NOT use the shared buffer actor.
- recv_weights_local(weight_buffer, state_dict)[source]¶
Receive weights directly for single process mode (non-remote).
- send_weights(state_dict: Dict[str, Dict[str, MockModule('torch.Tensor')]], eval_policies: List[MockModule('ray.actor.ActorHandle')])[source]¶
Broadcasts the state dict to the eval policies.
This function is called on the TrainPolicy under sync mode. It dispatches to the correct sending strategy based on the eval policies’ configuration.
- Parameters:
- Raises:
ValueError – Invalid buffer strategy