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

Method sync_weight

trinity/explorer/explorer.py:480–495  ·  view source on GitHub ↗

Synchronize model weights.

(self)

Source from the content-addressed store, hash-verified

478 )
479
480 async def sync_weight(self) -> None:
481 """Synchronize model weights."""
482 # call this method before training start to load the latest model weights
483 if self.rollout_coordinator is not None and self.explore_step_num == 0:
484 await self._finish_eval_step(step=0)
485
486 self.logger.info(f"Explorer sync_weights at step {self.explore_step_num} started.")
487 if self.use_nccl_sync:
488 await self._nccl_weights_update()
489 else: # pull weights from Synchronizer
490 await self._pull_latest_weights()
491 self.logger.info(
492 f"Explorer sync_weights at step {self.explore_step_num} finished, model version = {self.model_version}."
493 )
494
495 await self.save_checkpoint()
496
497 async def _finish_steps(self, start_step: int, end_step: int) -> None:
498 for step in range(start_step, end_step + 1):

Callers 1

exploreMethod · 0.95

Calls 4

_finish_eval_stepMethod · 0.95
_nccl_weights_updateMethod · 0.95
_pull_latest_weightsMethod · 0.95
save_checkpointMethod · 0.95

Tested by

no test coverage detected