Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions xla/python/pjrt_ifrt/basic_string_array_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ TEST(MakeArrayFromHostBufferTest, SuccessCase) {
TF_ASSERT_OK(client->MakeArrayFromHostBuffer(
data, DType(DType::kString), shape,
/*byte_strides=*/std::nullopt, std::move(sharding),
Client::HostBufferSemantics::kImmutableOnlyDuringCall,
/*layout=*/nullptr, Client::HostBufferSemantics::kImmutableOnlyDuringCall,
std::move(on_done_with_host_buffer)));
}

Expand All @@ -317,6 +317,7 @@ TEST(MakeArrayFromHostBufferTest, FailureCases) {
data, DType(DType::kString), shape,
/*byte_strides=*/std::optional<absl::Span<const int64_t>>({8}),
single_device_sharding,
/*layout=*/nullptr,
Client::HostBufferSemantics::kImmutableOnlyDuringCall,
on_done_with_host_buffer),
absl_testing::StatusIs(absl::StatusCode::kInvalidArgument));
Expand All @@ -330,6 +331,7 @@ TEST(MakeArrayFromHostBufferTest, FailureCases) {
EXPECT_THAT(client->MakeArrayFromHostBuffer(
data, DType(DType::kString), shape,
/*byte_strides=*/std::nullopt, opaque_sharding,
/*layout=*/nullptr,
Client::HostBufferSemantics::kImmutableOnlyDuringCall,
on_done_with_host_buffer),
absl_testing::StatusIs(absl::StatusCode::kInvalidArgument));
Expand All @@ -344,7 +346,8 @@ TEST(MakeArrayFromHostBufferTest, FailureCases) {
EXPECT_THAT(client->MakeArrayFromHostBuffer(
data, DType(DType::kString), shape,
/*byte_strides=*/std::nullopt, single_device_sharding,
host_buffer_semantics, on_done_with_host_buffer),
/*layout=*/nullptr, host_buffer_semantics,
on_done_with_host_buffer),
absl_testing::StatusIs(absl::StatusCode::kInvalidArgument));
}
}
Expand All @@ -367,7 +370,7 @@ absl::StatusOr<ArrayRef> MakeSingleDeviceStringTestArray(
return client->MakeArrayFromHostBuffer(
data, DType(DType::kString), shape,
/*byte_strides=*/std::nullopt, std::move(sharding),
Client::HostBufferSemantics::kImmutableOnlyDuringCall,
/*layout=*/nullptr, Client::HostBufferSemantics::kImmutableOnlyDuringCall,
std::move(on_done_with_host_buffer));
}

Expand All @@ -384,7 +387,7 @@ absl::StatusOr<ArrayRef> MakeSingleDeviceFloatTestArray(Client* client,
return client->MakeArrayFromHostBuffer(
data->data(), dtype, shape,
/*byte_strides=*/std::nullopt, sharding,
Client::HostBufferSemantics::kImmutableOnlyDuringCall,
/*layout=*/nullptr, Client::HostBufferSemantics::kImmutableOnlyDuringCall,
/*on_done_with_host_buffer=*/nullptr);
}

Expand Down
7 changes: 7 additions & 0 deletions xla/python/pjrt_ifrt/xla_executable_impl_test_lib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ TEST_P(LoadedExecutableImplTest, CompileAndExecute) {
auto array, client->MakeArrayFromHostBuffer(
data.data(), dtype, shape,
/*byte_strides=*/std::nullopt, sharding,
/*layout=*/nullptr,
Client::HostBufferSemantics::kImmutableOnlyDuringCall,
/*on_done_with_host_buffer=*/{}));

Expand Down Expand Up @@ -475,6 +476,7 @@ TEST_P(LoadedExecutableImplTest, CancelExecution) {
auto array, client->MakeArrayFromHostBuffer(
data.data(), dtype, shape,
/*byte_strides=*/std::nullopt, sharding,
/*layout=*/nullptr,
Client::HostBufferSemantics::kImmutableOnlyDuringCall,
/*on_done_with_host_buffer=*/{}));

Expand Down Expand Up @@ -530,6 +532,7 @@ TEST_P(LoadedExecutableImplTest, DoNotFillStatus) {
auto array, client->MakeArrayFromHostBuffer(
data.data(), dtype, shape,
/*byte_strides=*/std::nullopt, sharding,
/*layout=*/nullptr,
Client::HostBufferSemantics::kImmutableOnlyDuringCall,
/*on_done_with_host_buffer=*/{}));

Expand Down Expand Up @@ -620,6 +623,7 @@ module @add_sub {
client->MakeArrayFromHostBuffer(
data.data(), DType(DType::kS32), Shape({2, 3}),
/*byte_strides=*/std::nullopt, sharding,
/*layout=*/nullptr,
Client::HostBufferSemantics::kImmutableOnlyDuringCall,
/*on_done_with_host_buffer=*/{}));
}
Expand Down Expand Up @@ -910,13 +914,15 @@ TEST(ExecutableTest, ExecutableSerialization) {
client->MakeArrayFromHostBuffer(
data.data(), dtype, shard_shape,
/*byte_strides=*/std::nullopt, shard_sharding0,
/*layout=*/nullptr,
xla::ifrt::Client::HostBufferSemantics::kImmutableOnlyDuringCall,
/*on_done_with_host_buffer=*/{}));
TF_ASSERT_OK_AND_ASSIGN(
auto array_shard1,
client->MakeArrayFromHostBuffer(
data.data() + 3, dtype, shard_shape,
/*byte_strides=*/std::nullopt, shard_sharding1,
/*layout=*/nullptr,
xla::ifrt::Client::HostBufferSemantics::kImmutableOnlyDuringCall,
/*on_done_with_host_buffer=*/{}));
std::vector<xla::ifrt::ArrayRef> shards = {array_shard0, array_shard1};
Expand All @@ -937,6 +943,7 @@ TEST(ExecutableTest, ExecutableSerialization) {
client->MakeArrayFromHostBuffer(
data.data(), dtype, shape,
/*byte_strides=*/std::nullopt, input2_sharding,
/*layout=*/nullptr,
xla::ifrt::Client::HostBufferSemantics::kImmutableOnlyDuringCall,
/*on_done_with_host_buffer=*/nullptr));

Expand Down
Loading