Skip to content

Error Handling: refactor the PjRt registry to use status QOL functions.#9419

Merged
ysiraichi merged 2 commits intomasterfrom
ysiraichi/status-for-pjrt-registry
Jul 10, 2025
Merged

Error Handling: refactor the PjRt registry to use status QOL functions.#9419
ysiraichi merged 2 commits intomasterfrom
ysiraichi/status-for-pjrt-registry

Conversation

@ysiraichi
Copy link
Copy Markdown
Collaborator

@ysiraichi ysiraichi commented Jun 27, 2025

This PR replaces the existing XLA_CHECK* macros with XLA_ASSIGN_OR_RETURN and XLA_RETURN_IF_ERROR for improved error handling within the PyTorch/XLA codebase. Specifically, the InitializePjRt() function has been updated to return StatusOr<T>.

@ysiraichi

This comment was marked as outdated.

@ysiraichi ysiraichi force-pushed the ysiraichi/status-for-pjrt-registry branch 5 times, most recently from 9ebf41c to 8499caf Compare July 1, 2025 18:14
@ysiraichi ysiraichi changed the base branch from ysiraichi/status-qol-functions to master July 1, 2025 18:15
@ysiraichi ysiraichi marked this pull request as ready for review July 1, 2025 18:20
Copy link
Copy Markdown
Collaborator

@zhanyong-wan zhanyong-wan left a comment

Choose a reason for hiding this comment

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

Thanks!

@ysiraichi ysiraichi force-pushed the ysiraichi/status-for-pjrt-registry branch from a4b9bd4 to c0e7506 Compare July 2, 2025 18:26
@ysiraichi
Copy link
Copy Markdown
Collaborator Author

These CI failures seem to be coming from #9427.
@zhanyong-wan Is it okay to merge it like this?

@zhanyong-wan
Copy link
Copy Markdown
Collaborator

These CI failures seem to be coming from #9427. @zhanyong-wan Is it okay to merge it like this?

The CI should be fixed now. Could you rerun the checks and merge?

@ysiraichi ysiraichi force-pushed the ysiraichi/status-for-pjrt-registry branch from c0e7506 to 1f0dca3 Compare July 8, 2025 12:24
@ysiraichi
Copy link
Copy Markdown
Collaborator Author

I tried rerunning the CI, but the failures are still there. master branch also seems to be failing on these jobs.

@zhanyong-wan
Copy link
Copy Markdown
Collaborator

@bhavya01 , is this related to the fix you are working on?

Replace `XLA_CHECK` macros with `XLA_ASSIGN_OR_RETURN` and
`XLA_RETURN_IF_ERROR` for better error handling:
- `InitializePjRt()` now returns `StatusOr<T>` instead of throwing on
errors
- Enhanced error messages with location context
- Consistent error handling across all device types
@ysiraichi ysiraichi force-pushed the ysiraichi/status-for-pjrt-registry branch from c4595dc to 3c1289f Compare July 10, 2025 12:06
@ysiraichi ysiraichi merged commit 1d848e7 into master Jul 10, 2025
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants