Conversation
This comment was marked as outdated.
This comment was marked as outdated.
9d505e7 to
5d4742b
Compare
247fdf5 to
b390a61
Compare
5d4742b to
40a75d7
Compare
b390a61 to
821c384
Compare
b0e25da to
97ef4c1
Compare
821c384 to
08c5ecd
Compare
97ef4c1 to
de09876
Compare
34abde6 to
103cd0f
Compare
de09876 to
bfeb70a
Compare
bfeb70a to
f64ae9e
Compare
qihqi
approved these changes
Jul 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR refactors our error handling by replacing
GetValueOrThrowwith proper status propagation usingabsl::StatusOr<T>andXLA_ASSIGN_OR_RETURNmacros.Key Changes:
ReleaseGilAndTransferDataFunction:absl::StatusOr<std::vector<xla::Literal>>.GetComputationClientOrDie()withGetComputationClient().XLA_ASSIGN_OR_RETURNfor client acquisition andTransferFromDevicecalls.tensor_util.cppandxla_graph_executor.cppto handle the newStatusOr<T>return type.XlaDataToTensorsFunction:absl::StatusOr<std::vector<at::Tensor>>.GetValueOrThrowwithXLA_ASSIGN_OR_RETURNfor theReleaseGilAndTransferDatacall.XLATensor::ToTensor,test_xla_sharding.cpp,init_python_bindings.cpp, andxla_backend_impl.cpp) to correctly handle theStatusOr<T>return type.status.hincludes toxla_backend_impl.cppandtest_xla_sharding.cpp.These modifications align with existing status propagation patterns in the codebase, as seen in
pjrt_registry.cpp, and maintain API-level backward compatibility while improving internal error handling within the tensor conversion pipeline.