Skip to content

feat: KEP-3744: Store trial history natively in OptimizationJob status - #3856

Open
Sridhar1030 wants to merge 3 commits into
kubeflow:masterfrom
Sridhar1030:kep/3744-trial-history
Open

feat: KEP-3744: Store trial history natively in OptimizationJob status#3856
Sridhar1030 wants to merge 3 commits into
kubeflow:masterfrom
Sridhar1030:kep/3744-trial-history

Conversation

@Sridhar1030

@Sridhar1030 Sridhar1030 commented Aug 5, 2026

Copy link
Copy Markdown
Member

What this PR does / why we need it:

This PR introduces KEP-3744, proposing native trial history in OptimizationJob.status.trials.

In the Phase 1 design of KEP-3562, the controller reconstructs trial history from child TrainJob annotations, so deleting any trial TrainJob (manually, or via TTL/GC cleanup) silently corrupts a running optimization. This KEP makes the OptimizationJob self-contained: each trial's record is written at creation and finalized once at terminal state, the suggestion snapshot is assembled entirely from status, and no child finalizers are needed.

Raised during the KEP-3562 API review: #3565 (comment)

Which issue(s) this PR fixes:
Part of #3744

Does this PR introduce a user-facing change?
No, design proposal only.

Checklist:

  • Docs included if any changes are user facing
  • KEP doc included

Records each trial's parameters, objective metrics, state, and timestamps
in OptimizationJob.status.trials so the optimization survives deletion of
trial TrainJobs at any lifecycle point. Records are written at trial
creation and patched once at terminal state, making the suggestion
snapshot fully self-contained without child finalizers.

Follow-up to KEP-3562 Phase 1, which reconstructs history from TrainJob
annotations and loses it when trials are garbage collected.

Fixes: kubeflow#3744
Signed-off-by: Sridhar1030 <sridharpillai75@gmail.com>
@google-oss-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign tenzen-y for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: Sridhar1030 <sridharpillai75@gmail.com>
…, add test plan checkbox

Signed-off-by: Sridhar1030 <sridharpillai75@gmail.com>
@Sridhar1030
Sridhar1030 marked this pull request as ready for review August 6, 2026 06:41
Copilot AI balanced review requested due to automatic review settings August 6, 2026 06:41
@google-oss-prow
google-oss-prow Bot requested a review from jinchihe August 6, 2026 06:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Sridhar1030
Sridhar1030 requested a balanced review from Copilot August 6, 2026 06:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Krishna-kg732

Copy link
Copy Markdown
Member

Left a couple of status suggestions on #3552 that overlap with this — result becoming a list, and recording the winning trial's objective value. Both are cheaper while that PR is still open, so maybe worth landing them there and building this on top? Happy either way, mostly just don't want us to end up with two status designs to reconcile later.

One thing I'd find useful in the proposal: where does the boundary sit between what the controller reconstructs and what status owns? If OptimizationJobStatus becomes the source of truth for history, then buildSuggestionRequest() would read from status rather than the opt-param-* annotations, and those drop to being a debugging aid. That seems like a good simplification to me, but it does change KEP-3562 §8.2 and §8.4 — might be worth calling out explicitly so it reads as a deliberate change rather than an implied one.

Also, have you thought about how to bound the growth? 100 trials × up to 100 parameters in a single status object gets fairly large, and I think that's part of why Katib kept trial state in separate CRs.

@Sridhar1030

Copy link
Copy Markdown
Member Author

Thanks @Krishna-kg732! On growth: this is covered in Risks under "Status object growth" (capped list, and the controller checks the bound before appending, so the failure mode is an explicit condition rather than a rejected status write); curious whether you think the cap needs to be lower. On #3552: would you prefer result become a list there first and this KEP build on top, or keep result as a projection of trials and land the shape change later? And on the KEP-3562 boundary: would an explicit note in Compatibility, calling out that this deliberately amends §8.2 and §8.4, address your concern?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants