feat: support early stopping callbacks on a validation step
@@ -157,6 +157,12 @@ func (s *trialWorkloadSequencer) WorkloadCompleted(
return errors.Errorf("invalid StepID in workload completed message: %s", msg.Workload)
}
s.curStepDone.hasValidation = true
+ if msg.ExitedReason != nil {
+ s.steps = s.steps[:msg.Workload.StepID+1]
+ if *msg.ExitedReason == searcher.UserCanceled {
+ s.steps[msg.Workload.StepID].hasCheckpoint = true
+ }
+ } else {
switch s.checkpointPolicy {
case model.AllCheckpointPolicy:
s.steps[msg.Workload.StepID].hasCheckpoint = true
@@ -165,6 +171,7 @@ func (s *trialWorkloadSequencer) WorkloadCompleted(
s.steps[msg.Workload.StepID].hasCheckpoint = true
}
}
+ }
default:
return errors.New("invalid operation for trialWorkloadSequencer")
}
