Skip to content

Commit 45d15fb

Browse files
GleasonKtensorflower-gardener
authored andcommitted
Temporarily remove stablehlo_current_version from PJRT_GetPluginCAttributes.
This can be added back once frameworks release with the fix in: openxla/xla@2f99455 Until then, a plugin that is newer than its framework will error on serialization. PiperOrigin-RevId: 689524205
1 parent 86fb750 commit 45d15fb

File tree

4 files changed

+25
-16
lines changed

4 files changed

+25
-16
lines changed

third_party/xla/xla/pjrt/c/pjrt_c_api_helpers.cc

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -634,14 +634,16 @@ static PJRT_NamedValue StableHloVersion(absl::string_view name,
634634
}
635635

636636
const std::vector<PJRT_NamedValue>& GetXlaPluginCAttributes() {
637-
static const std::vector<PJRT_NamedValue>* c_values =
638-
new std::vector<PJRT_NamedValue>({
639-
XlaVersion("xla_version"),
640-
StableHloVersion<0>("stablehlo_current_version",
641-
mlir::vhlo::Version::getCurrentVersion()),
642-
StableHloVersion<1>("stablehlo_minimum_version",
643-
mlir::vhlo::Version::getMinimumVersion()),
644-
});
637+
static const std::vector<PJRT_NamedValue>* c_values = new std::vector<
638+
PJRT_NamedValue>({
639+
XlaVersion("xla_version"),
640+
// TODO: (b/375454646) Uncomment once frameworks have bugfix:
641+
// https://github.com/openxla/xla/commit/2f99455cdf99e844ddad17de9f4714997023d243
642+
// StableHloVersion<0>("stablehlo_current_version",
643+
// mlir::vhlo::Version::getCurrentVersion()),
644+
StableHloVersion<1>("stablehlo_minimum_version",
645+
mlir::vhlo::Version::getMinimumVersion()),
646+
});
645647
return *c_values;
646648
}
647649

third_party/xla/xla/pjrt/c/pjrt_c_api_helpers_test.cc

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,15 @@ TEST(PjRtCApiHelperTest, GetXlaPluginCAttributes) {
213213
EXPECT_TRUE(did_not_exist_yet);
214214
}
215215
EXPECT_TRUE(map.find("xla_version") != map.end());
216-
PJRT_NamedValue *current = map["stablehlo_current_version"];
217-
mlir::vhlo::Version current_version =
218-
mlir::vhlo::Version::getCurrentVersion();
219-
EXPECT_TRUE(current->int64_array_value[0] == current_version.getMajor());
220-
EXPECT_TRUE(current->int64_array_value[1] == current_version.getMinor());
221-
EXPECT_TRUE(current->int64_array_value[2] == current_version.getPatch());
216+
// TODO: (b/375454646) Uncomment once frameworks have bugfix:
217+
// https://github.com/openxla/xla/commit/2f99455cdf99e844ddad17de9f4714997023d243
218+
//
219+
// PJRT_NamedValue *current = map["stablehlo_current_version"];
220+
// mlir::vhlo::Version current_version =
221+
// mlir::vhlo::Version::getCurrentVersion();
222+
// EXPECT_TRUE(current->int64_array_value[0] == current_version.getMajor());
223+
// EXPECT_TRUE(current->int64_array_value[1] == current_version.getMinor());
224+
// EXPECT_TRUE(current->int64_array_value[2] == current_version.getPatch());
222225
PJRT_NamedValue *minimum = map["stablehlo_minimum_version"];
223226
mlir::vhlo::Version minimum_version =
224227
mlir::vhlo::Version::getMinimumVersion();

third_party/xla/xla/pjrt/c/pjrt_c_api_test.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,9 @@ TEST_F(PjrtCApiTest, PluginAttributes) {
495495
EXPECT_TRUE(did_not_exist_yet);
496496
}
497497
EXPECT_TRUE(names.find("xla_version") != names.end());
498-
EXPECT_TRUE(names.find("stablehlo_current_version") != names.end());
498+
// TODO: (b/375454646) Uncomment once frameworks have bugfix:
499+
// https://github.com/openxla/xla/commit/2f99455cdf99e844ddad17de9f4714997023d243
500+
// EXPECT_TRUE(names.find("stablehlo_current_version") != names.end());
499501
EXPECT_TRUE(names.find("stablehlo_minimum_version") != names.end());
500502
}
501503

third_party/xla/xla/pjrt/pjrt_c_api_client_test.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ TEST(PjRtClientTest, CreateViewAndCopyToDeviceAsyncExternalCpuOnly) {
170170
*literal));
171171
}
172172

173-
TEST(PjRtClientTest, CompileUsesStableHloVersion) {
173+
// TODO: (b/375454646) Eanble once frameworks have bugfix:
174+
// https://github.com/openxla/xla/commit/2f99455cdf99e844ddad17de9f4714997023d243
175+
TEST(PjRtClientTest, DISABLED_CompileUsesStableHloVersion) {
174176
SetUpCpuPjRtApi();
175177
TF_ASSERT_OK_AND_ASSIGN(const PJRT_Api* c_api, pjrt::PjrtApi("cpu"));
176178
TF_ASSERT_OK_AND_ASSIGN(std::unique_ptr<PjRtClient> client,

0 commit comments

Comments
 (0)