Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update torch to 2.3.1 #2875

Merged
merged 3 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/scripts/install-torch-tensorrt-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
set -eou pipefail
# Source conda so it's available to the script environment
source ${BUILD_ENV_FILE}
export EXTRA_INDEX_URL="https://download.pytorch.org/whl/test/${CU_VERSION}"

# Install PyTorch and torchvision from index
${CONDA_RUN} ${PIP_INSTALL_TORCH} torchvision

# Install all the dependencies required for Torch-TensorRT
${CONDA_RUN} pip install --pre -r ${PWD}/tests/py/requirements.txt --use-deprecated=legacy-resolver --extra-index-url=${EXTRA_INDEX_URL}
${CONDA_RUN} pip install --pre -r ${PWD}/tests/py/requirements.txt --use-deprecated=legacy-resolver

# Install Torch-TensorRT via pre-built wheels. On windows, the location of wheels is not fixed.
${CONDA_RUN} pip install ${RUNNER_ARTIFACT_DIR}/torch_tensorrt*.whl
Expand Down
7 changes: 5 additions & 2 deletions .github/scripts/install-torch-tensorrt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
set -eou pipefail
# Source conda so it's available to the script environment
source ${BUILD_ENV_FILE}
export EXTRA_INDEX_URL="https://download.pytorch.org/whl/test/${CU_VERSION}"

# Install PyTorch and torchvision from index
${CONDA_RUN} ${PIP_INSTALL_TORCH} torchvision

# Install all the dependencies required for Torch-TensorRT
${CONDA_RUN} pip install --pre -r ${PWD}/tests/py/requirements.txt --use-deprecated=legacy-resolver --extra-index-url=${EXTRA_INDEX_URL}
${CONDA_RUN} pip install --pre -r ${PWD}/tests/py/requirements.txt --use-deprecated=legacy-resolver

# Install Torch-TensorRT via pre-built wheels. On windows, the location of wheels is not fixed.
${CONDA_RUN} pip install /opt/torch-tensorrt-builds/torch_tensorrt*.whl
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ torch.jit.save(trt_ts_module, "trt_torchscript_module.ts") # save the TRT embedd

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.

- Bazel 5.2.0
- Libtorch 2.3.0 (built with CUDA 12.1)
- Bazel 6.2.1
- Libtorch 2.3.1 (built with CUDA 12.1)
- CUDA 12.1
- TensorRT 10.0.1.6

Expand Down Expand Up @@ -282,7 +282,7 @@ nox --session l0_api_tests

Supported Python versions:
```
["3.7", "3.8", "3.9", "3.10"]
["3.8", "3.9", "3.10", "3.11"]
```

## How do I add support for a new op...
Expand Down
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ http_archive(
name = "libtorch",
build_file = "@//third_party/libtorch:BUILD",
strip_prefix = "libtorch",
urls = ["https://download.pytorch.org/libtorch/cu121/libtorch-cxx11-abi-shared-with-deps-2.3.0%2Bcu121.zip"],
urls = ["https://download.pytorch.org/libtorch/test/cu121/libtorch-cxx11-abi-shared-with-deps-2.3.1%2Bcu121.zip"],
)

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

# Download these tarballs manually from the NVIDIA website
Expand Down
6 changes: 3 additions & 3 deletions py/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
numpy
packaging
pybind11==2.6.2
--extra-index-url https://download.pytorch.org/whl/cu121
torch==2.3.0
torchvision==0.18.0
--extra-index-url https://download.pytorch.org/whl/test/cu121
torch==2.3.1
torchvision==0.18.1
--extra-index-url https://pypi.ngc.nvidia.com
pyyaml
tensorrt==10.0.1
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ requires = [
"typing-extensions>=4.7.0",
"future>=0.18.3",
"tensorrt",
"torch==2.3.0",
"torch==2.3.1",
"pybind11==2.6.2",
"numpy",
]
Expand Down Expand Up @@ -41,7 +41,7 @@ readme = {file = "py/README.md", content-type = "text/markdown"}
requires-python = ">=3.8"
keywords = ["pytorch", "torch", "tensorrt", "trt", "ai", "artificial intelligence", "ml", "machine learning", "dl", "deep learning", "compiler", "dynamo", "torchscript", "inference"]
dependencies = [
"torch==2.3.0",
"torch==2.3.1",
"tensorrt",
"packaging>=23",
"numpy",
Expand All @@ -50,7 +50,7 @@ dependencies = [
dynamic = ["version"]

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

[project.urls]
Homepage = "https://pytorch.org/tensorrt"
Expand Down
8 changes: 1 addition & 7 deletions tests/py/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
# This file is specifically to install correct version of libraries during CI testing.
# The index url for torch & torchvision libs is configured in install-torch-tensorrt.sh based on CUDA version
# networkx library issue: https://discuss.pytorch.org/t/installing-pytorch-under-python-3-8-question-about-networkx-version/196740
pytest>=8.2.1
pytest-xdist>=3.6.1
networkx==2.8.8
torch==2.3.0
torchvision==0.18.0
--extra-index-url https://pypi.nvidia.com
--extra-index-url https://pypi.ngc.nvidia.com
pyyaml
tensorrt==10.0.1
tensorrt-cu12-bindings==10.0.1
Expand Down
4 changes: 2 additions & 2 deletions toolchains/ci_workspaces/WORKSPACE.win.release.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ http_archive(
name = "libtorch",
build_file = "@//third_party/libtorch:BUILD",
strip_prefix = "libtorch",
urls = ["https://download.pytorch.org/libtorch/nightly/cu121/libtorch-cxx11-abi-shared-with-deps-latest.zip"],
urls = ["https://download.pytorch.org/libtorch/test/cu121/libtorch-cxx11-abi-shared-with-deps-2.3.1%2Bcu121.zip"],
)

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

####################################################################################
Expand Down
4 changes: 2 additions & 2 deletions toolchains/ci_workspaces/WORKSPACE.x86_64.release.rhel.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ http_archive(
name = "libtorch",
build_file = "@//third_party/libtorch:BUILD",
strip_prefix = "libtorch",
urls = ["https://download.pytorch.org/libtorch/cu121/libtorch-cxx11-abi-shared-with-deps-2.3.0%2Bcu121.zip"],
urls = ["https://download.pytorch.org/libtorch/test/cu121/libtorch-cxx11-abi-shared-with-deps-2.3.1%2Bcu121.zip"],
)

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

http_archive(
Expand Down
Loading