MCPcopy Create free account
hub / github.com/agentscope-ai/Trinity-RFT / sync_model_weights

Method sync_model_weights

trinity/common/models/model.py:843–853  ·  view source on GitHub ↗

Sync the model weights

(
        self,
        model_version: int,
        method: SyncMethod,
        timeout: float = 1200,
    )

Source from the content-addressed store, hash-verified

841 await self.model.set_state_dict_meta.remote(state_dict_meta)
842
843 async def sync_model_weights(
844 self,
845 model_version: int,
846 method: SyncMethod,
847 timeout: float = 1200,
848 ) -> None:
849 """Sync the model weights"""
850 await self.model.sync_model_weights.remote(model_version, method, timeout=timeout)
851 if self._engine_type == "tinker":
852 # update the model path after syncing weights for tinker engine
853 self._model_path = await self.model.get_model_path.remote()
854
855 def extract_experience_from_history(self, clear_history: bool = True) -> List[Experience]:
856 """Extract experiences from the history."""

Callers 4

_pull_latest_weightsMethod · 0.45
_nccl_weights_updateMethod · 0.45
_sync_model_weightsMethod · 0.45

Calls 1

remoteMethod · 0.80

Tested by

no test coverage detected