|
| 1 | +workspace(name = "Torch-TensorRT") |
| 2 | + |
| 3 | +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| 4 | + |
| 5 | +http_archive( |
| 6 | + name = "rules_python", |
| 7 | + sha256 = "863ba0fa944319f7e3d695711427d9ad80ba92c6edd0b7c7443b84e904689539", |
| 8 | + strip_prefix = "rules_python-0.22.0", |
| 9 | + url = "https://github.com/bazelbuild/rules_python/releases/download/0.22.0/rules_python-0.22.0.tar.gz", |
| 10 | +) |
| 11 | + |
| 12 | +load("@rules_python//python:repositories.bzl", "py_repositories") |
| 13 | + |
| 14 | +py_repositories() |
| 15 | + |
| 16 | +http_archive( |
| 17 | + name = "rules_pkg", |
| 18 | + sha256 = "8f9ee2dc10c1ae514ee599a8b42ed99fa262b757058f65ad3c384289ff70c4b8", |
| 19 | + urls = [ |
| 20 | + "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.9.1/rules_pkg-0.9.1.tar.gz", |
| 21 | + "https://github.com/bazelbuild/rules_pkg/releases/download/0.9.1/rules_pkg-0.9.1.tar.gz", |
| 22 | + ], |
| 23 | +) |
| 24 | + |
| 25 | +load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") |
| 26 | + |
| 27 | +rules_pkg_dependencies() |
| 28 | + |
| 29 | +http_archive( |
| 30 | + name = "googletest", |
| 31 | + sha256 = "755f9a39bc7205f5a0c428e920ddad092c33c8a1b46997def3f1d4a82aded6e1", |
| 32 | + strip_prefix = "googletest-5ab508a01f9eb089207ee87fd547d290da39d015", |
| 33 | + urls = ["https://github.com/google/googletest/archive/5ab508a01f9eb089207ee87fd547d290da39d015.zip"], |
| 34 | +) |
| 35 | + |
| 36 | +# External dependency for torch_tensorrt if you already have precompiled binaries. |
| 37 | +local_repository( |
| 38 | + name = "torch_tensorrt", |
| 39 | + path = "/opt/circleci/.pyenv/versions/3.10.9/lib/python3.10/site-packages/torch_tensorrt" |
| 40 | +) |
| 41 | + |
| 42 | +# CUDA should be installed on the system locally |
| 43 | +new_local_repository( |
| 44 | + name = "cuda", |
| 45 | + build_file = "@//third_party/cuda:BUILD", |
| 46 | + path = "/usr/local/cuda-12.1", |
| 47 | +) |
| 48 | + |
| 49 | +new_local_repository( |
| 50 | + name = "cublas", |
| 51 | + build_file = "@//third_party/cublas:BUILD", |
| 52 | + path = "/usr", |
| 53 | +) |
| 54 | +############################################################################################################# |
| 55 | +# Tarballs and fetched dependencies (default - use in cases when building from precompiled bin and tarballs) |
| 56 | +############################################################################################################# |
| 57 | + |
| 58 | +http_archive( |
| 59 | + name = "libtorch", |
| 60 | + build_file = "@//third_party/libtorch:BUILD", |
| 61 | + sha256 = "174579a7ee2a506d063714160c5fc57da428f7935311ef511c8f19820eb14c86", |
| 62 | + strip_prefix = "libtorch", |
| 63 | + urls = ["https://download.pytorch.org/libtorch/nightly/cu121/libtorch-cxx11-abi-shared-with-deps-2.1.0.dev20230731%2Bcu121.zip"], |
| 64 | +) |
| 65 | + |
| 66 | +http_archive( |
| 67 | + name = "libtorch_pre_cxx11_abi", |
| 68 | + build_file = "@//third_party/libtorch:BUILD", |
| 69 | + sha256 = "532217063c65354d5534211badadc9c370d889cb1c3fdb295c9b3d0f181bc0ba", |
| 70 | + strip_prefix = "libtorch", |
| 71 | + urls = ["https://download.pytorch.org/libtorch/nightly/cu121/libtorch-shared-with-deps-2.1.0.dev20230731%2Bcu121.zip"], |
| 72 | +) |
| 73 | + |
| 74 | +#################################################################################### |
| 75 | +# Locally installed dependencies (use in cases of custom dependencies or aarch64) |
| 76 | +#################################################################################### |
| 77 | + |
| 78 | +new_local_repository( |
| 79 | + name = "cudnn", |
| 80 | + path = "/usr/", |
| 81 | + build_file = "@//third_party/cudnn/local:BUILD" |
| 82 | +) |
| 83 | + |
| 84 | +new_local_repository( |
| 85 | + name = "tensorrt", |
| 86 | + path = "/usr/", |
| 87 | + build_file = "@//third_party/tensorrt/local:BUILD" |
| 88 | +) |
| 89 | + |
| 90 | +# ######################################################################### |
| 91 | +# # Testing Dependencies (optional - comment out on aarch64) |
| 92 | +# ######################################################################### |
| 93 | + |
| 94 | +load("@rules_python//python:pip.bzl", "pip_parse") |
| 95 | + |
| 96 | +pip_parse( |
| 97 | + name = "devtools_deps", |
| 98 | + requirements = "//:requirements-dev.txt", |
| 99 | +) |
| 100 | + |
| 101 | +load("@devtools_deps//:requirements.bzl", "install_deps") |
| 102 | + |
| 103 | +install_deps() |
0 commit comments