Skip to content

Commit

Permalink
[tune] Only try to sync driver if sync_to_driver is actually enabled (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
krfricke authored Oct 21, 2021
1 parent eb24b08 commit 15cdffe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/ray/tune/syncer.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,10 @@ def _sync_trial_checkpoint(self, trial: "Trial", checkpoint: Checkpoint):
from ray.tune.durable_trainable import DurableTrainable

trial_syncer = self._get_trial_syncer(trial)
if trial.sync_on_checkpoint:
# If the sync_function is False, syncing to driver is disabled.
# In every other case (valid values include None, True Callable,
# NodeSyncer) syncing to driver is enabled.
if trial.sync_on_checkpoint and self._sync_function is not False:
try:
# Wait for any other syncs to finish. We need to sync again
# after this to handle checkpoints taken mid-sync.
Expand Down

0 comments on commit 15cdffe

Please sign in to comment.