Skip to content

Commit 483e646

Browse files
authored
chore: Update torch to 2.3.1 (#2875)
1 parent f0069ce commit 483e646

File tree

9 files changed

+26
-26
lines changed

9 files changed

+26
-26
lines changed

.github/scripts/install-torch-tensorrt-windows.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
set -eou pipefail
33
# Source conda so it's available to the script environment
44
source ${BUILD_ENV_FILE}
5-
export EXTRA_INDEX_URL="https://download.pytorch.org/whl/test/${CU_VERSION}"
5+
6+
# Install PyTorch and torchvision from index
7+
${CONDA_RUN} ${PIP_INSTALL_TORCH} torchvision
8+
69
# Install all the dependencies required for Torch-TensorRT
7-
${CONDA_RUN} pip install --pre -r ${PWD}/tests/py/requirements.txt --use-deprecated=legacy-resolver --extra-index-url=${EXTRA_INDEX_URL}
10+
${CONDA_RUN} pip install --pre -r ${PWD}/tests/py/requirements.txt --use-deprecated=legacy-resolver
811

912
# Install Torch-TensorRT via pre-built wheels. On windows, the location of wheels is not fixed.
1013
${CONDA_RUN} pip install ${RUNNER_ARTIFACT_DIR}/torch_tensorrt*.whl

.github/scripts/install-torch-tensorrt.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
set -eou pipefail
33
# Source conda so it's available to the script environment
44
source ${BUILD_ENV_FILE}
5-
export EXTRA_INDEX_URL="https://download.pytorch.org/whl/test/${CU_VERSION}"
5+
6+
# Install PyTorch and torchvision from index
7+
${CONDA_RUN} ${PIP_INSTALL_TORCH} torchvision
8+
69
# Install all the dependencies required for Torch-TensorRT
7-
${CONDA_RUN} pip install --pre -r ${PWD}/tests/py/requirements.txt --use-deprecated=legacy-resolver --extra-index-url=${EXTRA_INDEX_URL}
10+
${CONDA_RUN} pip install --pre -r ${PWD}/tests/py/requirements.txt --use-deprecated=legacy-resolver
811

912
# Install Torch-TensorRT via pre-built wheels. On windows, the location of wheels is not fixed.
1013
${CONDA_RUN} pip install /opt/torch-tensorrt-builds/torch_tensorrt*.whl

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ torch.jit.save(trt_ts_module, "trt_torchscript_module.ts") # save the TRT embedd
115115

116116
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.
117117

118-
- Bazel 5.2.0
119-
- Libtorch 2.3.0 (built with CUDA 12.1)
118+
- Bazel 6.2.1
119+
- Libtorch 2.3.1 (built with CUDA 12.1)
120120
- CUDA 12.1
121121
- TensorRT 10.0.1.6
122122

@@ -282,7 +282,7 @@ nox --session l0_api_tests
282282

283283
Supported Python versions:
284284
```
285-
["3.7", "3.8", "3.9", "3.10"]
285+
["3.8", "3.9", "3.10", "3.11"]
286286
```
287287

288288
## How do I add support for a new op...

WORKSPACE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ http_archive(
5454
name = "libtorch",
5555
build_file = "@//third_party/libtorch:BUILD",
5656
strip_prefix = "libtorch",
57-
urls = ["https://download.pytorch.org/libtorch/cu121/libtorch-cxx11-abi-shared-with-deps-2.3.0%2Bcu121.zip"],
57+
urls = ["https://download.pytorch.org/libtorch/test/cu121/libtorch-cxx11-abi-shared-with-deps-2.3.1%2Bcu121.zip"],
5858
)
5959

6060
http_archive(
6161
name = "libtorch_pre_cxx11_abi",
6262
build_file = "@//third_party/libtorch:BUILD",
6363
strip_prefix = "libtorch",
64-
urls = ["https://download.pytorch.org/libtorch/cu121/libtorch-shared-with-deps-2.3.0%2Bcu121.zip"],
64+
urls = ["https://download.pytorch.org/libtorch/test/cu121/libtorch-shared-with-deps-2.3.1%2Bcu121.zip"],
6565
)
6666

6767
# Download these tarballs manually from the NVIDIA website

py/requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
numpy
22
packaging
33
pybind11==2.6.2
4-
--extra-index-url https://download.pytorch.org/whl/cu121
5-
torch==2.3.0
6-
torchvision==0.18.0
4+
--extra-index-url https://download.pytorch.org/whl/test/cu121
5+
torch==2.3.1
6+
torchvision==0.18.1
77
--extra-index-url https://pypi.ngc.nvidia.com
88
pyyaml
99
tensorrt==10.0.1

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ requires = [
99
"typing-extensions>=4.7.0",
1010
"future>=0.18.3",
1111
"tensorrt",
12-
"torch==2.3.0",
12+
"torch==2.3.1",
1313
"pybind11==2.6.2",
1414
"numpy",
1515
]
@@ -41,7 +41,7 @@ readme = {file = "py/README.md", content-type = "text/markdown"}
4141
requires-python = ">=3.8"
4242
keywords = ["pytorch", "torch", "tensorrt", "trt", "ai", "artificial intelligence", "ml", "machine learning", "dl", "deep learning", "compiler", "dynamo", "torchscript", "inference"]
4343
dependencies = [
44-
"torch==2.3.0",
44+
"torch==2.3.1",
4545
"tensorrt",
4646
"packaging>=23",
4747
"numpy",
@@ -50,7 +50,7 @@ dependencies = [
5050
dynamic = ["version"]
5151

5252
[project.optional-dependencies]
53-
torchvision = ["torchvision >=0.18.dev,<0.19.0"]
53+
torchvision = ["torchvision==0.18.1"]
5454

5555
[project.urls]
5656
Homepage = "https://pytorch.org/tensorrt"

tests/py/requirements.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
# This file is specifically to install correct version of libraries during CI testing.
2-
# The index url for torch & torchvision libs is configured in install-torch-tensorrt.sh based on CUDA version
3-
# networkx library issue: https://discuss.pytorch.org/t/installing-pytorch-under-python-3-8-question-about-networkx-version/196740
41
pytest>=8.2.1
52
pytest-xdist>=3.6.1
6-
networkx==2.8.8
7-
torch==2.3.0
8-
torchvision==0.18.0
9-
--extra-index-url https://pypi.nvidia.com
3+
--extra-index-url https://pypi.ngc.nvidia.com
104
pyyaml
115
tensorrt==10.0.1
126
tensorrt-cu12-bindings==10.0.1

toolchains/ci_workspaces/WORKSPACE.win.release.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ http_archive(
5959
name = "libtorch",
6060
build_file = "@//third_party/libtorch:BUILD",
6161
strip_prefix = "libtorch",
62-
urls = ["https://download.pytorch.org/libtorch/nightly/cu121/libtorch-cxx11-abi-shared-with-deps-latest.zip"],
62+
urls = ["https://download.pytorch.org/libtorch/test/cu121/libtorch-cxx11-abi-shared-with-deps-2.3.1%2Bcu121.zip"],
6363
)
6464

6565
http_archive(
6666
name = "libtorch_pre_cxx11_abi",
6767
build_file = "@//third_party/libtorch:BUILD",
6868
strip_prefix = "libtorch",
69-
urls = ["https://download.pytorch.org/libtorch/nightly/cu121/libtorch-shared-with-deps-latest.zip"],
69+
urls = ["https://download.pytorch.org/libtorch/test/cu121/libtorch-shared-with-deps-2.3.1%2Bcu121.zip"],
7070
)
7171

7272
####################################################################################

toolchains/ci_workspaces/WORKSPACE.x86_64.release.rhel.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ http_archive(
5858
name = "libtorch",
5959
build_file = "@//third_party/libtorch:BUILD",
6060
strip_prefix = "libtorch",
61-
urls = ["https://download.pytorch.org/libtorch/cu121/libtorch-cxx11-abi-shared-with-deps-2.3.0%2Bcu121.zip"],
61+
urls = ["https://download.pytorch.org/libtorch/test/cu121/libtorch-cxx11-abi-shared-with-deps-2.3.1%2Bcu121.zip"],
6262
)
6363

6464
http_archive(
6565
name = "libtorch_pre_cxx11_abi",
6666
build_file = "@//third_party/libtorch:BUILD",
6767
strip_prefix = "libtorch",
68-
urls = ["https://download.pytorch.org/libtorch/cu121/libtorch-shared-with-deps-2.3.0%2Bcu121.zip"],
68+
urls = ["https://download.pytorch.org/libtorch/test/cu121/libtorch-shared-with-deps-2.3.1%2Bcu121.zip"],
6969
)
7070

7171
http_archive(

0 commit comments

Comments
 (0)