(self)
| 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 |
no test coverage detected