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
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ TEST(BarrierProxyTest, AgentErrorBroadcastedToAllThreads) {
/*num_threads_planned=*/8,
/*num_threads_entered=*/8,
/*expected_ok_count=*/0,
/*agent_wait_status=*/errors::Internal(""),
/*expected_same_exit_status_for_all_threads=*/errors::Internal(""));
/*agent_wait_status=*/absl::InternalError(""),
/*expected_same_exit_status_for_all_threads=*/absl::InternalError(""));
}

TEST(BarrierProxyTest, AgentIsIgnoredIfThereIsOnlyOneTask) {
Expand All @@ -135,7 +135,8 @@ TEST(BarrierProxyTest, TimeoutIfNotEnoughThreadEntered) {
/*expected_ok_count=*/0,
/*agent_wait_status=*/{},
/*expected_same_exit_status_for_all_threads=*/
errors::DeadlineExceeded("BarrierProxy timeout: key=", kTestKey));
absl::DeadlineExceededError(
absl::StrCat("BarrierProxy timeout: key=", kTestKey)));
}

TEST(BarrierProxyTest, ExtraThreadsEnteringTheBarrierGetErrors) {
Expand Down Expand Up @@ -196,7 +197,7 @@ TEST(BarrierProxyManagerTest, CoordinationServiceError) {
TestBarrierProxyManagerWaitSingleKey(
/*num_threads_planned=*/8,
/*num_threads_entered=*/8,
/*agent_wait_status=*/errors::Internal(""),
/*agent_wait_status=*/absl::InternalError(""),
/*expected_ok_count=*/0);
}

Expand Down
29 changes: 29 additions & 0 deletions third_party/xla/xla/backends/gpu/runtime/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ cc_library(
deps = [
":async_execution",
":collective_params",
":execution_stream_id",
":thunk",
":thunk_executor",
":thunk_proto_cc",
Expand All @@ -461,6 +462,7 @@ cc_library(
"@com_google_absl//absl/base",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/strings:str_format",
],
)
Expand All @@ -471,6 +473,7 @@ xla_test(
backends = ["gpu"],
deps = [
":async_thunk",
":execution_stream_id",
":memset_thunk",
":thunk",
":thunk_executor",
Expand Down Expand Up @@ -1962,6 +1965,7 @@ xla_test(
":command_buffer_cmd_emitter",
":command_buffer_thunk",
":command_executor",
":execution_stream_id",
":ragged_all_to_all_thunk",
":thunk",
":thunk_executor",
Expand Down Expand Up @@ -2032,6 +2036,7 @@ xla_test(
":command_buffer_cmd_emitter",
":command_buffer_thunk",
":command_executor",
":execution_stream_id",
":thunk",
":thunk_executor",
":thunk_proto_cc",
Expand Down Expand Up @@ -2119,6 +2124,7 @@ xla_test(
":command_buffer_cmd_emitter",
":command_buffer_thunk",
":command_executor",
":execution_stream_id",
":thunk",
":thunk_executor",
":thunk_proto_cc",
Expand Down Expand Up @@ -2549,6 +2555,7 @@ xla_test(
":command_buffer_cmd_emitter",
":command_buffer_thunk",
":command_executor",
":execution_stream_id",
":recv_thunk",
":send_thunk",
":thunk",
Expand Down Expand Up @@ -2819,6 +2826,25 @@ xla_cc_test(
],
)

cc_library(
name = "execution_stream_id",
hdrs = ["execution_stream_id.h"],
deps = [
"//xla/tsl/lib/gtl:int_type",
"@com_google_absl//absl/strings:str_format",
],
)

xla_cc_test(
name = "execution_stream_id_test",
srcs = ["execution_stream_id_test.cc"],
deps = [
":execution_stream_id",
"@com_google_absl//absl/strings",
"@com_google_googletest//:gtest_main",
],
)

cc_library(
name = "thunk",
srcs = ["thunk.cc"],
Expand All @@ -2829,6 +2855,7 @@ cc_library(
":collective_memory",
":collective_memory_requests",
":collective_params",
":execution_stream_id",
":thunk_id",
":thunk_kind_proto_cc",
":thunk_proto_cc",
Expand Down Expand Up @@ -3625,6 +3652,7 @@ xla_cc_test(
":custom_kernel_thunk",
":device_to_device_copy_thunk",
":device_to_host_copy_thunk",
":execution_stream_id",
":host_execute_thunk",
":host_send_recv_thunk",
":host_to_device_copy_thunk",
Expand Down Expand Up @@ -4054,6 +4082,7 @@ xla_test(
":conditional_thunk",
":cudnn_thunk",
":device_to_device_copy_thunk",
":execution_stream_id",
":gemm_thunk",
":replica_id_thunk",
":sequential_thunk",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,12 @@ using ::tsl::proto_testing::EqualsProto;
TEST(CollectiveThunkTest, ProtoRoundTrip) {
ThunkProto proto = tsl::proto_testing::ParseTextProtoOrDie<ThunkProto>(
R"pb(
thunk_info {
profile_annotation: "partition_id_profile_annotation"
execution_stream_id: 2
}
thunk_info { profile_annotation: "partition_id_profile_annotation" }
all_gather_start_thunk { collective_config {} }
)pb");

Thunk::ThunkInfo thunk_info;
thunk_info.profile_annotation = proto.thunk_info().profile_annotation();
thunk_info.execution_stream_id = xla::gpu::ExecutionStreamId{
static_cast<xla::gpu::ExecutionStreamId::ValueType>(
proto.thunk_info().execution_stream_id())};

std::vector<BufferAllocation> buffer_allocations = {
BufferAllocation(/*index=*/0, /*size=*/4, /*color=*/0)};
Expand Down
24 changes: 3 additions & 21 deletions third_party/xla/xla/backends/gpu/runtime/all_reduce_thunk_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ using ::tsl::proto_testing::EqualsProto;
TEST(CollectiveThunkTest, ProtoRoundTrip) {
ThunkProto proto = tsl::proto_testing::ParseTextProtoOrDie<ThunkProto>(
R"pb(
thunk_info {
profile_annotation: "partition_id_profile_annotation"
execution_stream_id: 2
}
thunk_info { profile_annotation: "partition_id_profile_annotation" }
all_reduce_start_thunk {
collective_config {}
reduction_kind: 1
Expand All @@ -46,9 +43,6 @@ TEST(CollectiveThunkTest, ProtoRoundTrip) {

Thunk::ThunkInfo thunk_info;
thunk_info.profile_annotation = proto.thunk_info().profile_annotation();
thunk_info.execution_stream_id = xla::gpu::ExecutionStreamId{
static_cast<xla::gpu::ExecutionStreamId::ValueType>(
proto.thunk_info().execution_stream_id())};

std::vector<BufferAllocation> buffer_allocations = {
BufferAllocation(/*index=*/0, /*size=*/4, /*color=*/0)};
Expand All @@ -66,10 +60,7 @@ TEST(CollectiveThunkTest, ProtoRoundTrip) {
TEST(CollectiveThunkTest, SyncCollective) {
ThunkProto proto = tsl::proto_testing::ParseTextProtoOrDie<ThunkProto>(
R"pb(
thunk_info {
profile_annotation: "partition_id_profile_annotation"
execution_stream_id: 2
}
thunk_info { profile_annotation: "partition_id_profile_annotation" }
all_reduce_start_thunk {
collective_config {}
reduction_kind: 1
Expand All @@ -78,9 +69,6 @@ TEST(CollectiveThunkTest, SyncCollective) {

Thunk::ThunkInfo thunk_info;
thunk_info.profile_annotation = proto.thunk_info().profile_annotation();
thunk_info.execution_stream_id = xla::gpu::ExecutionStreamId{
static_cast<xla::gpu::ExecutionStreamId::ValueType>(
proto.thunk_info().execution_stream_id())};

std::vector<BufferAllocation> buffer_allocations = {
BufferAllocation(/*index=*/0, /*size=*/4, /*color=*/0)};
Expand All @@ -94,10 +82,7 @@ TEST(CollectiveThunkTest, SyncCollective) {
TEST(ReduceScatterThunkTest, ProtoRoundTrip) {
ThunkProto proto = tsl::proto_testing::ParseTextProtoOrDie<ThunkProto>(
R"pb(
thunk_info {
profile_annotation: "partition_id_profile_annotation"
execution_stream_id: 2
}
thunk_info { profile_annotation: "partition_id_profile_annotation" }
reduce_scatter_thunk {
collective_config {}
reduction_kind: 1
Expand All @@ -106,9 +91,6 @@ TEST(ReduceScatterThunkTest, ProtoRoundTrip) {

Thunk::ThunkInfo thunk_info;
thunk_info.profile_annotation = proto.thunk_info().profile_annotation();
thunk_info.execution_stream_id = xla::gpu::ExecutionStreamId{
static_cast<xla::gpu::ExecutionStreamId::ValueType>(
proto.thunk_info().execution_stream_id())};

std::vector<BufferAllocation> buffer_allocations = {
BufferAllocation(/*index=*/0, /*size=*/4, /*color=*/0)};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ using ::tsl::proto_testing::EqualsProto;
TEST(CollectiveThunkTest, ProtoRoundTrip) {
ThunkProto proto = tsl::proto_testing::ParseTextProtoOrDie<ThunkProto>(
R"pb(
thunk_info {
profile_annotation: "partition_id_profile_annotation"
execution_stream_id: 2
}
thunk_info { profile_annotation: "partition_id_profile_annotation" }
all_to_all_start_thunk {
collective_config {}
has_split_dimension: false
Expand All @@ -47,9 +44,6 @@ TEST(CollectiveThunkTest, ProtoRoundTrip) {

Thunk::ThunkInfo thunk_info;
thunk_info.profile_annotation = proto.thunk_info().profile_annotation();
thunk_info.execution_stream_id = xla::gpu::ExecutionStreamId{
static_cast<xla::gpu::ExecutionStreamId::ValueType>(
proto.thunk_info().execution_stream_id())};

std::vector<BufferAllocation> buffer_allocations = {
BufferAllocation(/*index=*/0, /*size=*/4, /*color=*/0)};
Expand Down
Loading
Loading