Skip to content

Error Handling: return status value when loading PjRt dynamic plugin.#9495

Merged
ysiraichi merged 1 commit intomasterfrom
ysiraichi/pjrt-registry-return-status
Jul 28, 2025
Merged

Error Handling: return status value when loading PjRt dynamic plugin.#9495
ysiraichi merged 1 commit intomasterfrom
ysiraichi/pjrt-registry-return-status

Conversation

@ysiraichi
Copy link
Copy Markdown
Collaborator

This PR improves error handling for PjRtPlugin and ComputationClient initialization. It provides better error messages and prevents repeated error reporting. A new test has been added for dynamic PjRtPlugin registration error.

Key Changes

  • GetPjRtPlugin() function returns a FailedPreconditionError() if no PjRtPlugin was registered to the current PJRT_DEVICE with a better error message
  • g_computation_client_initialized variable is only set if the ComputationClient is successfully initialized
    • Avoids showing the same error on _XLAC._prepare_to_exit() function
  • Unwrapping the StatusOr<T> value in GetComputationClientOrDie() function by using GetValueOrThrow() function, instead of .value()
  • Added test for checking the computation client initialization error due to unregistered dynamic PjRtPlugin

@ysiraichi ysiraichi force-pushed the ysiraichi/pjrt-registry-return-status branch from b11ece5 to 05ebba9 Compare July 21, 2025 17:44
Comment thread test/test_runtime_client_initialization_error.py
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!

Comment thread torch_xla/csrc/runtime/runtime.cpp
@ysiraichi ysiraichi requested a review from zhanyong-wan July 22, 2025 14:26
@ysiraichi ysiraichi merged commit 2820f7c into master Jul 28, 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.

3 participants