From f5a7e40011de7890d6c2a14743d7a2e3a0de29f9 Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Wed, 8 May 2019 08:39:20 -0700 Subject: [PATCH] Automated rollback of commit 66b193faeecda4e6bc7e2767c2d927eecd199a34 PiperOrigin-RevId: 247219311 --- tensorflow/core/BUILD | 2 +- tensorflow/stream_executor/cuda/BUILD | 60 +++++-------------- third_party/gpus/cuda/build_defs.bzl.tpl | 4 +- .../cuda10.0-cudnn7/cuda/build_defs.bzl | 4 +- 4 files changed, 21 insertions(+), 49 deletions(-) diff --git a/tensorflow/core/BUILD b/tensorflow/core/BUILD index 81ebeb0bd2e..cddf1627c76 100644 --- a/tensorflow/core/BUILD +++ b/tensorflow/core/BUILD @@ -3327,7 +3327,7 @@ tf_cuda_library( name = "device_tracer", srcs = tf_additional_device_tracer_srcs(), copts = tf_copts(), - cuda_deps = tf_additional_cupti_wrapper_deps() + tf_additional_device_tracer_cuda_deps(), + cuda_deps = if_cuda_is_configured(tf_additional_cupti_wrapper_deps() + tf_additional_device_tracer_cuda_deps()), visibility = [ "//tensorflow:internal", ], diff --git a/tensorflow/stream_executor/cuda/BUILD b/tensorflow/stream_executor/cuda/BUILD index 0dee5183641..fa456bf76d3 100644 --- a/tensorflow/stream_executor/cuda/BUILD +++ b/tensorflow/stream_executor/cuda/BUILD @@ -198,22 +198,12 @@ cc_library( ]), ) -alias( - name = "cublas_lib", - actual = if_static( - "@local_config_cuda//cuda:cublas", - ":cublas_stub", - ), - visibility = ["//visibility:private"], -) - cc_library( name = "cublas_plugin", srcs = if_cuda_is_configured(["cuda_blas.cc"]), hdrs = if_cuda_is_configured(["cuda_blas.h"]), visibility = ["//visibility:public"], deps = if_cuda_is_configured([ - ":cublas_lib", ":cuda_activation", ":cuda_gpu_executor", ":cuda_platform_id", @@ -233,7 +223,10 @@ cc_library( "//tensorflow/stream_executor/gpu:gpu_helpers_header", "//tensorflow/stream_executor/lib", "//tensorflow/stream_executor/platform", - ]) + [ + ] + if_static( + ["@local_config_cuda//cuda:cublas"], + [":cublas_stub"], + )) + [ "@com_google_absl//absl/strings:str_format", "@com_google_absl//absl/synchronization", ], @@ -251,15 +244,6 @@ cc_library( ]), ) -alias( - name = "cufft_lib", - actual = if_static( - "@local_config_cuda//cuda:cufft", - ":cufft_stub", - ), - visibility = ["//visibility:private"], -) - cc_library( name = "cufft_plugin", srcs = if_cuda_is_configured(["cuda_fft.cc"]), @@ -271,7 +255,6 @@ cc_library( ":cuda_platform_id", ":cuda_stream", ":cuda_helpers", - ":cufft_lib", "@local_config_cuda//cuda:cuda_headers", "//tensorflow/stream_executor:event", "//tensorflow/stream_executor:fft", @@ -281,7 +264,10 @@ cc_library( "//tensorflow/stream_executor/lib", "//tensorflow/stream_executor/platform", "//tensorflow/stream_executor/platform:dso_loader", - ]), + ] + if_static( + ["@local_config_cuda//cuda:cufft"], + [":cufft_stub"], + )), alwayslink = True, ) @@ -296,15 +282,6 @@ cc_library( ]), ) -alias( - name = "cudnn_lib", - actual = if_static( - "@local_config_cuda//cuda:cudnn", - ":cudnn_stub", - ), - visibility = ["//visibility:private"], -) - cc_library( name = "cudnn_plugin", srcs = if_cuda_is_configured(["cuda_dnn.cc"]), @@ -319,7 +296,6 @@ cc_library( ":cuda_stream", ":cuda_timer", ":cudnn_version", - ":cudnn_lib", "@com_google_absl//absl/strings", "//third_party/eigen3", "@local_config_cuda//cuda:cuda_headers", @@ -333,7 +309,10 @@ cc_library( "//tensorflow/stream_executor:temporary_device_memory", "//tensorflow/stream_executor/lib", "//tensorflow/stream_executor/platform", - ]) + tf_additional_cudnn_plugin_deps() + ["@com_google_absl//absl/synchronization"], + ]) + tf_additional_cudnn_plugin_deps() + if_cuda_is_configured(if_static( + ["@local_config_cuda//cuda:cudnn"], + [":cudnn_stub"], + )) + ["@com_google_absl//absl/synchronization"], alwayslink = True, ) @@ -348,15 +327,6 @@ cc_library( ]), ) -alias( - name = "curand_lib", - actual = if_static( - "@local_config_cuda//cuda:curand", - ":curand_stub", - ), - visibility = ["//visibility:private"], -) - cc_library( name = "curand_plugin", srcs = if_cuda_is_configured(["cuda_rng.cc"]), @@ -367,7 +337,6 @@ cc_library( ":cuda_platform_id", ":cuda_stream", ":cuda_helpers", - ":curand_lib", "@local_config_cuda//cuda:cuda_headers", "//tensorflow/stream_executor:event", "//tensorflow/stream_executor:plugin_registry", @@ -377,7 +346,10 @@ cc_library( "//tensorflow/stream_executor/lib", "//tensorflow/stream_executor/platform", "//tensorflow/stream_executor/platform:dso_loader", - ]), + ] + if_static( + ["@local_config_cuda//cuda:curand"], + [":curand_stub"], + )), alwayslink = True, ) diff --git a/third_party/gpus/cuda/build_defs.bzl.tpl b/third_party/gpus/cuda/build_defs.bzl.tpl index 69e0bb1ac71..ca8bbc1ee22 100644 --- a/third_party/gpus/cuda/build_defs.bzl.tpl +++ b/third_party/gpus/cuda/build_defs.bzl.tpl @@ -29,5 +29,5 @@ def if_cuda_is_configured(x): --config=cuda. Used to allow non-CUDA code to depend on CUDA libraries. """ if cuda_is_configured(): - return select({"//conditions:default": x}) - return select({"//conditions:default": []}) + return x + return [] diff --git a/third_party/toolchains/preconfig/ubuntu14.04/cuda10.0-cudnn7/cuda/build_defs.bzl b/third_party/toolchains/preconfig/ubuntu14.04/cuda10.0-cudnn7/cuda/build_defs.bzl index 20ef28ffeae..a53c891d8bb 100755 --- a/third_party/toolchains/preconfig/ubuntu14.04/cuda10.0-cudnn7/cuda/build_defs.bzl +++ b/third_party/toolchains/preconfig/ubuntu14.04/cuda10.0-cudnn7/cuda/build_defs.bzl @@ -27,5 +27,5 @@ def if_cuda_is_configured(x): --config=cuda. Used to allow non-CUDA code to depend on CUDA libraries. """ if cuda_is_configured(): - return select({"//conditions:default": x}) - return select({"//conditions:default": []}) + return x + return []