Repository navigation
fix(optimizer): report Failed when every Trial of an OptimizationJob failed - #1006
debojyoti-dev wants to merge 1 commit into
Conversation
…failed Without maxFailedTrialCount, Katib marks the Experiment Succeeded once it reaches maxTrialCount, even if every Trial failed. The SDK mapped that to Complete, so wait_for_job_status() returned normally for a search where no Trial ran successfully. Report Failed when the Experiment is Succeeded but its status counts failed Trials and no succeeded or early-stopped ones. Fixes kubeflow#999 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Debojyoti Banerjee <debojyoti30dev@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
What this PR does / why we need it:
Without
max_failed_trials, Katib leavesmaxFailedTrialCountunset and marks the ExperimentSucceeded(reasonExperimentMaxTrialsReached) once it reachesmaxTrialCount, even when every Trial failed. The SDK mapped that toComplete, sowait_for_job_status()returned normally for a search where nothing ran, andget_best_results()returnedNone. I reproduced this on kind (Kubernetes 1.34.11, Trainer v2.4.0, Katib v0.19.0) with a training function that raises: both TrialsFailed, OptimizationJobComplete.__get_optimization_job_from_crnow reportsFailedwhen the Experiment isSucceededbut its status counts failed Trials and no succeeded or early-stopped ones. I used the Experiment's Trial counts rather thancurrentOptimalTrial(option 1 in the issue). That keeps the check to the case the issue describes, so aSucceededExperiment with at least one succeeded or early-stopped Trial still reportsComplete. Withmax_failed_trialsset, Katib already fails the Experiment itself, and that path is unchanged.Tests:
test_get_job_status_conditions: new cases for every Trial failed (Failed), some Trials failed (Complete), and early-stopped plus failed Trials (Complete).test_wait_for_job_status: a new case where waiting forCompleteon a job whose Trials all failed raisesRuntimeError.create_experiment_crtakes optional Trial counts.Related: #893 also edits the status mapping in
__get_optimization_job_from_cr(theRunningcondition). The two changes touch different branches of the same loop, so at most a small rebase is needed whichever lands first.AI disclosure: I used Claude Code to help with this change. I reviewed and tested every line, per the Kubeflow AI policy.
Which issue(s) this PR fixes (optional, in
Fixes #<issue number>, #<issue number>, ...format, will close the issue(s) when PR gets merged):Fixes #999
Checklist:
🤖 Generated with Claude Code
Summary by CodeRabbit