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

upgrade tensorrt dependency to >=10.3.0,<=10.6.0 #3286

Merged
merged 41 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
a0b1989
add test tensorrt workflow
lanluo-nvidia Oct 28, 2024
09689ee
test
lanluo-nvidia Oct 28, 2024
3206da7
test
lanluo-nvidia Oct 28, 2024
0a64986
test
lanluo-nvidia Oct 28, 2024
a02d944
test
lanluo-nvidia Oct 28, 2024
9c0ca36
test
lanluo-nvidia Oct 28, 2024
67cbaf3
test
lanluo-nvidia Nov 1, 2024
7765146
add some test
lanluo-nvidia Nov 3, 2024
8a199aa
test
lanluo-nvidia Nov 4, 2024
546a574
test
lanluo-nvidia Nov 4, 2024
41aec8b
test
lanluo-nvidia Nov 4, 2024
a554285
test
lanluo-nvidia Nov 4, 2024
7102fa5
test
lanluo-nvidia Nov 5, 2024
0fd94e6
test
lanluo-nvidia Nov 5, 2024
6cc2faa
resolve comments
lanluo-nvidia Nov 5, 2024
e9af038
add more tests
lanluo-nvidia Nov 7, 2024
646a515
Merge branch 'main' into lluo/tensorrt_test_workflow
lanluo-nvidia Nov 8, 2024
1bf5673
merge main into the branch
lanluo-nvidia Nov 8, 2024
1f92a78
add comments
lanluo-nvidia Nov 8, 2024
6018cb4
upgrade tensorrt dependency
lanluo-nvidia Nov 9, 2024
f3c7d8c
test
lanluo-nvidia Nov 9, 2024
fade4c5
test
lanluo-nvidia Nov 9, 2024
f047aa1
add future tensorrt test workflow on windows
lanluo-nvidia Nov 12, 2024
80a4a7f
test
lanluo-nvidia Nov 12, 2024
78878f6
test
lanluo-nvidia Nov 12, 2024
a624610
test
lanluo-nvidia Nov 12, 2024
5b7352c
test with other windows nodes
lanluo-nvidia Nov 12, 2024
d984c90
test
lanluo-nvidia Nov 12, 2024
1928e8a
test
lanluo-nvidia Nov 12, 2024
8fc3482
change decomposition default table due to upstream torch change
lanluo-nvidia Nov 12, 2024
4ed8e28
test
lanluo-nvidia Nov 12, 2024
7e3c1fa
test
lanluo-nvidia Nov 12, 2024
229bdf1
Merge branch 'lluo/decomposition_upstream_change' into lluo/tensorrt_…
lanluo-nvidia Nov 12, 2024
bd69526
Merge branch 'lluo/tensorrt_test_workflow' into lluo/tensorrt_test_wi…
lanluo-nvidia Nov 12, 2024
dbd740b
test
lanluo-nvidia Nov 13, 2024
e2afaca
Merge branch 'lluo/tensorrt_test_windows_wf' into lluo/upgrade_tensor…
lanluo-nvidia Nov 14, 2024
0a13fe0
test
lanluo-nvidia Nov 14, 2024
49dae4b
Merge branch 'main' into lluo/upgrade_tensorrt_version
lanluo-nvidia Nov 14, 2024
d674bb2
test
lanluo-nvidia Nov 14, 2024
dbb20e0
Merge branch 'main' into lluo/upgrade_tensorrt_version
Nov 18, 2024
4dfb58b
Merge branch 'main' into lluo/upgrade_tensorrt_version
zewenli98 Dec 12, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/docker_builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- main
- nightly
- release/*
workflow_dispatch:

# If pushes to main are made in rapid succession,
# cancel existing docker builds and use newer commits
Expand Down
12 changes: 6 additions & 6 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,20 @@ http_archive(
http_archive(
name = "tensorrt",
build_file = "@//third_party/tensorrt/archive:BUILD",
sha256 = "adff1cd5abe5d87013806172351e58fd024e5bf0fc61d49ef4b84cd38ed99081",
strip_prefix = "TensorRT-10.3.0.26",
sha256 = "33d3c2f3f4c84dc7991a4337a6fde9ed33f5c8e5c4f03ac2eb6b994a382b03a0",
strip_prefix = "TensorRT-10.6.0.26",
urls = [
"https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.3.0/tars/TensorRT-10.3.0.26.Linux.x86_64-gnu.cuda-12.5.tar.gz",
"https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.6.0/tars/TensorRT-10.6.0.26.Linux.x86_64-gnu.cuda-12.6.tar.gz",
],
)

http_archive(
name = "tensorrt_win",
build_file = "@//third_party/tensorrt/archive:BUILD",
sha256 = "2bb4bcb79e8c33575816d874b0512ea28c302af1c06ee6d224da71aa182f75e0",
strip_prefix = "TensorRT-10.3.0.26",
sha256 = "6c6d92c108a1b3368423e8f69f08d31269830f1e4c9da43b37ba34a176797254",
strip_prefix = "TensorRT-10.6.0.26",
urls = [
"https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.3.0/zip/TensorRT-10.3.0.26.Windows.win10.cuda-12.5.zip",
"https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.6.0/zip/TensorRT-10.6.0.26.Windows.win10.cuda-12.6.zip",
],
)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ These are the following dependencies used to verify the testcases. Torch-TensorR
- Bazel 6.3.2
- Libtorch 2.5.0.dev (latest nightly) (built with CUDA 12.4)
- CUDA 12.4
- TensorRT 10.3.0.26
- TensorRT 10.6.0.26

## Deprecation Policy

Expand Down
2 changes: 1 addition & 1 deletion dev_dep_versions.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__cuda_version__: "12.4"
__tensorrt_version__: "10.3.0"
__tensorrt_version__: ">=10.3.0,<=10.6.0"
4 changes: 2 additions & 2 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ Note: By default the container uses the `pre-cxx11-abi` version of Torch + Torch

### Instructions

- The example below uses TensorRT 10.3.0.26
- The example below uses TensorRT 10.6.0.26
- See <a href="https://github.com/pytorch/TensorRT#dependencies">dependencies</a> for a list of current default dependencies.

> From root of Torch-TensorRT repo

Build:
```
DOCKER_BUILDKIT=1 docker build --build-arg TENSORRT_VERSION=10.3.0 -f docker/Dockerfile -t torch_tensorrt:latest .
DOCKER_BUILDKIT=1 docker build --build-arg TENSORRT_VERSION=10.6.0 -f docker/Dockerfile -t torch_tensorrt:latest .
```

Run:
Expand Down
14 changes: 8 additions & 6 deletions packaging/pre_build_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,20 @@ export TORCH_INSTALL_PATH=$(python -c "import torch, os; print(os.path.dirname(t

if [[ ${TENSORRT_VERSION} != "" ]]; then
# this is the upgraded TensorRT version, replace current tensorrt version to the upgrade tensorRT version in the pyproject.toml
# example: __tensorrt_version__: ">=10.3.0,<=10.6.0"
# replace: tensorrt-cu12>=10.3.0,<=10.6.0 to tensorrt-cu12==10.7.0
current_version=$(cat dev_dep_versions.yml | grep __tensorrt_version__ | sed 's/__tensorrt_version__: //g' | sed 's/"//g')
sed -i -e "s/tensorrt-cu12==${current_version}/tensorrt-cu12==${TENSORRT_VERSION}/g" \
-e "s/tensorrt-cu12-bindings==${current_version}/tensorrt-cu12-bindings==${TENSORRT_VERSION}/g" \
-e "s/tensorrt-cu12-libs==${current_version}/tensorrt-cu12-libs==${TENSORRT_VERSION}/g" \
sed -i -e "s/tensorrt-cu12${current_version}/tensorrt-cu12==${TENSORRT_VERSION}/g" \
-e "s/tensorrt-cu12-bindings${current_version}/tensorrt-cu12-bindings==${TENSORRT_VERSION}/g" \
-e "s/tensorrt-cu12-libs${current_version}/tensorrt-cu12-libs==${TENSORRT_VERSION}/g" \
pyproject.toml
fi

if [[ "${CU_VERSION::4}" < "cu12" ]]; then
# replace dependencies from tensorrt-cu12-bindings/libs to tensorrt-cu11-bindings/libs
sed -i -e "s/tensorrt-cu12==/tensorrt-${CU_VERSION::4}==/g" \
-e "s/tensorrt-cu12-bindings==/tensorrt-${CU_VERSION::4}-bindings==/g" \
-e "s/tensorrt-cu12-libs==/tensorrt-${CU_VERSION::4}-libs==/g" \
sed -i -e "s/tensorrt-cu12/tensorrt-${CU_VERSION::4}/g" \
-e "s/tensorrt-cu12-bindings/tensorrt-${CU_VERSION::4}-bindings/g" \
-e "s/tensorrt-cu12-libs/tensorrt-${CU_VERSION::4}-libs/g" \
pyproject.toml
fi

Expand Down
16 changes: 8 additions & 8 deletions packaging/pre_build_script_windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ echo TENSORRT_VERSION=${TENSORRT_VERSION}

if [[ ${TENSORRT_VERSION} != "" ]]; then
# this is the upgraded TensorRT version, replace current tensorrt version to the upgrade tensorRT version in the pyproject.toml
# example: __tensorrt_version__: ">=10.3.0,<=10.6.0"
# replace: tensorrt-cu12>=10.3.0,<=10.6.0 to tensorrt-cu12==10.7.0
current_version=$(cat dev_dep_versions.yml | grep __tensorrt_version__ | sed 's/__tensorrt_version__: //g' | sed 's/"//g')
sed -i -e "s/tensorrt-cu12==${current_version}/tensorrt-cu12==${TENSORRT_VERSION}/g" \
-e "s/tensorrt-cu12-bindings==${current_version}/tensorrt-cu12-bindings==${TENSORRT_VERSION}/g" \
-e "s/tensorrt-cu12-libs==${current_version}/tensorrt-cu12-libs==${TENSORRT_VERSION}/g" \
sed -i -e "s/tensorrt-cu12${current_version}/tensorrt-cu12==${TENSORRT_VERSION}/g" \
-e "s/tensorrt-cu12-bindings${current_version}/tensorrt-cu12-bindings==${TENSORRT_VERSION}/g" \
-e "s/tensorrt-cu12-libs${current_version}/tensorrt-cu12-libs==${TENSORRT_VERSION}/g" \
pyproject.toml
fi

if [[ "${CU_VERSION::4}" < "cu12" ]]; then
# replace dependencies from tensorrt-cu12-bindings/libs to tensorrt-cu11-bindings/libs
sed -i -e "s/tensorrt-cu12==/tensorrt-${CU_VERSION::4}==/g" \
-e "s/tensorrt-cu12-bindings==/tensorrt-${CU_VERSION::4}-bindings==/g" \
-e "s/tensorrt-cu12-libs==/tensorrt-${CU_VERSION::4}-libs==/g" \
sed -i -e "s/tensorrt-cu12/tensorrt-${CU_VERSION::4}/g" \
-e "s/tensorrt-cu12-bindings/tensorrt-${CU_VERSION::4}-bindings/g" \
-e "s/tensorrt-cu12-libs/tensorrt-${CU_VERSION::4}-libs/g" \
pyproject.toml
fi

#curl -Lo TensorRT.zip https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.3.0/zip/TensorRT-10.3.0.26.Windows.win10.cuda-12.5.zip
#unzip -o TensorRT.zip -d C:/
TORCH_TORCHVISION=$(grep "^torch" py/requirements.txt)
INDEX_URL=https://download.pytorch.org/whl/${CHANNEL}/${CU_VERSION}

Expand Down
10 changes: 6 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ requires = [
"cffi>=1.15.1",
"typing-extensions>=4.7.0",
"future>=0.18.3",
"tensorrt-cu12==10.3.0",
"tensorrt-cu12>=10.3.0,<=10.6.0",
"tensorrt-cu12-bindings>=10.3.0,<=10.6.0",
"tensorrt-cu12-libs>=10.3.0,<=10.6.0",
"torch>=2.6.0.dev,<2.7.0",
"pybind11==2.6.2",
"numpy",
Expand Down Expand Up @@ -55,9 +57,9 @@ keywords = [
]
dependencies = [
"torch>=2.6.0.dev,<2.7.0",
"tensorrt-cu12==10.3.0",
"tensorrt-cu12-bindings==10.3.0",
"tensorrt-cu12-libs==10.3.0",
"tensorrt-cu12>=10.3.0,<=10.6.0",
"tensorrt-cu12-bindings>=10.3.0,<=10.6.0",
"tensorrt-cu12-libs>=10.3.0,<=10.6.0",
"packaging>=23",
"numpy",
"typing-extensions>=4.7.0",
Expand Down
12 changes: 6 additions & 6 deletions toolchains/ci_workspaces/MODULE.bazel.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,20 @@ http_archive(
http_archive(
name = "tensorrt",
build_file = "@//third_party/tensorrt/archive:BUILD",
sha256 = "adff1cd5abe5d87013806172351e58fd024e5bf0fc61d49ef4b84cd38ed99081",
strip_prefix = "TensorRT-10.3.0.26",
sha256 = "33d3c2f3f4c84dc7991a4337a6fde9ed33f5c8e5c4f03ac2eb6b994a382b03a0",
strip_prefix = "TensorRT-10.6.0.26",
urls = [
"https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.3.0/tars/TensorRT-10.3.0.26.Linux.x86_64-gnu.cuda-12.5.tar.gz",
"https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.6.0/tars/TensorRT-10.6.0.26.Linux.x86_64-gnu.cuda-12.6.tar.gz",
],
)

http_archive(
name = "tensorrt_win",
build_file = "@//third_party/tensorrt/archive:BUILD",
sha256 = "2bb4bcb79e8c33575816d874b0512ea28c302af1c06ee6d224da71aa182f75e0",
strip_prefix = "TensorRT-10.3.0.26",
sha256 = "6c6d92c108a1b3368423e8f69f08d31269830f1e4c9da43b37ba34a176797254",
strip_prefix = "TensorRT-10.6.0.26",
urls = [
"https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.3.0/zip/TensorRT-10.3.0.26.Windows.win10.cuda-12.5.zip",
"https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.6.0/zip/TensorRT-10.6.0.26.Windows.win10.cuda-12.6.zip",
],
)

Expand Down
Loading
Loading