training-operator icon indicating copy to clipboard operation
training-operator copied to clipboard

feat(docs): Extend KEP-2170 with Initializer plugin design

Open akshaychitneni opened this issue 5 months ago • 7 comments

What this PR does / why we need it:

Extends KEP-2170 with a new ### The Initializer Plugin section specifying a dedicated Pipeline Framework plugin that owns dataset/model initializer wiring. Also adds EnforceInitializer to the Build Phase extension points.

Motivation

Today the initializer wiring lives inside the JobSet plugin's builder (pkg/runtime/framework/plugins/jobset/builder.go:42-102), which:

  • Conflates JobSet assembly with Initializer configuration
  • Forces TrainJobs to use only Runtimes that already ship initializer ReplicatedJob templates (blocks #2886)
  • Leaves no natural home for sharing (KEP-3310, #3311)

What this PR adds

  • ### The Initializer Plugin section under Design Details
  • EnforceInitializer extension point in the Pipeline Framework list
  • Schema sketches for Container.EnvFrom and Configuration.InitializerDefaults

Related: #2886, #3311

Checklist:

  • [ ] Docs included if any changes are user facing

akshaychitneni avatar Jul 04 '26 17:07 akshaychitneni

[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 terrytangyuan for approval. For more information see the Kubernetes Code Review Process.

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

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

google-oss-prow avatar Jul 04 '26 17:07 google-oss-prow

cc @andreyvelich @tenzen-y @astefanutti

akshaychitneni avatar Jul 04 '26 17:07 akshaychitneni

@akshaychitneni Could you also update Implementation History please? https://github.com/kubeflow/trainer/tree/master/proposals/2170-kubeflow-trainer-v2#implementation-history

andreyvelich avatar Jul 13 '26 02:07 andreyvelich

@akshaychitneni @andreyvelich do we need to worry about how this interacts with the snapshot mechanism? Eg if the defaults are updated should they be applied only to new train jobs or should existing train jobs also be updated?

Can we consider these defaults as "initial" config that can be overridden by the runtime or train job? If we can, do we need a plug-in for this? Can we just change the runtime loading logic to be "load me the effective runtime, applying any defaults if necessary"?

robert-bell avatar Jul 13 '26 20:07 robert-bell

Eg if the defaults are updated should they be applied only to new train jobs or should existing train jobs also be updated? Can we consider these defaults as "initial" config that can be overridden by the runtime or train job?

IMO, it should only be applied to the newly created TrainJobs. If the Config is updated after TrainJob is already created, it should not change it.

andreyvelich avatar Jul 14 '26 00:07 andreyvelich

Eg if the defaults are updated should they be applied only to new train jobs or should existing train jobs also be updated? Can we consider these defaults as "initial" config that can be overridden by the runtime or train job?

IMO, it should only be applied to the newly created TrainJobs. If the Config is updated after TrainJob is already created, it should not change it.

I agree with this. In which case we need to update the snapshot mechanism to snapshot the effective runtime (ie after the defaults have been applied).

@akshaychitneni could we update the snapshot kep once we have agreed a spec?

robert-bell avatar Jul 14 '26 06:07 robert-bell

Hii, Following from the discussion of @robert-bell and @andreyvelich, one possible improvement could be to explicitly document the boundary between initializer defaults and runtime defaults.

It seems useful to keep the Initializer plugin runtime-agnostic and PodSet-aware, while leaving runtime-specific translation such as JobSet volumeClaimPolicies to the runtime ComponentBuilder. For the defaults API, maybe we can start with a focused initializer-specific shape, but group PVC-related fields under something like volumeClaimPolicy so fields such as storageClassName, accessModes, and resources can be extended without growing many top-level fields.

This may address #2886 while still leaving room for future shared initializer support from #3311.

HarshPopat23 avatar Jul 17 '26 06:07 HarshPopat23

Hii, Following from the discussion of @robert-bell and @andreyvelich, one possible improvement could be to explicitly document the boundary between initializer defaults and runtime defaults.

It seems useful to keep the Initializer plugin runtime-agnostic and PodSet-aware, while leaving runtime-specific translation such as JobSet volumeClaimPolicies to the runtime ComponentBuilder. For the defaults API, maybe we can start with a focused initializer-specific shape, but group PVC-related fields under something like volumeClaimPolicy so fields such as storageClassName, accessModes, and resources can be extended without growing many top-level fields.

This may address #2886 while still leaving room for future shared initializer support from #3311.

Based on the discussion in https://github.com/kubeflow/trainer/pull/3701#discussion_r3567573524, moved with runtime defaults having jobset spec for now

akshaychitneni avatar Aug 06 '26 22:08 akshaychitneni

@andreyvelich @robert-bell checking if you have any other comments from moving this forward. With recent discussion in the call, I believe initialization should be in the prebuild phase and can be included once we land the refactored api

akshaychitneni avatar Aug 06 '26 22:08 akshaychitneni

I might be missing context from the call discussion, but the KEP text still describes EnforceInitializer as a Build Phase extension point that runs alongside EnforceMLPolicy and EnforcePodGroupPolicy, while your latest comment mentions moving initialization to the prebuild phase. Should the section be updated to reflect that before this merges, or is that intentionally deferred to the refactored API PR?

Sridhar1030 avatar Aug 08 '26 09:08 Sridhar1030

Thanks @akshaychitneni. This looks in good shape. Just a small query and suggestion.

Re: prebuild vs. build - I think this is a prebuild step? It's configuring the initializer pods before build?

@robert-bell yes this is prebuild phase

akshaychitneni avatar Aug 31 '26 22:08 akshaychitneni

Updated runtime snapshot KEP and also included minimal default spec fields that can later be extended. @robert-bell @andreyvelich

akshaychitneni avatar Sep 02 '26 22:09 akshaychitneni