mirror of
https://github.com/wassname/ray.git
synced 2026-08-03 13:10:57 +08:00
[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user