KEP-3562: Store trial history natively in `OptimizationJob` Status
What you would like to be added?
Context:
In the Phase 1 design of KEP-3562, the OptimizationJob controller reconstructs trial history by querying existing TrainJobs in the cluster.
Problem:
Relying entirely on TrainJobs to reconstruct optimization state is brittle because they are execution resources with independent lifecycles and may be garbage collected. This makes the OptimizationJob less self-contained.
Future Goals (Phase 2):
- Update the
OptimizationJobStatusto aggregate and own the optimization state directly. - Store the list of all trials (strongly-typed hyperparameters + objective scores) natively in the status.
- Decouple the core optimization logic from
TrainJobpersistence.
Relates to KEP-3562 Master Tracking Issue.
Why is this needed?
If Kubernetes garbage-collects old TrainJobs to save cluster space, the controller currently loses the experiment's history. Storing the history natively inside the OptimizationJob ensures the optimization state is never lost.
Love this feature?
Give it a 👍 We prioritize the features with most 👍
/area hpo /remove-label needs-triage
Hi @aniket2405 and @andreyvelich, I’m interested in working on this issue.
My proposed approach is to:
- extend
OptimizationJobStatuswith strongly typed trial-history fields; - store each trial’s hyperparameters, objective scores, and relevant state in the
OptimizationJobstatus; - update the controller to persist trial results as trials progress;
- use the status as the source of truth instead of relying entirely on retained
TrainJobresources; - preserve history when completed
TrainJobresources are garbage collected; - add CRD validation, controller unit tests, and status serialization/update tests;
- update the KEP/API documentation and generated CRD artifacts as required.
Before I begin, could you please confirm whether the Phase 2 API design is ready for implementation and whether anyone is already working on it? I would also appreciate guidance on the preferred status schema and backward-compatibility expectations. If the issue is available, I’d be happy to take it and prepare a focused implementation plan before opening a PR.
Hi! I've opened a draft PR for this since there wasn't an open PR associated with the issue. I'd like to take this forward.
@HarshPopat23 I'd love to hear your thoughts and any feedback on the implementation.
/assign
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
/remove-lifecycle stale