pytorch

Форк
0
/
WORKSPACE 
350 строк · 8.7 Кб
1
workspace(name = "pytorch")
2

3
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
4
load("//tools/rules:workspace.bzl", "new_patched_local_repository")
5

6
http_archive(
7
    name = "rules_cc",
8
    patches = [
9
        "//:tools/rules_cc/cuda_support.patch",
10
    ],
11
    strip_prefix = "rules_cc-40548a2974f1aea06215272d9c2b47a14a24e556",
12
    urls = [
13
        "https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/40548a2974f1aea06215272d9c2b47a14a24e556.tar.gz",
14
        "https://github.com/bazelbuild/rules_cc/archive/40548a2974f1aea06215272d9c2b47a14a24e556.tar.gz",
15
    ],
16
)
17

18
http_archive(
19
    name = "rules_cuda",
20
    strip_prefix = "runtime-b1c7cce21ba4661c17ac72421c6a0e2015e7bef3/third_party/rules_cuda",
21
    urls = ["https://github.com/tensorflow/runtime/archive/b1c7cce21ba4661c17ac72421c6a0e2015e7bef3.tar.gz"],
22
)
23

24
load("@rules_cuda//cuda:dependencies.bzl", "rules_cuda_dependencies")
25

26
rules_cuda_dependencies(with_rules_cc = False)
27

28
load("@rules_cc//cc:repositories.bzl", "rules_cc_toolchains")
29

30
rules_cc_toolchains()
31

32
http_archive(
33
    name = "bazel_skylib",
34
    urls = [
35
        "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz",
36
    ],
37
)
38

39
http_archive(
40
    name = "pybind11_bazel",
41
    strip_prefix = "pybind11_bazel-b162c7c88a253e3f6b673df0c621aca27596ce6b",
42
    urls = ["https://github.com/pybind/pybind11_bazel/archive/b162c7c88a253e3f6b673df0c621aca27596ce6b.zip"],
43
)
44

45
new_local_repository(
46
    name = "pybind11",
47
    build_file = "@pybind11_bazel//:pybind11.BUILD",
48
    path = "third_party/pybind11",
49
)
50

51
http_archive(
52
    name = "com_github_glog",
53
    build_file_content = """
54
licenses(['notice'])
55

56
load(':bazel/glog.bzl', 'glog_library')
57
# TODO: figure out why enabling gflags leads to SIGSEV on the logging init
58
glog_library(with_gflags=0)
59
    """,
60
    strip_prefix = "glog-0.4.0",
61
    urls = [
62
        "https://github.com/google/glog/archive/v0.4.0.tar.gz",
63
    ],
64
)
65

66
http_archive(
67
    name = "com_github_gflags_gflags",
68
    strip_prefix = "gflags-2.2.2",
69
    urls = [
70
        "https://github.com/gflags/gflags/archive/v2.2.2.tar.gz",
71
    ],
72
)
73

74
new_local_repository(
75
    name = "gloo",
76
    build_file = "//third_party:gloo.BUILD",
77
    path = "third_party/gloo",
78
)
79

80
new_local_repository(
81
    name = "onnx",
82
    build_file = "//third_party:onnx.BUILD",
83
    path = "third_party/onnx",
84
)
85

86
new_local_repository(
87
    name = "foxi",
88
    build_file = "//third_party:foxi.BUILD",
89
    path = "third_party/foxi",
90
)
91

92
local_repository(
93
    name = "com_google_protobuf",
94
    path = "third_party/protobuf",
95
)
96

97
new_local_repository(
98
    name = "eigen",
99
    build_file = "//third_party:eigen.BUILD",
100
    path = "third_party/eigen",
101
)
102

103
new_local_repository(
104
    name = "cutlass",
105
    build_file = "//third_party:cutlass.BUILD",
106
    path = "third_party/cutlass",
107
)
108

109
new_local_repository(
110
    name = "fbgemm",
111
    build_file = "//third_party:fbgemm/BUILD.bazel",
112
    path = "third_party/fbgemm",
113
    repo_mapping = {"@cpuinfo": "@org_pytorch_cpuinfo"},
114
)
115

116
new_local_repository(
117
    name = "ideep",
118
    build_file = "//third_party:ideep.BUILD",
119
    path = "third_party/ideep",
120
)
121

122
new_local_repository(
123
    name = "mkl_dnn",
124
    build_file = "//third_party:mkl-dnn.BUILD",
125
    path = "third_party/ideep/mkl-dnn",
126
)
127

128
new_local_repository(
129
    name = "org_pytorch_cpuinfo",
130
    build_file = "//third_party:cpuinfo/BUILD.bazel",
131
    path = "third_party/cpuinfo",
132
)
133

134
new_local_repository(
135
    name = "asmjit",
136
    build_file = "//third_party:fbgemm/third_party/asmjit.BUILD",
137
    path = "third_party/fbgemm/third_party/asmjit",
138
)
139

140
new_local_repository(
141
    name = "sleef",
142
    build_file = "//third_party:sleef.BUILD",
143
    path = "third_party/sleef",
144
)
145

146
new_local_repository(
147
    name = "fmt",
148
    build_file = "//third_party:fmt.BUILD",
149
    path = "third_party/fmt",
150
)
151

152
new_local_repository(
153
    name = "kineto",
154
    build_file = "//third_party:kineto.BUILD",
155
    path = "third_party/kineto",
156
)
157

158
new_patched_local_repository(
159
    name = "tbb",
160
    build_file = "//third_party:tbb.BUILD",
161
    patch_strip = 1,
162
    patches = [
163
        "@//third_party:tbb.patch",
164
    ],
165
    path = "third_party/tbb",
166
)
167

168
new_local_repository(
169
    name = "tensorpipe",
170
    build_file = "//third_party:tensorpipe.BUILD",
171
    path = "third_party/tensorpipe",
172
)
173

174
http_archive(
175
    name = "mkl",
176
    build_file = "//third_party:mkl.BUILD",
177
    sha256 = "59154b30dd74561e90d547f9a3af26c75b6f4546210888f09c9d4db8f4bf9d4c",
178
    strip_prefix = "lib",
179
    urls = [
180
        "https://anaconda.org/anaconda/mkl/2020.0/download/linux-64/mkl-2020.0-166.tar.bz2",
181
    ],
182
)
183

184
http_archive(
185
    name = "mkl_headers",
186
    build_file = "//third_party:mkl_headers.BUILD",
187
    sha256 = "2af3494a4bebe5ddccfdc43bacc80fcd78d14c1954b81d2c8e3d73b55527af90",
188
    urls = [
189
        "https://anaconda.org/anaconda/mkl-include/2020.0/download/linux-64/mkl-include-2020.0-166.tar.bz2",
190
    ],
191
)
192

193
http_archive(
194
    name = "rules_python",
195
    # TODO Fix bazel linter to support hashes for release tarballs.
196
    #
197
    # sha256 = "94750828b18044533e98a129003b6a68001204038dc4749f40b195b24c38f49f",
198
    strip_prefix = "rules_python-0.21.0",
199
    url = "https://github.com/bazelbuild/rules_python/releases/download/0.21.0/rules_python-0.21.0.tar.gz",
200
)
201

202
load("@rules_python//python:repositories.bzl", "py_repositories")
203

204
py_repositories()
205

206
load("@rules_python//python:repositories.bzl", "python_register_toolchains")
207

208
python_register_toolchains(
209
    name = "python3_8",
210
    python_version = "3.8",
211
)
212

213
load("@python3_8//:defs.bzl", "interpreter")
214
load("@rules_python//python:pip.bzl", "pip_parse")
215

216
pip_parse(
217
    name = "pip_deps",
218
    python_interpreter_target = interpreter,
219
    requirements_lock = "//:tools/build/bazel/requirements.txt",
220
)
221

222
load("@pip_deps//:requirements.bzl", "install_deps")
223

224
install_deps()
225

226
load("@pybind11_bazel//:python_configure.bzl", "python_configure")
227

228
python_configure(
229
    name = "local_config_python",
230
    python_interpreter_target = interpreter,
231
)
232

233
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
234

235
protobuf_deps()
236

237
new_local_repository(
238
    name = "cuda",
239
    build_file = "@//third_party:cuda.BUILD",
240
    path = "/usr/local/cuda",
241
)
242

243
new_local_repository(
244
    name = "cudnn",
245
    build_file = "@//third_party:cudnn.BUILD",
246
    path = "/usr/local/cuda",
247
)
248

249
new_local_repository(
250
    name = "cudnn_frontend",
251
    build_file = "@//third_party:cudnn_frontend.BUILD",
252
    path = "third_party/cudnn_frontend/",
253
)
254

255
local_repository(
256
    name = "com_github_google_flatbuffers",
257
    path = "third_party/flatbuffers",
258
)
259

260
local_repository(
261
    name = "google_benchmark",
262
    path = "third_party/benchmark",
263
)
264

265
local_repository(
266
    name = "com_google_googletest",
267
    path = "third_party/googletest",
268
)
269

270
local_repository(
271
    name = "pthreadpool",
272
    path = "third_party/pthreadpool",
273
    repo_mapping = {"@com_google_benchmark": "@google_benchmark"},
274
)
275

276
local_repository(
277
    name = "FXdiv",
278
    path = "third_party/FXdiv",
279
    repo_mapping = {"@com_google_benchmark": "@google_benchmark"},
280
)
281

282
local_repository(
283
    name = "XNNPACK",
284
    path = "third_party/XNNPACK",
285
    repo_mapping = {"@com_google_benchmark": "@google_benchmark"},
286
)
287

288
local_repository(
289
    name = "gemmlowp",
290
    path = "third_party/gemmlowp/gemmlowp",
291
)
292

293
### Unused repos start
294

295
# `unused` repos are defined to hide bazel files from submodules of submodules.
296
# This allows us to run `bazel build //...` and not worry about the submodules madness.
297
# Otherwise everything traverses recursively and a lot of submodules of submodules have
298
# they own bazel build files.
299

300
local_repository(
301
    name = "unused_tensorpipe_googletest",
302
    path = "third_party/tensorpipe/third_party/googletest",
303
)
304

305
local_repository(
306
    name = "unused_fbgemm",
307
    path = "third_party/fbgemm",
308
)
309

310
local_repository(
311
    name = "unused_ftm_bazel",
312
    path = "third_party/fmt/support/bazel",
313
)
314

315
local_repository(
316
    name = "unused_kineto_fmt_bazel",
317
    path = "third_party/kineto/libkineto/third_party/fmt/support/bazel",
318
)
319

320
local_repository(
321
    name = "unused_kineto_dynolog_googletest",
322
    path = "third_party/kineto/libkineto/third_party/dynolog/third_party/googletest",
323
)
324

325
local_repository(
326
    name = "unused_kineto_dynolog_gflags",
327
    path = "third_party/kineto/libkineto/third_party/dynolog/third_party/gflags",
328
)
329

330
local_repository(
331
    name = "unused_kineto_dynolog_glog",
332
    path = "third_party/kineto/libkineto/third_party/dynolog/third_party/glog",
333
)
334

335
local_repository(
336
    name = "unused_kineto_googletest",
337
    path = "third_party/kineto/libkineto/third_party/googletest",
338
)
339

340
local_repository(
341
    name = "unused_onnx_benchmark",
342
    path = "third_party/onnx/third_party/benchmark",
343
)
344

345
local_repository(
346
    name = "unused_onnx_tensorrt_benchmark",
347
    path = "third_party/onnx-tensorrt/third_party/onnx/third_party/benchmark",
348
)
349

350
### Unused repos end
351

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.