aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/verbs/BUILD
blob: 80a5d07ea43531ed2532443b6ff9327b9ece6df7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# Description:
#   Verbs RDMA communication interfaces and implementations for TensorFlow.

package(default_visibility = [
    "//tensorflow:__subpackages__",
])

licenses(["notice"])  # Apache 2.0

load("//tensorflow:tensorflow.bzl", "tf_cuda_library")

exports_files(["LICENSE"])

filegroup(
    name = "all_files",
    srcs = glob(
        ["**/*"],
        exclude = [
            "**/METADATA",
            "**/OWNERS",
        ],
    ),
    visibility = ["//tensorflow:__subpackages__"],
)

filegroup(
    name = "c_srcs",
    data = glob([
        "**/*.cc",
        "**/*.h",
    ]),
)

# For platform specific build config
load(
    "//tensorflow/core:platform/default/build_config.bzl",
    "tf_proto_library_cc",
)

tf_proto_library_cc(
    name = "verbs_service_proto",
    srcs = ["verbs_service.proto"],
    has_services = 1,
    cc_api_version = 2,
    visibility = [
        "//tensorflow:__subpackages__",
    ],
)

cc_library(
    name = "verbs_util",
    srcs = ["verbs_util.cc"],
    hdrs = ["verbs_util.h"],
    deps = [
        "//tensorflow/core:framework",
        "//tensorflow/core:lib",
    ],
)

cc_library(
    name = "grpc_verbs_service",
    srcs = ["grpc_verbs_service.cc"],
    hdrs = ["grpc_verbs_service.h"],
    deps = [
        ":grpc_verbs_service_impl",
        ":rdma_mgr",
        ":verbs_service_proto_cc",
        "//tensorflow/core:lib_internal",
        "//tensorflow/core/distributed_runtime:session_mgr",
        "//tensorflow/core/distributed_runtime/rpc:async_service_interface",
        "//tensorflow/core/distributed_runtime/rpc:grpc_call",
        "//tensorflow/core/distributed_runtime/rpc:grpc_util",
        "@grpc//:grpc++_unsecure",
    ],
    alwayslink = 1,
)

cc_library(
    name = "grpc_verbs_service_impl",
    srcs = ["grpc_verbs_service_impl.cc"],
    hdrs = ["grpc_verbs_service_impl.h"],
    deps = [
        ":verbs_service_proto_cc",
        "@grpc//:grpc++_unsecure",
    ],
)

cc_library(
    name = "grpc_verbs_client",
    srcs = ["grpc_verbs_client.cc"],
    hdrs = ["grpc_verbs_client.h"],
    deps = [
        ":grpc_verbs_service_impl",
        ":verbs_service_proto_cc",
        "//tensorflow/core:lib",
        "//tensorflow/core/distributed_runtime:call_options",
        "//tensorflow/core/distributed_runtime/rpc:grpc_util",
    ],
    alwayslink = 1,
)

cc_library(
    name = "rdma_rendezvous_mgr",
    srcs = ["rdma_rendezvous_mgr.cc"],
    hdrs = ["rdma_rendezvous_mgr.h"],
    deps = [
        ":rdma_mgr",
        ":verbs_util",
        "//tensorflow/core:core_cpu_internal",
        "//tensorflow/core:gpu_runtime",
        "//tensorflow/core:lib",
        "//tensorflow/core/distributed_runtime:base_rendezvous_mgr",
        "//tensorflow/core/distributed_runtime:worker_env",
    ],
)

tf_cuda_library(
    name = "rdma_mgr",
    srcs = ["rdma_mgr.cc"],
    hdrs = ["rdma_mgr.h"],
    deps = [
        ":grpc_verbs_client",
        ":rdma",
        ":verbs_service_proto_cc",
        "//tensorflow/core:core_cpu_internal",
        "//tensorflow/core:lib",
        "//tensorflow/core:lib_internal",
        "//tensorflow/core/distributed_runtime:session_mgr",
        "//tensorflow/core/distributed_runtime:worker_env",
        "//tensorflow/core/distributed_runtime/rpc:grpc_channel",
        "//tensorflow/core/distributed_runtime/rpc:grpc_worker_cache",
    ],
)

tf_cuda_library(
    name = "rdma",
    srcs = ["rdma.cc"],
    hdrs = ["rdma.h"],
    linkopts = select({
        "//tensorflow:with_verbs_support": ["-libverbs"],
        "//conditions:default": [],
    }),
    deps = [
        ":grpc_verbs_client",
        ":verbs_service_proto_cc",
        ":verbs_util",
        "//tensorflow/core:core_cpu_internal",
        "//tensorflow/core:framework",
        "//tensorflow/core:framework_internal",
        "//tensorflow/core:gpu_runtime",
        "//tensorflow/core:lib",
        "//tensorflow/core:lib_internal",
        "//tensorflow/core/distributed_runtime:rendezvous_mgr_interface",
        "//tensorflow/core/distributed_runtime:session_mgr",
        "//tensorflow/core/distributed_runtime:worker_env",
    ],
)

cc_library(
    name = "verbs_server_lib",
    srcs = ["verbs_server_lib.cc"],
    hdrs = ["verbs_server_lib.h"],
    linkstatic = 1,  # Seems to be needed since alwayslink is broken in bazel
    deps = [
        ":grpc_verbs_service",
        ":rdma_mgr",
        ":rdma_rendezvous_mgr",
        "//tensorflow/core:lib",
        "//tensorflow/core/distributed_runtime:server_lib",
        "//tensorflow/core/distributed_runtime/rpc:grpc_server_lib",
    ],
    alwayslink = 1,
)