Skip to content

fix(core): move log failure patterns to a shared module - #157

Open
Krishna-kg732 wants to merge 2 commits into
kubeflow:mainfrom
Krishna-kg732:refactor/common-failure-patterns
Open

fix(core): move log failure patterns to a shared module#157
Krishna-kg732 wants to merge 2 commits into
kubeflow:mainfrom
Krishna-kg732:refactor/common-failure-patterns

Conversation

@Krishna-kg732

Copy link
Copy Markdown
Member

Description

Moves the training-log failure pattern table and its matcher out of
trainer/api/monitoring.py into a new common/failures.py.

  • Pure code move, no behavior change
  • Katib trials run as TrainJobs, so the optimizer client (KEP-34) classifies the same failure signatures
  • Leaving the table in the trainer module would force one client module to import another's private helper, breaking module independence
  • Existing trainer tests are repointed to the new location; no test logic changed

This is groundwork split out of the optimizer client work so it can be reviewed
and merged on its own.

Related Issue

Groundwork for KEP-34 (Katib optimizer client). No separate issue.

Checklist

  • I have read the CONTRIBUTING guide
  • Tests pass locally (make test-python)
  • Linting passes (make verify)
  • Documentation updated (if applicable)
  • My commits are signed off (git commit -s)

Testing

  • Unit tests
  • Integration tests
  • E2E tests
  • Manually tested

Full suite green on this branch (472 passed, 14 deselected). The moved
FAILURE_PATTERNS and extract_failure_hint keep their existing coverage in
trainer/api/monitoring_test.py and trainer/api/sdk_contracts_test.py,
including the HF_CACHE_WRITE_ERROR ordering case.

Copilot AI balanced review requested due to automatic review settings August 11, 2026 22:05
@google-oss-prow
google-oss-prow Bot requested review from jaiakash and szaher August 11, 2026 22:05
@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

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 Krishna-kg732 changed the title refactor(common): move log failure patterns to a shared module fix(core): move log failure patterns to a shared module Aug 11, 2026
@Krishna-kg732

Copy link
Copy Markdown
Member Author

cc : @abhijeet-dhumal , @jaiakash



def test_extract_failure_hint_openshift_pip_error():
def testextract_failure_hint_openshift_pip_error():

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.

Suggested change
def testextract_failure_hint_openshift_pip_error():
def test_extract_failure_hint_openshift_pip_error():



def test_extract_failure_hint_generic_permission_error():
def testextract_failure_hint_generic_permission_error():

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.

Suggested change
def testextract_failure_hint_generic_permission_error():
def test_extract_failure_hint_generic_permission_error():


def test_extract_failure_hint_suggestion_text():
cuda = _extract_failure_hint("RuntimeError: CUDA error: device-side assert triggered")
def testextract_failure_hint_suggestion_text():

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.

Suggested change
def testextract_failure_hint_suggestion_text():
def test_extract_failure_hint_suggestion_text():

@abhijeet-dhumal

Copy link
Copy Markdown
Member

Thanks @Krishna-kg732, Yeah this totally makes sense !
One nit highlighted above.. otherwise LGTM!

@abhijeet-dhumal

Copy link
Copy Markdown
Member

@Krishna-kg732 are you still working on this ? This PR needs to be rebased on main!

Signed-off-by: krishna-kg732 <krishnagupta.kg2k6@gmail.com>
Signed-off-by: krishna-kg732 <krishnagupta.kg2k6@gmail.com>
@Krishna-kg732
Krishna-kg732 force-pushed the refactor/common-failure-patterns branch from 3eb40f8 to 86cdcf0 Compare September 2, 2026 15:51
@Krishna-kg732

Copy link
Copy Markdown
Member Author

done 🫡

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