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

Method need_sync

trinity/explorer/explorer.py:389–402  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

387 await asyncio.sleep(0.5)
388
389 async def need_sync(self) -> bool:
390 if self.sync_style == SyncStyle.FULLY_ASYNC:
391 # Fully async mode calls weight sync directly, without need_sync check
392 return False
393 if self.explore_step_num <= self.sync_offset:
394 return False
395 if (self.explore_step_num - self.sync_offset) % self.sync_interval == 0:
396 await self.finish_current_steps()
397 if self.sync_style == SyncStyle.TRAINER_DRIVEN and self.sync_method == SyncMethod.NCCL:
398 require_sync = bool(await self.synchronizer.trainer_requires_weight_sync.remote())
399 else:
400 require_sync = True
401 return require_sync
402 return False
403
404 def need_eval(self) -> bool:
405 return self.explore_step_num % self.config.explorer.eval_interval == 0

Callers 1

exploreMethod · 0.95

Calls 2

finish_current_stepsMethod · 0.95
remoteMethod · 0.80

Tested by

no test coverage detected