George Gensure | 447bcd3 | 2020-04-06 22:48:33 -0700 | [diff] [blame] | 1 | workspace(name = "pytorch") |
| 2 | |
| 3 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
Thuyen Ngo | e35bf56 | 2021-12-17 13:41:24 -0800 | [diff] [blame] | 4 | load("//tools/rules:workspace.bzl", "new_patched_local_repository") |
| 5 | |
| 6 | http_archive( |
Sergei Vorobev | 447f5b5 | 2023-02-28 03:51:08 +0000 | [diff] [blame] | 7 | name = "rules_cc", |
Sergei Vorobev | 447f5b5 | 2023-02-28 03:51:08 +0000 | [diff] [blame] | 8 | patches = [ |
| 9 | "//:tools/rules_cc/cuda_support.patch", |
| 10 | ], |
mikey dagitses | 47d3136 | 2023-05-16 14:53:23 +0000 | [diff] [blame] | 11 | strip_prefix = "rules_cc-40548a2974f1aea06215272d9c2b47a14a24e556", |
Sergei Vorobev | 447f5b5 | 2023-02-28 03:51:08 +0000 | [diff] [blame] | 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( |
Thuyen Ngo | e35bf56 | 2021-12-17 13:41:24 -0800 | [diff] [blame] | 19 | name = "rules_cuda", |
Thuyen Ngo | e35bf56 | 2021-12-17 13:41:24 -0800 | [diff] [blame] | 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 | |
Sergei Vorobev | 447f5b5 | 2023-02-28 03:51:08 +0000 | [diff] [blame] | 26 | rules_cuda_dependencies(with_rules_cc = False) |
Thuyen Ngo | e35bf56 | 2021-12-17 13:41:24 -0800 | [diff] [blame] | 27 | |
| 28 | load("@rules_cc//cc:repositories.bzl", "rules_cc_toolchains") |
| 29 | |
| 30 | rules_cc_toolchains() |
George Gensure | 447bcd3 | 2020-04-06 22:48:33 -0700 | [diff] [blame] | 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( |
mikey dagitses | 47d3136 | 2023-05-16 14:53:23 +0000 | [diff] [blame] | 40 | name = "pybind11_bazel", |
mikey dagitses | 9bbee24 | 2023-05-23 06:20:33 +0000 | [diff] [blame] | 41 | strip_prefix = "pybind11_bazel-b162c7c88a253e3f6b673df0c621aca27596ce6b", |
| 42 | urls = ["https://github.com/pybind/pybind11_bazel/archive/b162c7c88a253e3f6b673df0c621aca27596ce6b.zip"], |
George Gensure | 447bcd3 | 2020-04-06 22:48:33 -0700 | [diff] [blame] | 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", |
Sergei Vorobev | 630593d | 2023-05-12 19:43:56 +0000 | [diff] [blame] | 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) |
mikey dagitses | 47d3136 | 2023-05-16 14:53:23 +0000 | [diff] [blame] | 59 | """, |
| 60 | strip_prefix = "glog-0.4.0", |
| 61 | urls = [ |
| 62 | "https://github.com/google/glog/archive/v0.4.0.tar.gz", |
| 63 | ], |
George Gensure | 447bcd3 | 2020-04-06 22:48:33 -0700 | [diff] [blame] | 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 | ], |
George Gensure | 447bcd3 | 2020-04-06 22:48:33 -0700 | [diff] [blame] | 72 | ) |
| 73 | |
Chirag Pandya | fd90991 | 2024-04-21 15:20:21 +0000 | [diff] [blame] | 74 | http_archive( |
| 75 | name = "com_github_opentelemetry-cpp", |
| 76 | urls = [ |
| 77 | "https://github.com/open-telemetry/opentelemetry-cpp/archive/refs/tags/v1.14.2.tar.gz", |
| 78 | ], |
| 79 | ) |
| 80 | |
George Gensure | 447bcd3 | 2020-04-06 22:48:33 -0700 | [diff] [blame] | 81 | new_local_repository( |
| 82 | name = "gloo", |
| 83 | build_file = "//third_party:gloo.BUILD", |
| 84 | path = "third_party/gloo", |
| 85 | ) |
| 86 | |
| 87 | new_local_repository( |
| 88 | name = "onnx", |
| 89 | build_file = "//third_party:onnx.BUILD", |
| 90 | path = "third_party/onnx", |
| 91 | ) |
| 92 | |
George Gensure | 447bcd3 | 2020-04-06 22:48:33 -0700 | [diff] [blame] | 93 | local_repository( |
| 94 | name = "com_google_protobuf", |
| 95 | path = "third_party/protobuf", |
| 96 | ) |
| 97 | |
| 98 | new_local_repository( |
| 99 | name = "eigen", |
| 100 | build_file = "//third_party:eigen.BUILD", |
| 101 | path = "third_party/eigen", |
| 102 | ) |
| 103 | |
| 104 | new_local_repository( |
Christian Puhrsch | f6c6048 | 2022-10-18 23:11:47 +0000 | [diff] [blame] | 105 | name = "cutlass", |
| 106 | build_file = "//third_party:cutlass.BUILD", |
| 107 | path = "third_party/cutlass", |
| 108 | ) |
| 109 | |
| 110 | new_local_repository( |
George Gensure | 447bcd3 | 2020-04-06 22:48:33 -0700 | [diff] [blame] | 111 | name = "fbgemm", |
Nikita Shulga | 5a7f889 | 2020-04-13 15:59:48 -0700 | [diff] [blame] | 112 | build_file = "//third_party:fbgemm/BUILD.bazel", |
George Gensure | 447bcd3 | 2020-04-06 22:48:33 -0700 | [diff] [blame] | 113 | path = "third_party/fbgemm", |
mikey dagitses | 47d3136 | 2023-05-16 14:53:23 +0000 | [diff] [blame] | 114 | repo_mapping = {"@cpuinfo": "@org_pytorch_cpuinfo"}, |
George Gensure | 447bcd3 | 2020-04-06 22:48:33 -0700 | [diff] [blame] | 115 | ) |
| 116 | |
| 117 | new_local_repository( |
| 118 | name = "ideep", |
| 119 | build_file = "//third_party:ideep.BUILD", |
| 120 | path = "third_party/ideep", |
| 121 | ) |
| 122 | |
| 123 | new_local_repository( |
| 124 | name = "mkl_dnn", |
| 125 | build_file = "//third_party:mkl-dnn.BUILD", |
| 126 | path = "third_party/ideep/mkl-dnn", |
| 127 | ) |
| 128 | |
| 129 | new_local_repository( |
Huy Do | f0ee21f | 2022-08-20 06:16:54 +0000 | [diff] [blame] | 130 | name = "org_pytorch_cpuinfo", |
| 131 | build_file = "//third_party:cpuinfo/BUILD.bazel", |
George Gensure | 447bcd3 | 2020-04-06 22:48:33 -0700 | [diff] [blame] | 132 | path = "third_party/cpuinfo", |
| 133 | ) |
| 134 | |
| 135 | new_local_repository( |
| 136 | name = "asmjit", |
Nikita Shulga | 5a7f889 | 2020-04-13 15:59:48 -0700 | [diff] [blame] | 137 | build_file = "//third_party:fbgemm/third_party/asmjit.BUILD", |
George Gensure | 447bcd3 | 2020-04-06 22:48:33 -0700 | [diff] [blame] | 138 | path = "third_party/fbgemm/third_party/asmjit", |
| 139 | ) |
| 140 | |
| 141 | new_local_repository( |
| 142 | name = "sleef", |
| 143 | build_file = "//third_party:sleef.BUILD", |
| 144 | path = "third_party/sleef", |
| 145 | ) |
| 146 | |
Michael Suo | 68895ed | 2020-04-29 09:03:31 -0700 | [diff] [blame] | 147 | new_local_repository( |
| 148 | name = "fmt", |
| 149 | build_file = "//third_party:fmt.BUILD", |
| 150 | path = "third_party/fmt", |
| 151 | ) |
| 152 | |
Taylor Robie | 9d3c35d | 2022-07-14 18:35:53 -0700 | [diff] [blame] | 153 | new_local_repository( |
| 154 | name = "kineto", |
| 155 | build_file = "//third_party:kineto.BUILD", |
| 156 | path = "third_party/kineto", |
| 157 | ) |
| 158 | |
Chirag Pandya | fd90991 | 2024-04-21 15:20:21 +0000 | [diff] [blame] | 159 | new_local_repository( |
| 160 | name = "opentelemetry-cpp", |
| 161 | build_file = "//third_party::opentelemetry-cpp.BUILD", |
| 162 | path = "third_party/opentelemetry-cpp", |
| 163 | ) |
| 164 | |
Luca Wehrstedt | 5baa6b6 | 2020-05-02 01:22:18 -0700 | [diff] [blame] | 165 | new_local_repository( |
Tristan Rice | 597922b | 2024-06-04 19:44:30 +0000 | [diff] [blame] | 166 | name = "cpp-httplib", |
| 167 | build_file = "//third_party:cpp-httplib.BUILD", |
| 168 | path = "third_party/cpp-httplib", |
| 169 | ) |
| 170 | |
| 171 | new_local_repository( |
Chirag Pandya | 64f1111 | 2024-06-26 21:59:23 +0000 | [diff] [blame] | 172 | name = "nlohmann", |
| 173 | build_file = "//third_party:nlohmann.BUILD", |
| 174 | path = "third_party/nlohmann", |
| 175 | ) |
| 176 | |
| 177 | new_local_repository( |
Luca Wehrstedt | 5baa6b6 | 2020-05-02 01:22:18 -0700 | [diff] [blame] | 178 | name = "tensorpipe", |
| 179 | build_file = "//third_party:tensorpipe.BUILD", |
| 180 | path = "third_party/tensorpipe", |
| 181 | ) |
| 182 | |
George Gensure | 447bcd3 | 2020-04-06 22:48:33 -0700 | [diff] [blame] | 183 | http_archive( |
| 184 | name = "mkl", |
| 185 | build_file = "//third_party:mkl.BUILD", |
George Gensure | 447bcd3 | 2020-04-06 22:48:33 -0700 | [diff] [blame] | 186 | sha256 = "59154b30dd74561e90d547f9a3af26c75b6f4546210888f09c9d4db8f4bf9d4c", |
mikey dagitses | 47d3136 | 2023-05-16 14:53:23 +0000 | [diff] [blame] | 187 | strip_prefix = "lib", |
George Gensure | 447bcd3 | 2020-04-06 22:48:33 -0700 | [diff] [blame] | 188 | urls = [ |
| 189 | "https://anaconda.org/anaconda/mkl/2020.0/download/linux-64/mkl-2020.0-166.tar.bz2", |
| 190 | ], |
| 191 | ) |
| 192 | |
| 193 | http_archive( |
| 194 | name = "mkl_headers", |
| 195 | build_file = "//third_party:mkl_headers.BUILD", |
| 196 | sha256 = "2af3494a4bebe5ddccfdc43bacc80fcd78d14c1954b81d2c8e3d73b55527af90", |
| 197 | urls = [ |
| 198 | "https://anaconda.org/anaconda/mkl-include/2020.0/download/linux-64/mkl-include-2020.0-166.tar.bz2", |
| 199 | ], |
| 200 | ) |
| 201 | |
| 202 | http_archive( |
| 203 | name = "rules_python", |
mikey dagitses | 9bbee24 | 2023-05-23 06:20:33 +0000 | [diff] [blame] | 204 | # TODO Fix bazel linter to support hashes for release tarballs. |
| 205 | # |
| 206 | # sha256 = "94750828b18044533e98a129003b6a68001204038dc4749f40b195b24c38f49f", |
| 207 | strip_prefix = "rules_python-0.21.0", |
| 208 | url = "https://github.com/bazelbuild/rules_python/releases/download/0.21.0/rules_python-0.21.0.tar.gz", |
George Gensure | 447bcd3 | 2020-04-06 22:48:33 -0700 | [diff] [blame] | 209 | ) |
| 210 | |
mikey dagitses | 9bbee24 | 2023-05-23 06:20:33 +0000 | [diff] [blame] | 211 | load("@rules_python//python:repositories.bzl", "py_repositories") |
| 212 | |
| 213 | py_repositories() |
| 214 | |
| 215 | load("@rules_python//python:repositories.bzl", "python_register_toolchains") |
| 216 | |
| 217 | python_register_toolchains( |
Nikita Shulga | 95a090f | 2024-04-15 20:39:50 +0000 | [diff] [blame] | 218 | name = "python3_10", |
| 219 | python_version = "3.10", |
mikey dagitses | 9bbee24 | 2023-05-23 06:20:33 +0000 | [diff] [blame] | 220 | ) |
| 221 | |
Nikita Shulga | 95a090f | 2024-04-15 20:39:50 +0000 | [diff] [blame] | 222 | load("@python3_10//:defs.bzl", "interpreter") |
mikey dagitses | 9bbee24 | 2023-05-23 06:20:33 +0000 | [diff] [blame] | 223 | load("@rules_python//python:pip.bzl", "pip_parse") |
| 224 | |
| 225 | pip_parse( |
| 226 | name = "pip_deps", |
| 227 | python_interpreter_target = interpreter, |
| 228 | requirements_lock = "//:tools/build/bazel/requirements.txt", |
| 229 | ) |
| 230 | |
| 231 | load("@pip_deps//:requirements.bzl", "install_deps") |
| 232 | |
| 233 | install_deps() |
| 234 | |
George Gensure | 447bcd3 | 2020-04-06 22:48:33 -0700 | [diff] [blame] | 235 | load("@pybind11_bazel//:python_configure.bzl", "python_configure") |
mikey dagitses | 47d3136 | 2023-05-16 14:53:23 +0000 | [diff] [blame] | 236 | |
| 237 | python_configure( |
| 238 | name = "local_config_python", |
mikey dagitses | 9bbee24 | 2023-05-23 06:20:33 +0000 | [diff] [blame] | 239 | python_interpreter_target = interpreter, |
mikey dagitses | 47d3136 | 2023-05-16 14:53:23 +0000 | [diff] [blame] | 240 | ) |
George Gensure | 447bcd3 | 2020-04-06 22:48:33 -0700 | [diff] [blame] | 241 | |
| 242 | load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") |
| 243 | |
| 244 | protobuf_deps() |
| 245 | |
Thuyen Ngo | e35bf56 | 2021-12-17 13:41:24 -0800 | [diff] [blame] | 246 | new_local_repository( |
| 247 | name = "cuda", |
| 248 | build_file = "@//third_party:cuda.BUILD", |
| 249 | path = "/usr/local/cuda", |
Sergei Vorobev | f922b58 | 2021-08-27 09:31:36 -0700 | [diff] [blame] | 250 | ) |
| 251 | |
Thuyen Ngo | e35bf56 | 2021-12-17 13:41:24 -0800 | [diff] [blame] | 252 | new_local_repository( |
| 253 | name = "cudnn", |
| 254 | build_file = "@//third_party:cudnn.BUILD", |
Nikita Shulga | 4ea7430 | 2023-12-15 09:47:10 +0000 | [diff] [blame] | 255 | path = "/usr/local/cuda", |
Sergei Vorobev | f922b58 | 2021-08-27 09:31:36 -0700 | [diff] [blame] | 256 | ) |
Han Qi | 1bc3571 | 2022-01-12 16:27:21 -0800 | [diff] [blame] | 257 | |
Eddie Yan | ba06951 | 2024-01-03 15:41:28 +0000 | [diff] [blame] | 258 | new_local_repository( |
| 259 | name = "cudnn_frontend", |
| 260 | build_file = "@//third_party:cudnn_frontend.BUILD", |
| 261 | path = "third_party/cudnn_frontend/", |
| 262 | ) |
| 263 | |
Han Qi | 1bc3571 | 2022-01-12 16:27:21 -0800 | [diff] [blame] | 264 | local_repository( |
| 265 | name = "com_github_google_flatbuffers", |
| 266 | path = "third_party/flatbuffers", |
| 267 | ) |
Sergei Vorobev | a0a23c6 | 2022-06-06 21:58:47 +0000 | [diff] [blame] | 268 | |
| 269 | local_repository( |
| 270 | name = "google_benchmark", |
| 271 | path = "third_party/benchmark", |
| 272 | ) |
| 273 | |
| 274 | local_repository( |
| 275 | name = "com_google_googletest", |
| 276 | path = "third_party/googletest", |
| 277 | ) |
| 278 | |
| 279 | local_repository( |
| 280 | name = "pthreadpool", |
| 281 | path = "third_party/pthreadpool", |
mikey dagitses | 47d3136 | 2023-05-16 14:53:23 +0000 | [diff] [blame] | 282 | repo_mapping = {"@com_google_benchmark": "@google_benchmark"}, |
Sergei Vorobev | a0a23c6 | 2022-06-06 21:58:47 +0000 | [diff] [blame] | 283 | ) |
| 284 | |
| 285 | local_repository( |
| 286 | name = "FXdiv", |
| 287 | path = "third_party/FXdiv", |
mikey dagitses | 47d3136 | 2023-05-16 14:53:23 +0000 | [diff] [blame] | 288 | repo_mapping = {"@com_google_benchmark": "@google_benchmark"}, |
Sergei Vorobev | a0a23c6 | 2022-06-06 21:58:47 +0000 | [diff] [blame] | 289 | ) |
| 290 | |
| 291 | local_repository( |
| 292 | name = "XNNPACK", |
| 293 | path = "third_party/XNNPACK", |
mikey dagitses | 47d3136 | 2023-05-16 14:53:23 +0000 | [diff] [blame] | 294 | repo_mapping = {"@com_google_benchmark": "@google_benchmark"}, |
Sergei Vorobev | a0a23c6 | 2022-06-06 21:58:47 +0000 | [diff] [blame] | 295 | ) |
| 296 | |
| 297 | local_repository( |
| 298 | name = "gemmlowp", |
| 299 | path = "third_party/gemmlowp/gemmlowp", |
| 300 | ) |
| 301 | |
| 302 | ### Unused repos start |
| 303 | |
| 304 | # `unused` repos are defined to hide bazel files from submodules of submodules. |
| 305 | # This allows us to run `bazel build //...` and not worry about the submodules madness. |
| 306 | # Otherwise everything traverses recursively and a lot of submodules of submodules have |
| 307 | # they own bazel build files. |
| 308 | |
| 309 | local_repository( |
| 310 | name = "unused_tensorpipe_googletest", |
| 311 | path = "third_party/tensorpipe/third_party/googletest", |
| 312 | ) |
| 313 | |
| 314 | local_repository( |
| 315 | name = "unused_fbgemm", |
| 316 | path = "third_party/fbgemm", |
| 317 | ) |
| 318 | |
| 319 | local_repository( |
cyy | a405c69 | 2023-02-08 17:21:35 +0000 | [diff] [blame] | 320 | name = "unused_ftm_bazel", |
| 321 | path = "third_party/fmt/support/bazel", |
| 322 | ) |
| 323 | |
| 324 | local_repository( |
Aaron Enye Shi | a530446 | 2023-02-25 19:26:08 +0000 | [diff] [blame] | 325 | name = "unused_kineto_fmt_bazel", |
| 326 | path = "third_party/kineto/libkineto/third_party/fmt/support/bazel", |
| 327 | ) |
| 328 | |
| 329 | local_repository( |
bcoutinho | 42d4eca | 2023-01-28 02:26:28 +0000 | [diff] [blame] | 330 | name = "unused_kineto_dynolog_googletest", |
| 331 | path = "third_party/kineto/libkineto/third_party/dynolog/third_party/googletest", |
| 332 | ) |
| 333 | |
| 334 | local_repository( |
| 335 | name = "unused_kineto_dynolog_gflags", |
| 336 | path = "third_party/kineto/libkineto/third_party/dynolog/third_party/gflags", |
| 337 | ) |
| 338 | |
| 339 | local_repository( |
| 340 | name = "unused_kineto_dynolog_glog", |
| 341 | path = "third_party/kineto/libkineto/third_party/dynolog/third_party/glog", |
| 342 | ) |
| 343 | |
| 344 | local_repository( |
Sergei Vorobev | a0a23c6 | 2022-06-06 21:58:47 +0000 | [diff] [blame] | 345 | name = "unused_kineto_googletest", |
| 346 | path = "third_party/kineto/libkineto/third_party/googletest", |
| 347 | ) |
| 348 | |
| 349 | local_repository( |
| 350 | name = "unused_onnx_benchmark", |
| 351 | path = "third_party/onnx/third_party/benchmark", |
| 352 | ) |
| 353 | |
Sergei Vorobev | a0a23c6 | 2022-06-06 21:58:47 +0000 | [diff] [blame] | 354 | ### Unused repos end |