[tune] Component notification on node failure + Tests (#3414)

Changes include:
 - Notify Components on Requeue
 - Slight refactoring of Node Failure handling
 - Better tests
This commit is contained in:
Richard Liaw
2018-12-04 14:47:31 -08:00
committed by GitHub
parent ce355d13d4
commit 9d0bd50e78
8 changed files with 180 additions and 114 deletions
+2 -24
View File
@@ -32,12 +32,10 @@ class TrialExecutor(object):
"has_resources() method")
def start_trial(self, trial, checkpoint=None):
"""Starts the trial restoring from checkpoint if checkpoint != None.
If an error is encountered when starting the trial, an exception will
be thrown.
"""Starts the trial restoring from checkpoint if checkpoint is provided.
Args:
trial (Trial): Trial to be started.
checkpoint(Checkpoint): A Python object or path storing the state
of trial.
"""
@@ -59,26 +57,6 @@ class TrialExecutor(object):
raise NotImplementedError("Subclasses of TrialExecutor must provide "
"stop_trial() method")
def restart_trial(self, trial, error_msg=None):
"""Restarts or requeues the trial.
The state of the trial should restore from the last checkpoint. Trial
is requeued if the cluster no longer has resources to accomodate it.
Args:
error_msg (str): Optional error message.
"""
self.stop_trial(
trial,
error=error_msg is not None,
error_msg=error_msg,
stop_logger=False)
trial.result_logger.flush()
if self.has_resources(trial.resources):
self.start_trial(trial)
else:
trial.status = Trial.PENDING
def continue_training(self, trial):
"""Continues the training of this trial."""
pass