Skip to content

Add WITH_LOCATION macros for propagating external library errors. #9441

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

Draft
wants to merge 4 commits into
base: ysiraichi/fix-status-location-logic
Choose a base branch
from

Conversation

ysiraichi
Copy link
Collaborator

This PR enhances PyTorch/XLA's error handling and status management, specifically for interactions with external libraries. In summary, this PR:

  • Introcudes XLA_RETURN_IF_ERROR_WITH_LOCATION and XLA_ASSIGN_OR_RETURN_WITH_LOCATION: new macros designed to propagate statuses from external library calls, including the exact source code location where the call to the library function that returned an error.
  • Adds test coverage: new test cases have been added to validate the behavior of these location-specific macro variants.

These updates should improve our ability to track and debug issues originating from external library.

@ysiraichi
Copy link
Collaborator Author

Blocked until #9440 is merged.

ysiraichi added 3 commits July 2, 2025 15:27
- Refactor status tests
- Remove test_status.cpp as its tests are now covered by specialized context tests
- Both specialized tests now cover all status utility functions and macros
@ysiraichi ysiraichi force-pushed the ysiraichi/fix-status-location-logic branch from 0427c0a to d6ba41f Compare July 2, 2025 18:27
- Add `XLA_RETURN_IF_ERROR_WITH_LOCATION` macro for external library status propagation
- Add `XLA_ASSIGN_OR_RETURN_WITH_LOCATION` macro for external library status handling
- Enhance test coverage with new test cases for location-specific macro variants
- Improve macro documentation to clarify internal vs external usage patterns
@ysiraichi ysiraichi force-pushed the ysiraichi/add-status-propagation-for-external-libs branch from 540d62e to 487988e Compare July 2, 2025 18:28
@ysiraichi ysiraichi force-pushed the ysiraichi/fix-status-location-logic branch from 22a420a to 0242960 Compare July 9, 2025 20:31
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.

1 participant