def _init(self): self._loggers = [] for cls in self._logger_cls_list: try: self._loggers.append(cls(self.config, self.logdir, self.trial)) except Exception as exc: logger.warning("Could not instantiate %s: %s.", cls.__name__, str(exc)) self._log_syncer = get_node_syncer(self.logdir, remote_dir=self.logdir, sync_function=self._sync_function)
def get_trial_node_syncer(trial: TrialStub, tmpdir: str) -> NodeSyncer: global _trial_node_syncers if trial not in _trial_node_syncers: optional_cloud_syncer = detect_sync_to_driver(sync_to_driver=True) node_syncer = get_node_syncer(tmpdir, remote_dir=trial.local_dir, sync_function=optional_cloud_syncer) _trial_node_syncers[trial] = node_syncer return _trial_node_syncers[trial]
def _create_trial_syncer(self, trial: "Trial"): sync_fn = self._get_sync_fn(trial) return get_node_syncer(trial.logdir, remote_dir=trial.logdir, sync_function=sync_fn)