diff --git a/third_party/xla/xla/pjrt/c/CHANGELOG.md b/third_party/xla/xla/pjrt/c/CHANGELOG.md index d373b22b73e581..20b660ed6eecfd 100644 --- a/third_party/xla/xla/pjrt/c/CHANGELOG.md +++ b/third_party/xla/xla/pjrt/c/CHANGELOG.md @@ -1,11 +1,5 @@ # PJRT C API changelog -## 0.56 - -* Added `overridden_serialized_compile_options` and - `overridden_serialized_compile_options_size` fields to - `PJRT_Executable_DeserializeAndLoad_Args`. - ## 0.55 * Added types F8E4M3 and F8E3M4. diff --git a/third_party/xla/xla/pjrt/c/pjrt_c_api.h b/third_party/xla/xla/pjrt/c/pjrt_c_api.h index 9afa95362ce800..a96f35920b9fa1 100644 --- a/third_party/xla/xla/pjrt/c/pjrt_c_api.h +++ b/third_party/xla/xla/pjrt/c/pjrt_c_api.h @@ -79,7 +79,7 @@ PJRT_DEFINE_STRUCT_TRAITS(PJRT_Extension_Base, next); // Changes include: // * Adding a new field to the PJRT_Api or argument structs // * Renaming a method or argument (doesn't affect ABI) -#define PJRT_API_MINOR 56 +#define PJRT_API_MINOR 55 // The plugin should set the major_version and minor_version of // PJRT_Api.pjrt_api_version to be the `PJRT_API_MAJOR` and `PJRT_API_MINOR` in @@ -1577,11 +1577,6 @@ struct PJRT_Executable_DeserializeAndLoad_Args { const char* serialized_executable; size_t serialized_executable_size; PJRT_LoadedExecutable* loaded_executable; // out - // Serialized CompileOptionsProto or null (to use the options - // from the serialized executable). - // (https://github.com/openxla/xla/blob/main/xla/pjrt/compile_options.proto) - const char* overridden_serialized_compile_options; - size_t overridden_serialized_compile_options_size; }; PJRT_DEFINE_STRUCT_TRAITS(PJRT_Executable_DeserializeAndLoad_Args, loaded_executable); diff --git a/third_party/xla/xla/pjrt/c/pjrt_c_api_wrapper_impl.cc b/third_party/xla/xla/pjrt/c/pjrt_c_api_wrapper_impl.cc index f6f3b5f7e99d11..adb276af46a126 100644 --- a/third_party/xla/xla/pjrt/c/pjrt_c_api_wrapper_impl.cc +++ b/third_party/xla/xla/pjrt/c/pjrt_c_api_wrapper_impl.cc @@ -1570,20 +1570,9 @@ PJRT_Error* PJRT_Executable_DeserializeAndLoad( absl::string_view serialized(args->serialized_executable, args->serialized_executable_size); - std::optional overriden_options; - - if (args->overridden_serialized_compile_options && - args->overridden_serialized_compile_options_size > 0) { - PJRT_ASSIGN_OR_RETURN( - overriden_options, - ParseCompileOptions(absl::string_view( - args->overridden_serialized_compile_options, - args->overridden_serialized_compile_options_size))); - } - PJRT_ASSIGN_OR_RETURN(std::unique_ptr executable, args->client->client->DeserializeExecutable( - serialized, overriden_options)); + serialized, /*options=*/std::nullopt)); args->loaded_executable = new PJRT_LoadedExecutable(std::move(executable), args->client); diff --git a/third_party/xla/xla/pjrt/pjrt_c_api_client.cc b/third_party/xla/xla/pjrt/pjrt_c_api_client.cc index 3f08eba17e8567..e6cf911d7b7a04 100644 --- a/third_party/xla/xla/pjrt/pjrt_c_api_client.cc +++ b/third_party/xla/xla/pjrt/pjrt_c_api_client.cc @@ -422,17 +422,6 @@ PjRtCApiClient::DeserializeExecutable(absl::string_view serialized, des_args.client = c_client_.get(); des_args.serialized_executable = serialized.data(); des_args.serialized_executable_size = serialized.length(); - des_args.overridden_serialized_compile_options = nullptr; - des_args.overridden_serialized_compile_options_size = 0; - - std::string options_str; - if (options) { - TF_ASSIGN_OR_RETURN(const CompileOptionsProto options_proto, - options->ToProto()); - options_str = options_proto.SerializeAsString(); - des_args.overridden_serialized_compile_options = options_str.c_str(); - des_args.overridden_serialized_compile_options_size = options_str.size(); - } const PJRT_Api* api = pjrt_c_api(); diff --git a/third_party/xla/xla/pjrt/pjrt_c_api_client_test.cc b/third_party/xla/xla/pjrt/pjrt_c_api_client_test.cc index 1dc1a735d9cb1b..a344443de33b10 100644 --- a/third_party/xla/xla/pjrt/pjrt_c_api_client_test.cc +++ b/third_party/xla/xla/pjrt/pjrt_c_api_client_test.cc @@ -199,42 +199,5 @@ TEST(PjRtClientTest, CompileUsesStableHloVersion) { const_cast(c_api)->PJRT_Client_Compile = PJRT_Client_Compile_Orig; } -TEST(PjRtClientTest, DeserializeExecutableWithDifferentDeviceAssignment) { - SetUpCpuPjRtApi(); - TF_ASSERT_OK_AND_ASSIGN(std::unique_ptr client, - GetCApiClient("cpu")); - ASSERT_GT(client->addressable_devices().size(), 1); - - XlaBuilder builder("Identity"); - Shape shape = ShapeUtil::MakeShape(S32, {2, 3}); - auto input = Parameter(&builder, 0, shape, "input"); - auto computation = builder.Build(input).value(); - - auto compile_options_for_device = [](int id) -> xla::CompileOptions { - xla::DeviceAssignment device_assignment(1, 1); - device_assignment(0, 0) = id; - xla::CompileOptions options; - options.executable_build_options.set_device_assignment(device_assignment); - return options; - }; - - // Compile the executable for device 0 and serialize it. - std::unique_ptr executable = - client->Compile(computation, compile_options_for_device(0)).value(); - TF_ASSERT_OK_AND_ASSIGN(std::string serialized_executable, - executable->SerializeExecutable()); - - // Deserialize the executable for device 1. - TF_ASSERT_OK_AND_ASSIGN( - auto deserialized_executable, - client->DeserializeExecutable(serialized_executable, - compile_options_for_device(1))); - - // Check that the executable's compile options were overridden - // with device id 1. - EXPECT_EQ( - deserialized_executable->addressable_devices()[0]->global_device_id(), 1); -} - } // namespace } // namespace xla diff --git a/third_party/xla/xla/pjrt/pjrt_client.h b/third_party/xla/xla/pjrt/pjrt_client.h index ddcfe417e0c6db..c5bc2e955874f5 100644 --- a/third_party/xla/xla/pjrt/pjrt_client.h +++ b/third_party/xla/xla/pjrt/pjrt_client.h @@ -612,9 +612,6 @@ class PjRtClient { // Pending completion of b/237720161, `options` is a mandatory argument in // most implementations of this interface. They _are_ optional for // implementations related to the PJRT C API. - // - // If `options` are provided, then they override the compile options - // from the serialized executable (`serialized`). virtual absl::StatusOr> DeserializeExecutable(absl::string_view serialized, std::optional options) {