Skip to content

Commit

Permalink
Rollback due to internal breaking change
Browse files Browse the repository at this point in the history
Reverts a1f1dc4

PiperOrigin-RevId: 672099416
  • Loading branch information
IllogicalMoose authored and tensorflower-gardener committed Sep 7, 2024
1 parent f61d8f8 commit ea3e1b9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 163 deletions.
6 changes: 1 addition & 5 deletions third_party/xla/xla/stream_executor/cuda/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
load("@local_config_cuda//cuda:build_defs.bzl", "cuda_library")
load(
"@local_tsl//tsl/platform:build_config_root.bzl",
"if_static",
Expand Down Expand Up @@ -525,16 +524,13 @@ cuda_only_cc_library(
],
)

cuda_library(
cc_library(
name = "command_buffer_kernels",
srcs = [
"command_buffer_kernels.cc",
"command_buffer_kernels.cu.cc",
],
tags = ["no_rocm"],
deps = [
"//xla/stream_executor:kernel_spec",
"//xla/stream_executor/gpu:gpu_types_header",
"@com_google_absl//absl/status:statusor",
],
)
Expand Down
41 changes: 0 additions & 41 deletions third_party/xla/xla/stream_executor/cuda/command_buffer_kernels.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ limitations under the License.
#include <string_view>

#include "absl/status/statusor.h"
#include "third_party/gpus/cuda/include/cuda.h"
#include "xla/stream_executor/kernel_spec.h"

namespace stream_executor {
Expand Down Expand Up @@ -758,85 +757,45 @@ inline constexpr std::string_view kNoOpKernel = R"(
})";

} // namespace

#if CUDA_VERSION >= 12030
void* GetSetIfConditionKernel();
void* GetSetIfElseConditionKernel();
void* GetSetCaseConditionKernel();
void* GetSetForConditionKernel();
void* GetSetWhileConditionKernel();
void* GetNoOpKernel();
#endif

} // namespace cuda

namespace gpu {

// TODO(b/362786589): Remove PTX usage when we only support cuda >= 12.4.1
// See comment at top of this file for why PTX is used for cuda < 12.4.1.
absl::StatusOr<MultiKernelLoaderSpec> GetSetIfConditionKernelLoaderSpec() {
MultiKernelLoaderSpec spec(/*arity=*/2);
#if CUDA_VERSION >= 12030
spec.AddInProcessSymbol(cuda::GetSetIfConditionKernel(), "set_if_condition");
#else
spec.AddCudaPtxInMemory(cuda::kSetIfConditionKernel, "set_if_condition");
#endif
return spec;
}

absl::StatusOr<MultiKernelLoaderSpec> GetSetIfElseConditionKernelLoaderSpec() {
MultiKernelLoaderSpec spec(/*arity=*/3);
#if CUDA_VERSION >= 12030
spec.AddInProcessSymbol(cuda::GetSetIfElseConditionKernel(),
"set_if_else_condition");
#else
spec.AddCudaPtxInMemory(cuda::kSetIfElseConditionKernel,
"set_if_else_condition");
#endif
return spec;
}

absl::StatusOr<MultiKernelLoaderSpec> GetSetCaseConditionKernelLoaderSpec() {
MultiKernelLoaderSpec spec(/*arity=*/10);
#if CUDA_VERSION >= 12030
spec.AddInProcessSymbol(cuda::GetSetCaseConditionKernel(),
"set_case_condition");
#else
spec.AddCudaPtxInMemory(cuda::kSetCaseConditionKernel, "set_case_condition");
#endif
return spec;
}

absl::StatusOr<MultiKernelLoaderSpec> GetSetForConditionKernelLoaderSpec() {
MultiKernelLoaderSpec spec(/*arity=*/3);
#if CUDA_VERSION >= 12030
spec.AddInProcessSymbol(cuda::GetSetForConditionKernel(),
"set_for_condition");
#else
spec.AddCudaPtxInMemory(cuda::kSetForConditionKernel, "set_for_condition");
#endif
return spec;
}

absl::StatusOr<MultiKernelLoaderSpec> GetSetWhileConditionKernelLoaderSpec() {
MultiKernelLoaderSpec spec(/*arity=*/2);
#if CUDA_VERSION >= 12030
spec.AddInProcessSymbol(cuda::GetSetWhileConditionKernel(),
"set_while_condition");
#else
spec.AddCudaPtxInMemory(cuda::kSetWhileConditionKernel,
"set_while_condition");
#endif
return spec;
}

absl::StatusOr<MultiKernelLoaderSpec> GetNoOpKernelLoaderSpec() {
MultiKernelLoaderSpec spec(/*arity=*/0);
#if CUDA_VERSION >= 12030
spec.AddInProcessSymbol(cuda::GetNoOpKernel(), "noop");
#else
spec.AddCudaPtxInMemory(cuda::kNoOpKernel, "noop");
#endif
return spec;
}

Expand Down
117 changes: 0 additions & 117 deletions third_party/xla/xla/stream_executor/cuda/command_buffer_kernels.cu.cc

This file was deleted.

0 comments on commit ea3e1b9

Please sign in to comment.