Skip to content

chore(trainer): add data and model initializers guide#414

Merged
google-oss-prow[bot] merged 3 commits into
kubeflow:mainfrom
1Ayush-Petwal:docs/initializers-guide
Apr 10, 2026
Merged

chore(trainer): add data and model initializers guide#414
google-oss-prow[bot] merged 3 commits into
kubeflow:mainfrom
1Ayush-Petwal:docs/initializers-guide

Conversation

@1Ayush-Petwal

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

  • Add docs/source/train/initializers.rst — new guide covering all 5 initializer
    types (HuggingFaceDatasetInitializer, S3DatasetInitializer,
    DataCacheInitializer, HuggingFaceModelInitializer, S3ModelInitializer),
    combined usage, ContainerBackendConfig image/timeout options, and debugging
    via get_job_logs()
  • Add autoclass entries for all 6 exported initializer types in docs/source/train/api.rst
  • Add grid card linking to the new page in docs/source/train/index.rst
  • Add train/initializers to the Trainer toctree in docs/source/index.rst

Which issue(s) this PR fixes (optional, in Fixes #<issue number>, #<issue number>, ... format, will close the issue(s) when PR gets merged):

Fixes #413

Checklist:

  • Docs included if any changes are user facing

Copilot AI review requested due to automatic review settings March 21, 2026 22:21
@github-actions

Copy link
Copy Markdown
Contributor

🎉 Welcome to the Kubeflow SDK! 🎉

Thanks for opening your first PR! We're happy to have you as part of our community 🚀

Here's what happens next:

  • If you haven't already, please check out our Contributing Guide for repo-specific guidelines and the Kubeflow Contributor Guide for general community standards
  • Our team will review your PR soon! cc @kubeflow/kubeflow-sdk-team

Join the community:

Feel free to ask questions in the comments if you need any help or clarification!
Thanks again for contributing to Kubeflow! 🙏

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.

Pull request overview

Adds end-user documentation for Kubeflow Trainer “initializers” (dataset/model prefetch steps) and links it into the training docs and API reference to address #413.

Changes:

  • Adds a new “Data and Model Initializers” guide page with examples and container-backend configuration/debugging.
  • Extends the Trainer API reference to include initializer classes.
  • Links the new guide from the training landing page and the main docs toctree.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
docs/source/train/initializers.rst New guide explaining how to use dataset/model initializers, config knobs, and log debugging.
docs/source/train/index.rst Adds a grid card linking to the new initializers guide.
docs/source/train/api.rst Adds autoclass entries for initializer-related types in the API reference.
docs/source/index.rst Adds the new initializers page to the main Trainer toctree.

Comment thread docs/source/train/initializers.rst
Comment thread docs/source/train/initializers.rst Outdated
Comment thread docs/source/train/initializers.rst Outdated
@1Ayush-Petwal 1Ayush-Petwal force-pushed the docs/initializers-guide branch from 49f82b1 to 0abd70e Compare March 21, 2026 22:26
@1Ayush-Petwal 1Ayush-Petwal changed the title docs(trainer): add data and model initializers guide chore(trainer): add data and model initializers guide Mar 21, 2026
@1Ayush-Petwal 1Ayush-Petwal force-pushed the docs/initializers-guide branch 2 times, most recently from 921027e to f82ac9b Compare March 28, 2026 22:12
@Fiona-Waters

Copy link
Copy Markdown
Contributor

/ok-to-test

@Fiona-Waters

Copy link
Copy Markdown
Contributor

/retest

@Fiona-Waters Fiona-Waters 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.

Thanks @1Ayush-Petwal just one small question, otherwise lgtm

Comment thread docs/source/train/initializers.rst Outdated
from kubeflow.trainer.backends.container.types import ContainerBackendConfig

client = TrainerClient(backend_config=ContainerBackendConfig(
dataset_initializer_image="ghcr.io/kubeflow/trainer/dataset-initializer:v0.4.0",

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.

We could use latest here for both images, what do you think?

Suggested change
dataset_initializer_image="ghcr.io/kubeflow/trainer/dataset-initializer:v0.4.0",
dataset_initializer_image="ghcr.io/kubeflow/trainer/dataset-initializer:latest",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, that is better for the docs. I also updated the model_initializer_image to use latest.

Add docs/source/train/initializers.rst covering dataset and model
initializers for the container backend (added in kubeflow#188, parallelised
in kubeflow#313). Includes per-type code examples, combined usage, ContainerBackendConfig
options, and debugging via get_job_logs().

Signed-off-by: Ayush Petwal <[email protected]>
- Fix model output path from /workspace/model-weights to /workspace/model
  to match the MODEL_PATH constant in constants.py
- Clarify DataCacheInitializer is Kubernetes-only in the backend note
  and annotate the Available Initializers table row accordingly
- Add DataCacheInitializer usage example with required fields
  (storage_uri, metadata_loc, num_data_nodes) and backend constraint note

Signed-off-by: 1Ayush-Petwal <[email protected]>
@1Ayush-Petwal 1Ayush-Petwal force-pushed the docs/initializers-guide branch from f82ac9b to a6e9430 Compare April 10, 2026 13:20

@andreyvelich andreyvelich left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @1Ayush-Petwal!
/lgtm
/approve
/hold in case @Fiona-Waters has additional comments.

@google-oss-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andreyvelich

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

The pull request process is described 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

@Fiona-Waters

Copy link
Copy Markdown
Contributor

Nothing additional from my side. Thanks @1Ayush-Petwal
/unhold

@google-oss-prow google-oss-prow Bot merged commit 5001734 into kubeflow:main Apr 10, 2026
17 of 19 checks passed
@google-oss-prow google-oss-prow Bot added this to the v0.5 milestone Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document data and model initializers

4 participants