Skip to content

Commit 7673be2

Browse files
committed
fix: Upgrade to PyTorch 2.0.1 + Other improvements
- Add support for `--legacy` flag in `setup.py`, to enable installation with PyTorch 1.13.1 - Add in test cases previously disabled due to dependency issues - Improve documentation of `README`s across repository - Update cudnn version to 8.8, update TRT version to 8.6 across all files and `README`s - Update `docker` folder on release branch to use new build system with custom TRT, cudnn, CUDA, and Python versions - Update `WORKSPACE` files to use Torch 2.0.1 Release Candidate
1 parent e2184bc commit 7673be2

File tree

16 files changed

+141
-113
lines changed

16 files changed

+141
-113
lines changed

.circleci/config.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ commands:
102102
sudo apt-get --purge remove "*nvidia*"
103103
104104
install-cudnn:
105-
description: "Install CUDNN 8.5.0"
105+
description: "Install CUDNN 8.8.0"
106106
parameters:
107107
os:
108108
type: string
@@ -112,10 +112,10 @@ commands:
112112
default: "x86_64"
113113
cudnn-version:
114114
type: string
115-
default: "8.5.0.96"
115+
default: "8.8.0.121"
116116
cuda-version:
117117
type: string
118-
default: "cuda11.7"
118+
default: "cuda11.8"
119119
steps:
120120
- run:
121121
name: Install CUDNN
@@ -200,7 +200,7 @@ commands:
200200
default: "cuda11.8"
201201
cudnn-version:
202202
type: string
203-
default: "8.5.0.96"
203+
default: "8.8.0.121"
204204
trt-version-short:
205205
type: string
206206
default: "8.6.0"
@@ -252,7 +252,7 @@ commands:
252252
default: "8.6.0"
253253
cudnn-version-long:
254254
type: string
255-
default: "8.5.0.96"
255+
default: "8.8.0.121"
256256
steps:
257257
- run:
258258
name: Set up python environment
@@ -269,10 +269,10 @@ commands:
269269
parameters:
270270
torch-build:
271271
type: string
272-
default: "2.0.0"
272+
default: "2.0.1"
273273
torch-build-index:
274274
type: string
275-
default: "https://download.pytorch.org/whl/cu118"
275+
default: "https://download.pytorch.org/whl/test/cu118"
276276
steps:
277277
- run:
278278
name: Install Torch
@@ -474,6 +474,7 @@ commands:
474474
- run: mkdir -p /tmp/artifacts
475475
- run:
476476
name: Run core / C++ tests
477+
no_output_timeout: 15m
477478
environment:
478479
LD_LIBRARY_PATH: "/opt/circleci/.pyenv/versions/3.9.4/lib/python3.9/site-packages/torch_tensorrt.libs:/home/circleci/project/bazel-project/external/libtorch_pre_cxx11_abi/lib/:/home/circleci/project/bazel-project/external/tensorrt/lib/:/usr/local/cuda-11.8/lib64/:$LD_LIBRARY_PATH"
479480
command: |
@@ -1205,10 +1206,10 @@ parameters:
12051206
# Nightly platform config
12061207
torch-build:
12071208
type: string
1208-
default: "2.0.0"
1209+
default: "2.0.1"
12091210
torch-build-index:
12101211
type: string
1211-
default: "https://download.pytorch.org/whl/cu118"
1212+
default: "https://download.pytorch.org/whl/test/cu118"
12121213
torch-build-legacy:
12131214
type: string
12141215
default: "1.13.1+cu117"
@@ -1217,7 +1218,7 @@ parameters:
12171218
default: "https://download.pytorch.org/whl/cu117"
12181219
cudnn-version:
12191220
type: string
1220-
default: "8.5.0.96"
1221+
default: "8.8.0.121"
12211222
trt-version-short:
12221223
type: string
12231224
default: "8.6.0"
@@ -1412,4 +1413,3 @@ workflows:
14121413
trt-version-short: << pipeline.parameters.trt-version-short >>
14131414
cudnn-version: << pipeline.parameters.cudnn-version >>
14141415
python-version: << pipeline.parameters.python-version >>
1415-

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,7 @@ In the case of building on top of a custom base container, you first must determ
3131
version of the PyTorch C++ ABI. If your source of PyTorch is pytorch.org, likely this is the pre-cxx11-abi in which case you must modify `//docker/dist-build.sh` to not build the
3232
C++11 ABI version of Torch-TensorRT.
3333

34-
You can then build the container using:
35-
36-
37-
```bash
38-
docker build --build-arg BASE_IMG=<IMAGE> -f docker/Dockerfile -t torch_tensorrt:latest .
39-
```
34+
You can then build the container using the build command in the [docker README](docker/README.md#instructions)
4035

4136
If you would like to build outside a docker container, please follow the section [Compiling Torch-TensorRT](#compiling-torch-tensorrt)
4237

@@ -73,6 +68,7 @@ import torch_tensorrt
7368
...
7469
7570
trt_ts_module = torch_tensorrt.compile(torch_script_module,
71+
# If the inputs to the module are plain Tensors, specify them via the `inputs` argument:
7672
inputs = [example_tensor, # Provide example tensor for input shape or...
7773
torch_tensorrt.Input( # Specify input object with shape and dtype
7874
min_shape=[1, 3, 224, 224],
@@ -81,6 +77,12 @@ trt_ts_module = torch_tensorrt.compile(torch_script_module,
8177
# For static size shape=[1, 3, 224, 224]
8278
dtype=torch.half) # Datatype of input tensor. Allowed options torch.(float|half|int8|int32|bool)
8379
],
80+
81+
# For inputs containing tuples or lists of tensors, use the `input_signature` argument:
82+
# Below, we have an input consisting of a Tuple of two Tensors (Tuple[Tensor, Tensor])
83+
# input_signature = ( (torch_tensorrt.Input(shape=[1, 3, 224, 224], dtype=torch.half),
84+
# torch_tensorrt.Input(shape=[1, 3, 224, 224], dtype=torch.half)), ),
85+
8486
enabled_precisions = {torch.half}, # Run with FP16
8587
)
8688
@@ -114,17 +116,17 @@ torch.jit.save(trt_ts_module, "trt_torchscript_module.ts") # save the TRT embedd
114116
These are the following dependencies used to verify the testcases. Torch-TensorRT can work with other versions, but the tests are not guaranteed to pass.
115117

116118
- Bazel 5.2.0
117-
- Libtorch 2.0.0.dev20230103 (built with CUDA 11.7)
118-
- CUDA 11.7
119-
- cuDNN 8.5.0
120-
- TensorRT 8.5.1.7
119+
- Libtorch 2.0.1 (built with CUDA 11.8)
120+
- CUDA 11.8
121+
- cuDNN 8.8.0
122+
- TensorRT 8.6.0
121123

122124
## Prebuilt Binaries and Wheel files
123125

124126
Releases: https://github.com/pytorch/TensorRT/releases
125127

126128
```
127-
pip install torch-tensorrt==1.2.0 --find-links https://github.com/pytorch/TensorRT/releases/expanded_assets/v1.2.0
129+
pip install torch-tensorrt
128130
```
129131

130132
## Compiling Torch-TensorRT
@@ -245,7 +247,7 @@ A tarball with the include files and library can then be found in bazel-bin
245247
### Running Torch-TensorRT on a JIT Graph
246248

247249
> Make sure to add LibTorch to your LD_LIBRARY_PATH <br>
248-
> `export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/bazel-Torch-TensorRT/external/libtorch/lib`
250+
> `export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/bazel-TensorRT/external/libtorch/lib`
249251
250252
``` shell
251253
bazel run //cpp/bin/torchtrtc -- $(realpath <PATH TO GRAPH>) out.ts <input-size>

WORKSPACE

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@ new_local_repository(
5151
http_archive(
5252
name = "libtorch",
5353
build_file = "@//third_party/libtorch:BUILD",
54-
sha256 = "292b3f81e7c857fc102be93e2e44c40cdb4d8ef03d98121bc6af434c66e8490b",
54+
sha256 = "c5174f18c0866421a5738d389aaea0c02f32a1a5be5f0747dc8dd0d96034c9b0",
5555
strip_prefix = "libtorch",
56-
urls = ["https://download.pytorch.org/libtorch/cu118/libtorch-cxx11-abi-shared-with-deps-2.0.0%2Bcu118.zip"],
56+
urls = ["https://download.pytorch.org/libtorch/test/cu118/libtorch-cxx11-abi-shared-with-deps-latest.zip"],
5757
)
5858

5959
http_archive(
6060
name = "libtorch_pre_cxx11_abi",
6161
build_file = "@//third_party/libtorch:BUILD",
62-
sha256 = "f3cbd7e9593f0c64b8671d02a21d562c98b60ef1abf5898c0ee9acfbc5a6b5d2",
62+
sha256 = "cc19b398cf435e0e34f347ef90fc11c2a42703998330a9c4a9fb0d2291737df7",
6363
strip_prefix = "libtorch",
64-
urls = ["https://download.pytorch.org/libtorch/cu118/libtorch-shared-with-deps-2.0.0%2Bcu118.zip"],
64+
urls = ["https://download.pytorch.org/libtorch/test/cu118/libtorch-shared-with-deps-latest.zip"],
6565
)
6666

6767
# Download these tarballs manually from the NVIDIA website
@@ -71,10 +71,10 @@ http_archive(
7171
http_archive(
7272
name = "cudnn",
7373
build_file = "@//third_party/cudnn/archive:BUILD",
74-
sha256 = "5454a6fd94f008728caae9adad993c4e85ef36302e26bce43bea7d458a5e7b6d",
75-
strip_prefix = "cudnn-linux-x86_64-8.5.0.96_cuda11-archive",
74+
sha256 = "36fff137153ef73e6ee10bfb07f4381240a86fb9fb78ce372414b528cbab2293",
75+
strip_prefix = "cudnn-linux-x86_64-8.8.0.121_cuda11-archive",
7676
urls = [
77-
"https://developer.nvidia.com/compute/cudnn/secure/8.5.0/local_installers/11.7/cudnn-linux-x86_64-8.5.0.96_cuda11-archive.tar.xz",
77+
"https://developer.download.nvidia.com/compute/cudnn/secure/8.8.0/local_installers/11.8/cudnn-linux-x86_64-8.8.0.121_cuda11-archive.tar.xz",
7878
],
7979
)
8080

docker/Dockerfile

Lines changed: 54 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,54 @@
11
# Base image starts with CUDA
2-
ARG BASE_IMG=nvidia/cuda:11.7.1-devel-ubuntu20.04
2+
ARG BASE_IMG=nvidia/cuda:11.8.0-devel-ubuntu22.04
33
FROM ${BASE_IMG} as base
44

5+
ARG TENSORRT_VERSION
6+
RUN test -n "$TENSORRT_VERSION" || (echo "No tensorrt version specified, please use --build-arg TENSORRT_VERSION=x.y.z to specify a version." && exit 1)
7+
ARG CUDNN_VERSION
8+
RUN test -n "$CUDNN_VERSION" || (echo "No cudnn version specified, please use --build-arg CUDNN_VERSION=x.y.z to specify a version." && exit 1)
9+
10+
ARG PYTHON_VERSION=3.10
11+
ENV PYTHON_VERSION=${PYTHON_VERSION}
12+
13+
ARG USE_CXX11_ABI
14+
ENV USE_CXX11=${USE_CXX11_ABI}
15+
ENV DEBIAN_FRONTEND=noninteractive
16+
517
# Install basic dependencies
618
RUN apt-get update
7-
RUN DEBIAN_FRONTEND=noninteractive apt install -y build-essential manpages-dev wget zlib1g software-properties-common git
8-
RUN add-apt-repository ppa:deadsnakes/ppa
9-
RUN apt install -y python3.8 python3.8-distutils python3.8-dev
10-
RUN wget https://bootstrap.pypa.io/get-pip.py
11-
RUN ln -s /usr/bin/python3.8 /usr/bin/python
12-
RUN python get-pip.py
13-
RUN pip3 install wheel
14-
15-
# Install Pytorch
16-
RUN pip3 install torch==2.0.0.dev20230103+cu117 torchvision==0.15.0.dev20230103+cu117 --extra-index-url https://download.pytorch.org/whl/nightly/cu117
17-
18-
# Install CUDNN + TensorRT
19-
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
20-
RUN mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
21-
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub
19+
RUN apt install -y build-essential manpages-dev wget zlib1g software-properties-common git libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget ca-certificates curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev mecab-ipadic-utf8
20+
21+
# Install PyEnv and desired Python version
22+
ENV HOME="/root"
23+
ENV PYENV_DIR="$HOME/.pyenv"
24+
ENV PATH="$PYENV_DIR/shims:$PYENV_DIR/bin:$PATH"
25+
RUN wget -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer &&\
26+
chmod 755 pyenv-installer &&\
27+
bash pyenv-installer &&\
28+
eval "$(pyenv init -)"
29+
30+
RUN pyenv install -v ${PYTHON_VERSION}
31+
RUN pyenv global ${PYTHON_VERSION}
32+
33+
# Install CUDNN + TensorRT + dependencies
34+
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
35+
RUN mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600
36+
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/7fa2af80.pub
2237
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 536F8F1DE80F6A35
2338
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A4B469963BF863CC
24-
RUN add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
39+
RUN add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ /"
2540
RUN apt-get update
26-
RUN apt-get install -y libcudnn8=8.5.0* libcudnn8-dev=8.5.0*
41+
RUN apt-get install -y libcudnn8=${CUDNN_VERSION}* libcudnn8-dev=${CUDNN_VERSION}*
2742

28-
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
29-
RUN add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
43+
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub
44+
RUN add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ /"
3045
RUN apt-get update
3146

32-
RUN apt-get install -y libnvinfer8=8.5.1* libnvinfer-plugin8=8.5.1* libnvinfer-dev=8.5.1* libnvinfer-plugin-dev=8.5.1* libnvonnxparsers8=8.5.1-1* libnvonnxparsers-dev=8.5.1-1* libnvparsers8=8.5.1-1* libnvparsers-dev=8.5.1-1*
47+
RUN apt-get install -y libnvinfer8=${TENSORRT_VERSION}* libnvinfer-plugin8=${TENSORRT_VERSION}* libnvinfer-dev=${TENSORRT_VERSION}* libnvinfer-plugin-dev=${TENSORRT_VERSION}* libnvonnxparsers8=${TENSORRT_VERSION}-1* libnvonnxparsers-dev=${TENSORRT_VERSION}-1* libnvparsers8=${TENSORRT_VERSION}-1* libnvparsers-dev=${TENSORRT_VERSION}-1*
3348

34-
# Setup Bazel
35-
ARG BAZEL_VERSION=5.2.0
36-
RUN wget -q https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-linux-x86_64 -O /usr/bin/bazel \
37-
&& chmod a+x /usr/bin/bazel
49+
# Setup Bazel via Bazelisk
50+
RUN wget -q https://github.com/bazelbuild/bazelisk/releases/download/v1.16.0/bazelisk-linux-amd64 -O /usr/bin/bazel &&\
51+
chmod a+x /usr/bin/bazel
3852

3953
# Build Torch-TensorRT in an auxillary container
4054
FROM base as torch-tensorrt-builder-base
@@ -43,19 +57,24 @@ ARG ARCH="x86_64"
4357
ARG TARGETARCH="amd64"
4458

4559
RUN apt-get install -y python3-setuptools
46-
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
47-
RUN apt-get update
60+
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub
4861

49-
RUN apt-get update && apt-get install -y --no-install-recommends locales ninja-build && rm -rf /var/lib/apt/lists/* && locale-gen en_US.UTF-8
62+
RUN apt-get update &&\
63+
apt-get install -y --no-install-recommends locales ninja-build &&\
64+
rm -rf /var/lib/apt/lists/* &&\
65+
locale-gen en_US.UTF-8
5066

5167
FROM torch-tensorrt-builder-base as torch-tensorrt-builder
5268

5369
COPY . /workspace/torch_tensorrt/src
5470
WORKDIR /workspace/torch_tensorrt/src
5571
RUN cp ./docker/WORKSPACE.docker WORKSPACE
5672

73+
# Symlink the path pyenv is using for python with the /opt directory for package sourcing
74+
RUN ln -s "`pyenv which python | xargs dirname | xargs dirname`/lib/python$PYTHON_VERSION/site-packages" "/opt/python3"
75+
5776
# This script builds both libtorchtrt bin/lib/include tarball and the Python wheel, in dist/
58-
RUN ./docker/dist-build.sh
77+
RUN bash ./docker/dist-build.sh
5978

6079
# Copy and install Torch-TRT into the main container
6180
FROM base as torch-tensorrt
@@ -64,13 +83,13 @@ COPY . /opt/torch_tensorrt
6483
COPY --from=torch-tensorrt-builder /workspace/torch_tensorrt/src/py/dist/ .
6584

6685
RUN cp /opt/torch_tensorrt/docker/WORKSPACE.docker /opt/torch_tensorrt/WORKSPACE
67-
RUN pip3 install *.whl && rm -fr /workspace/torch_tensorrt/py/dist/* *.whl
68-
69-
# Install native tensorrt python package required by torch_tensorrt whl file
70-
RUN pip install tensorrt==8.5.1.7
86+
RUN pip install -r /opt/torch_tensorrt/py/requirements.txt
87+
RUN pip install tensorrt==${TENSORRT_VERSION}.*
88+
RUN pip install *.whl && rm -fr /workspace/torch_tensorrt/py/dist/* *.whl
7189

7290
WORKDIR /opt/torch_tensorrt
73-
ENV LD_LIBRARY_PATH /usr/local/lib/python3.8/dist-packages/torch/lib:/usr/local/lib/python3.8/dist-packages/torch_tensorrt/lib:/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH}
74-
ENV PATH /usr/local/lib/python3.8/dist-packages/torch_tensorrt/bin:${PATH}
91+
92+
ENV LD_LIBRARY_PATH /opt/python3/site-packages/torch/lib:/opt/python3/site-packages/torch_tensorrt/lib:/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH}
93+
ENV PATH /opt/python3/site-packages/torch_tensorrt/bin:${PATH}
7594

7695
CMD /bin/bash

docker/README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,29 @@
22

33
* Use `Dockerfile` to build a container which provides the exact development environment that our master branch is usually tested against.
44

5-
* `Dockerfile` currently uses the exact library versions (Torch, CUDA, CUDNN, TensorRT) listed in <a href="https://github.com/pytorch/TensorRT#dependencies">dependencies</a> to build Torch-TensorRT.
5+
* The `Dockerfile` currently uses <a href="https://github.com/bazelbuild/bazelisk">Bazelisk</a> to select the Bazel version, and uses the exact library versions of Torch and CUDA listed in <a href="https://github.com/pytorch/TensorRT#dependencies">dependencies</a>.
6+
* The desired versions of CUDNN and TensorRT must be specified as build-args, with major, minor, and patch versions as in: `--build-arg TENSORRT_VERSION=a.b.c --build-arg CUDNN_VERSION=x.y.z`
7+
* [**Optional**] The desired base image be changed by explicitly setting a base image, as in `--build-arg BASE_IMG=nvidia/cuda:11.8.0-devel-ubuntu22.04`, though this is optional
8+
* [**Optional**] Additionally, the desired Python version can be changed by explicitly setting a version, as in `--build-arg PYTHON_VERSION=3.10`, though this is optional as well.
69

710
* This `Dockerfile` installs `pre-cxx11-abi` versions of Pytorch and builds Torch-TRT using `pre-cxx11-abi` libtorch as well.
8-
Note: To install `cxx11_abi` version of Torch-TensorRT, enable `USE_CXX11=1` flag so that `dist-build.sh` can build it accordingly.
11+
12+
Note: By default the container uses the `pre-cxx11-abi` version of Torch + Torch-TRT. If you are using a workflow that requires a build of PyTorch on the CXX11 ABI (e.g. using the PyTorch NGC containers as a base image), add the Docker build argument: `--build-arg USE_CXX11_ABI=1`
913

1014
### Dependencies
1115

1216
* Install nvidia-docker by following https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker
1317

1418
### Instructions
1519

20+
- The example below uses CUDNN 8.8.0 and TensorRT 8.6.0
21+
- See <a href="https://github.com/pytorch/TensorRT#dependencies">dependencies</a> for a list of current default dependencies.
22+
1623
> From root of Torch-TensorRT repo
1724
1825
Build:
1926
```
20-
DOCKER_BUILDKIT=1 docker build -f docker/Dockerfile -t torch_tensorrt:latest .
27+
DOCKER_BUILDKIT=1 docker build --build-arg TENSORRT_VERSION=8.6.0 --build-arg CUDNN_VERSION=8.8.0 -f docker/Dockerfile -t torch_tensorrt:latest .
2128
```
2229

2330
Run:
@@ -38,4 +45,4 @@ bazel test //tests/core/conversion/converters:test_activation --compilation_mode
3845

3946
### Pytorch NGC containers
4047

41-
We also ship Torch-TensorRT in <a href="https://catalog.ngc.nvidia.com/orgs/nvidia/containers/pytorch">Pytorch NGC containers </a>. Release notes for these containers can be found <a href="https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/index.html">here</a>. Check out `release/ngc/23.XX` branch of Torch-TensorRT for source code that gets shipped with `23.XX` version of Pytorch NGC container.
48+
We also ship Torch-TensorRT in <a href="https://catalog.ngc.nvidia.com/orgs/nvidia/containers/pytorch">Pytorch NGC containers </a>. Release notes for these containers can be found <a href="https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/index.html">here</a>. Check out `release/ngc/23.XX` branch of Torch-TensorRT for source code that gets shipped with `23.XX` version of Pytorch NGC container.

docker/WORKSPACE.docker

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,16 @@ new_local_repository(
4848
# Tarballs and fetched dependencies (default - use in cases when building from precompiled bin and tarballs)
4949
#############################################################################################################
5050

51-
http_archive(
51+
new_local_repository(
5252
name = "libtorch",
53-
build_file = "@//third_party/libtorch:BUILD",
54-
sha256 = "59b8b5e1954a86d50b79c13f06398d385b200da13e37a08ecf31d3c62e5ca127",
55-
strip_prefix = "libtorch",
56-
urls = ["https://download.pytorch.org/libtorch/nightly/cu117/libtorch-cxx11-abi-shared-with-deps-2.0.0.dev20230103%2Bcu117.zip"],
53+
path = "/opt/python3/site-packages/torch/",
54+
build_file = "third_party/libtorch/BUILD"
5755
)
5856

59-
http_archive(
57+
new_local_repository(
6058
name = "libtorch_pre_cxx11_abi",
61-
build_file = "@//third_party/libtorch:BUILD",
62-
sha256 = "e260fc7476be89d1650953e8643e9f7363845f5a52de4bab87ac0e619c1f6ad4",
63-
strip_prefix = "libtorch",
64-
urls = ["https://download.pytorch.org/libtorch/nightly/cu117/libtorch-shared-with-deps-2.0.0.dev20230103%2Bcu117.zip"],
59+
path = "/opt/python3/site-packages/torch/",
60+
build_file = "third_party/libtorch/BUILD"
6561
)
6662

6763
####################################################################################

0 commit comments

Comments
 (0)