blob: d26dfca5a3336f372a2ceb0da5063d3d4181994f [file] [log] [blame]
George Gensure447bcd32020-04-06 22:48:33 -07001workspace(name = "pytorch")
2
3load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
Thuyen Ngoe35bf562021-12-17 13:41:24 -08004load("//tools/rules:workspace.bzl", "new_patched_local_repository")
5
6http_archive(
7 name = "rules_cuda",
8 sha256 = "f80438bee9906e9ecb1a8a4ae2365374ac1e8a283897281a2db2fb7fcf746333",
9 strip_prefix = "runtime-b1c7cce21ba4661c17ac72421c6a0e2015e7bef3/third_party/rules_cuda",
10 urls = ["https://github.com/tensorflow/runtime/archive/b1c7cce21ba4661c17ac72421c6a0e2015e7bef3.tar.gz"],
11)
12
13load("@rules_cuda//cuda:dependencies.bzl", "rules_cuda_dependencies")
14
15rules_cuda_dependencies()
16
17load("@rules_cc//cc:repositories.bzl", "rules_cc_toolchains")
18
19rules_cc_toolchains()
George Gensure447bcd32020-04-06 22:48:33 -070020
21http_archive(
22 name = "bazel_skylib",
23 urls = [
24 "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz",
25 ],
26)
27
28http_archive(
George Gensure447bcd32020-04-06 22:48:33 -070029 name = "pybind11_bazel",
Sergei Vorobeva0a23c62022-06-06 21:58:47 +000030 strip_prefix = "pybind11_bazel-992381ced716ae12122360b0fbadbc3dda436dbf",
31 urls = ["https://github.com/pybind/pybind11_bazel/archive/992381ced716ae12122360b0fbadbc3dda436dbf.zip"],
32 sha256 = "3dc6435bd41c058453efe102995ef084d0a86b0176fd6a67a6b7100a2e9a940e",
George Gensure447bcd32020-04-06 22:48:33 -070033)
34
35new_local_repository(
36 name = "pybind11",
37 build_file = "@pybind11_bazel//:pybind11.BUILD",
38 path = "third_party/pybind11",
39)
40
41http_archive(
42 name = "com_github_glog",
43 strip_prefix = "glog-0.4.0",
44 urls = [
45 "https://github.com/google/glog/archive/v0.4.0.tar.gz",
46 ],
47)
48
49http_archive(
50 name = "com_github_gflags_gflags",
51 strip_prefix = "gflags-2.2.2",
52 urls = [
53 "https://github.com/gflags/gflags/archive/v2.2.2.tar.gz",
54 ],
55 sha256 = "34af2f15cf7367513b352bdcd2493ab14ce43692d2dcd9dfc499492966c64dcf",
56)
57
58new_local_repository(
59 name = "gloo",
60 build_file = "//third_party:gloo.BUILD",
61 path = "third_party/gloo",
62)
63
64new_local_repository(
65 name = "onnx",
66 build_file = "//third_party:onnx.BUILD",
67 path = "third_party/onnx",
68)
69
70new_local_repository(
71 name = "foxi",
72 build_file = "//third_party:foxi.BUILD",
73 path = "third_party/foxi",
74)
75
76local_repository(
77 name = "com_google_protobuf",
78 path = "third_party/protobuf",
79)
80
81new_local_repository(
82 name = "eigen",
83 build_file = "//third_party:eigen.BUILD",
84 path = "third_party/eigen",
85)
86
87new_local_repository(
88 name = "fbgemm",
Nikita Shulga5a7f8892020-04-13 15:59:48 -070089 build_file = "//third_party:fbgemm/BUILD.bazel",
George Gensure447bcd32020-04-06 22:48:33 -070090 path = "third_party/fbgemm",
91)
92
93new_local_repository(
94 name = "ideep",
95 build_file = "//third_party:ideep.BUILD",
96 path = "third_party/ideep",
97)
98
99new_local_repository(
100 name = "mkl_dnn",
101 build_file = "//third_party:mkl-dnn.BUILD",
102 path = "third_party/ideep/mkl-dnn",
103)
104
105new_local_repository(
106 name = "cpuinfo",
107 build_file = "//third_party:cpuinfo.BUILD",
108 path = "third_party/cpuinfo",
109)
110
111new_local_repository(
112 name = "asmjit",
Nikita Shulga5a7f8892020-04-13 15:59:48 -0700113 build_file = "//third_party:fbgemm/third_party/asmjit.BUILD",
George Gensure447bcd32020-04-06 22:48:33 -0700114 path = "third_party/fbgemm/third_party/asmjit",
115)
116
117new_local_repository(
118 name = "sleef",
119 build_file = "//third_party:sleef.BUILD",
120 path = "third_party/sleef",
121)
122
Michael Suo68895ed2020-04-29 09:03:31 -0700123new_local_repository(
124 name = "fmt",
125 build_file = "//third_party:fmt.BUILD",
126 path = "third_party/fmt",
127)
128
Taylor Robie9d3c35d2022-07-14 18:35:53 -0700129new_local_repository(
130 name = "kineto",
131 build_file = "//third_party:kineto.BUILD",
132 path = "third_party/kineto",
133)
134
George Gensure447bcd32020-04-06 22:48:33 -0700135new_patched_local_repository(
136 name = "tbb",
137 patches = [
138 "@//third_party:tbb.patch",
139 ],
140 patch_strip = 1,
141 build_file = "//third_party:tbb.BUILD",
142 path = "third_party/tbb",
143)
144
Luca Wehrstedt5baa6b62020-05-02 01:22:18 -0700145new_local_repository(
146 name = "tensorpipe",
147 build_file = "//third_party:tensorpipe.BUILD",
148 path = "third_party/tensorpipe",
149)
150
George Gensure447bcd32020-04-06 22:48:33 -0700151http_archive(
152 name = "mkl",
153 build_file = "//third_party:mkl.BUILD",
154 strip_prefix = "lib",
155 sha256 = "59154b30dd74561e90d547f9a3af26c75b6f4546210888f09c9d4db8f4bf9d4c",
156 urls = [
157 "https://anaconda.org/anaconda/mkl/2020.0/download/linux-64/mkl-2020.0-166.tar.bz2",
158 ],
159)
160
161http_archive(
162 name = "mkl_headers",
163 build_file = "//third_party:mkl_headers.BUILD",
164 sha256 = "2af3494a4bebe5ddccfdc43bacc80fcd78d14c1954b81d2c8e3d73b55527af90",
165 urls = [
166 "https://anaconda.org/anaconda/mkl-include/2020.0/download/linux-64/mkl-include-2020.0-166.tar.bz2",
167 ],
168)
169
170http_archive(
171 name = "rules_python",
172 url = "https://github.com/bazelbuild/rules_python/releases/download/0.0.1/rules_python-0.0.1.tar.gz",
173 sha256 = "aa96a691d3a8177f3215b14b0edc9641787abaaa30363a080165d06ab65e1161",
174)
175
176load("@pybind11_bazel//:python_configure.bzl", "python_configure")
Sergei Vorobeva0a23c62022-06-06 21:58:47 +0000177python_configure(name = "local_config_python", python_version="3")
George Gensure447bcd32020-04-06 22:48:33 -0700178
179load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
180
181protobuf_deps()
182
183load("@rules_python//python:repositories.bzl", "py_repositories")
184
185py_repositories()
Sergei Vorobevf922b582021-08-27 09:31:36 -0700186
Thuyen Ngoe35bf562021-12-17 13:41:24 -0800187new_local_repository(
188 name = "cuda",
189 build_file = "@//third_party:cuda.BUILD",
190 path = "/usr/local/cuda",
Sergei Vorobevf922b582021-08-27 09:31:36 -0700191)
192
Thuyen Ngoe35bf562021-12-17 13:41:24 -0800193new_local_repository(
194 name = "cudnn",
195 build_file = "@//third_party:cudnn.BUILD",
196 path = "/usr/",
Sergei Vorobevf922b582021-08-27 09:31:36 -0700197)
Han Qi1bc35712022-01-12 16:27:21 -0800198
199local_repository(
200 name = "com_github_google_flatbuffers",
201 path = "third_party/flatbuffers",
202)
Sergei Vorobeva0a23c62022-06-06 21:58:47 +0000203
204local_repository(
205 name = "google_benchmark",
206 path = "third_party/benchmark",
207)
208
209local_repository(
210 name = "com_google_googletest",
211 path = "third_party/googletest",
212)
213
214local_repository(
215 name = "pthreadpool",
216 path = "third_party/pthreadpool",
217 repo_mapping = {"@com_google_benchmark" : "@google_benchmark"}
218)
219
220local_repository(
221 name = "FXdiv",
222 path = "third_party/FXdiv",
223 repo_mapping = {"@com_google_benchmark" : "@google_benchmark"}
224)
225
226local_repository(
227 name = "XNNPACK",
228 path = "third_party/XNNPACK",
229 repo_mapping = {"@com_google_benchmark" : "@google_benchmark"}
230)
231
232local_repository(
233 name = "gemmlowp",
234 path = "third_party/gemmlowp/gemmlowp",
235)
236
237### Unused repos start
238
239# `unused` repos are defined to hide bazel files from submodules of submodules.
240# This allows us to run `bazel build //...` and not worry about the submodules madness.
241# Otherwise everything traverses recursively and a lot of submodules of submodules have
242# they own bazel build files.
243
244local_repository(
245 name = "unused_tensorpipe_googletest",
246 path = "third_party/tensorpipe/third_party/googletest",
247)
248
249local_repository(
250 name = "unused_fbgemm",
251 path = "third_party/fbgemm",
252)
253
254local_repository(
255 name = "unused_kineto_googletest",
256 path = "third_party/kineto/libkineto/third_party/googletest",
257)
258
259local_repository(
260 name = "unused_onnx_benchmark",
261 path = "third_party/onnx/third_party/benchmark",
262)
263
264local_repository(
265 name = "unused_onnx_tensorrt_benchmark",
266 path = "third_party/onnx-tensorrt/third_party/onnx/third_party/benchmark",
267)
268
269### Unused repos end