Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ysiraichi
Copy link
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
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 added 2 commits July 2, 2025 15:26
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 a4b9bd4 to c0e7506 Compare July 2, 2025 18:26
@ysiraichi
Copy link
Collaborator Author

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

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