Skip to content

feat(trainer): improve DX for LocalProcessBackend missing runtime error#424

Open
zannensk wants to merge 1 commit intokubeflow:mainfrom
zannensk:dx/improve-local-backend-error
Open

feat(trainer): improve DX for LocalProcessBackend missing runtime error#424
zannensk wants to merge 1 commit intokubeflow:mainfrom
zannensk:dx/improve-local-backend-error

Conversation

@zannensk
Copy link
Copy Markdown

What this PR does / why we need it:
While exploring the LocalProcessBackend as part of my GSoC proposal preparation, I noticed that the error message when a runtime is missing is quite opaque (ValueError: Runtime must be provided).

This PR improves the Developer Experience (DX) by dynamically listing the available runtimes (e.g., 'torch-distributed') within the error message. This helps newcomers quickly identify the correct runtime string without deep-diving into the source code.

Checklist:

  • [Docs] included if any changes are user facing (Updated the error message itself)
  • I have run make verify and it passed.
  • I have run make test-python and all tests passed.

…essBackend

Signed-off-by: Zannensk <sqwerd1989@gmail.com>
Copilot AI review requested due to automatic review settings March 25, 2026 09:56
@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 andreyvelich 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

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

Improves the LocalProcessBackend developer experience by enhancing the “missing runtime” error to include a dynamically generated list of available runtime names, and updates the corresponding unit test expectation.

Changes:

  • Extend the LocalProcessBackend.train() ValueError message to list available runtimes when runtime is None.
  • Update backend_test.py to assert the new, more informative error message prefix.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
kubeflow/trainer/backends/localprocess/backend.py Adds available runtime names to the “runtime missing” exception message in train().
kubeflow/trainer/backends/localprocess/backend_test.py Updates the failing-case assertion to match the new error message prefix.

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.

2 participants