Skip to content

docs: add usage documentation for TrainerClient options#405

Open
Harshithavigna wants to merge 1 commit intokubeflow:mainfrom
Harshithavigna:docs-trainer-options
Open

docs: add usage documentation for TrainerClient options#405
Harshithavigna wants to merge 1 commit intokubeflow:mainfrom
Harshithavigna:docs-trainer-options

Conversation

@Harshithavigna
Copy link
Copy Markdown

What this PR does / why we need it:
This PR adds documentation for using options in TrainerClient.
It includes example usage and improves clarity for users working with training configurations.

Which issue(s) this PR fixes:
Fixes #388

Checklist:

  • Docs included (this PR adds documentation)

Copilot AI review requested due to automatic review settings March 20, 2026 07:09
@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 electronic-waste 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

@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! 🙏

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds documentation explaining how to use the options parameter with TrainerClient.train() to customize training job configurations. It includes an explanation of the feature and provides a usage example to help users understand backend-specific configuration options.

Changes:

  • Adds a new section "Using options with TrainerClient" in the options reference documentation
  • Provides an explanation of the options parameter and its purpose
  • Includes a code example demonstrating how to pass options to client.train()

Comment on lines +85 to +91
job_id = client.train(
trainer=CustomTrainer(func=train_fn),
options={
"epochs": 10,
"batch_size": 32
}
)
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

The example shows options as a dictionary with {"epochs": 10, "batch_size": 32}, but the options parameter should be a list of option objects (e.g., [Name("custom-name"), Labels({...})]). According to the TrainerClient API signature and the options module design, options must be objects from kubeflow.trainer.options that can be called to modify the job specification. The current example misleads users about the correct API usage.

Copilot uses AI. Check for mistakes.
Comment on lines +95 to +96
The ``options`` dictionary can include different parameters depending on the backend
and runtime configuration. No newline at end of file
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

The description states "options dictionary" and refers to "different parameters depending on the backend", but it should clarify that options is a list of option objects, and which specific option types are available for each backend (e.g., Name, Labels, Annotations, TrainerCommand, TrainerArgs for Kubernetes, and Name for other backends).

Copilot uses AI. Check for mistakes.
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.

Document how to use options with TrainerClient

2 participants