Skip to content

Commit

Permalink
buffer_comparator buffer init fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pemeliya committed Oct 24, 2024
1 parent 22038dc commit a280c6b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
17 changes: 12 additions & 5 deletions third_party/xla/xla/service/gpu/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4301,10 +4301,15 @@ xla_cc_test(
],
)

cuda_library(
gpu_kernel_library(
name = "stream_executor_util_kernel",
srcs = if_cuda_is_configured(["stream_executor_util_kernel.cu.cc"]),
deps = ["@local_config_cuda//cuda:cuda_headers"],
srcs = ["stream_executor_util_kernel.cu.cc"],
tags = ["gpu"],
deps = if_cuda_is_configured([
"@local_config_cuda//cuda:cuda_headers",
]) + if_rocm_is_configured([
"@local_config_rocm//rocm:rocm_headers",
]),
)

cc_library(
Expand All @@ -4316,7 +4321,6 @@ cc_library(
deps = [
":cublas_cudnn",
":launch_dimensions",
":stream_executor_util_kernel",
"//xla:autotuning_proto_cc",
"//xla:shape_util",
"//xla:util",
Expand All @@ -4343,7 +4347,10 @@ cc_library(
"@local_tsl//tsl/platform:ml_dtypes",
"@local_tsl//tsl/platform:status",
"@local_tsl//tsl/platform:statusor",
],
"@local_tsl//tsl/protobuf:dnn_proto_cc",
] + if_gpu_is_configured([
":stream_executor_util_kernel",
]),
)

xla_cc_test(
Expand Down
6 changes: 5 additions & 1 deletion third_party/xla/xla/service/gpu/kernels/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,11 @@ gpu_kernel_library(
"//xla:types",
"//xla/stream_executor/gpu:gpu_types_header",
"@local_tsl//tsl/lib/math:math_util",
],
] + if_cuda_is_configured([
"@local_config_cuda//cuda:cuda_headers",
]) + if_rocm_is_configured([
"@local_config_rocm//rocm:rocm_headers",
]),
)

xla_test(
Expand Down
2 changes: 0 additions & 2 deletions third_party/xla/xla/service/gpu/stream_executor_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,6 @@ static void InitializeTypedBuffer(se::Stream* stream,
// Nothing more to do
return;
}
#ifdef GOOGLE_CUDA
// Repeat the host_buffer_size elements at the start of `buf` to the end
CHECK_EQ(elements_to_fill, buffer.size() / sizeof(T) - host_buffer_size);
se::StreamExecutor* executor = stream->parent();
Expand All @@ -514,7 +513,6 @@ static void InitializeTypedBuffer(se::Stream* stream,
se::BlockDim(blocks_per_grid, 1, 1), *kernel,
buffer, host_buffer_bytes,
static_cast<int64_t>(buffer.size())));
#endif
}

void InitializeBuffer(se::Stream* stream, PrimitiveType buffer_type,
Expand Down

0 comments on commit a280c6b

Please sign in to comment.