Skip to content

Commit 69c83d4

Browse files
authored
feat: Trigger Actions to run multiple TRT versions weekly (#3346)
1 parent c636b39 commit 69c83d4

File tree

4 files changed

+69
-13
lines changed

4 files changed

+69
-13
lines changed

.github/scripts/generate-tensorrt-test-matrix.py

+61-11
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
import json
66
import sys
77

8+
import requests # type: ignore[import-untyped]
9+
810
# please update the cuda version you want to test with the future tensorRT version here
911
# channel: nightly if the future tensorRT version test workflow is triggered from the main branch or your personal branch
1012
# channel: test if the future tensorRT version test workflow is triggered from the release branch(release/2.5 etc....)
1113
CUDA_VERSIONS_DICT = {
12-
"nightly": ["cu124"],
13-
"test": ["cu121", "cu124"],
14-
"release": ["cu121", "cu124"],
14+
"nightly": ["cu126"],
15+
"test": ["cu124", "cu126"],
16+
"release": ["cu124", "cu126"],
1517
}
1618

1719
# please update the python version you want to test with the future tensorRT version here
@@ -29,49 +31,78 @@
2931
"10.4.0": {
3032
"urls": "https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.4.0/zip/TensorRT-10.4.0.26.Windows.win10.cuda-12.6.zip",
3133
"strip_prefix": "TensorRT-10.4.0.26",
32-
"sha256": "3a7de83778b9e9f812fd8901e07e0d7d6fc54ce633fcff2e340f994df2c6356c",
3334
},
3435
"10.5.0": {
3536
"urls": "https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.5.0/zip/TensorRT-10.5.0.18.Windows.win10.cuda-12.6.zip",
3637
"strip_prefix": "TensorRT-10.5.0.18",
37-
"sha256": "e6436f4164db4e44d727354dccf7d93755efb70d6fbfd6fa95bdfeb2e7331b24",
3838
},
3939
"10.6.0": {
4040
"urls": "https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.6.0/zip/TensorRT-10.6.0.26.Windows.win10.cuda-12.6.zip",
4141
"strip_prefix": "TensorRT-10.6.0.26",
42-
"sha256": "6c6d92c108a1b3368423e8f69f08d31269830f1e4c9da43b37ba34a176797254",
4342
},
4443
"10.7.0": {
4544
"urls": "https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.7.0/zip/TensorRT-10.7.0.23.Windows.win10.cuda-12.6.zip",
4645
"strip_prefix": "TensorRT-10.7.0.23",
47-
"sha256": "fbdef004578e7ccd5ee51fe7f846b57422364a743372fd8f9f1d7dbd33f62879",
4846
},
4947
},
5048
"linux": {
5149
"10.4.0": {
5250
"urls": "https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.4.0/tars/TensorRT-10.4.0.26.Linux.x86_64-gnu.cuda-12.6.tar.gz",
5351
"strip_prefix": "TensorRT-10.4.0.26",
54-
"sha256": "cb0273ecb3ba4db8993a408eedd354712301a6c7f20704c52cdf9f78aa97bbdb",
5552
},
5653
"10.5.0": {
5754
"urls": "https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.5.0/tars/TensorRT-10.5.0.18.Linux.x86_64-gnu.cuda-12.6.tar.gz",
5855
"strip_prefix": "TensorRT-10.5.0.18",
59-
"sha256": "f404d379d639552a3e026cd5267213bd6df18a4eb899d6e47815bbdb34854958",
6056
},
6157
"10.6.0": {
6258
"urls": "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",
6359
"strip_prefix": "TensorRT-10.6.0.26",
64-
"sha256": "33d3c2f3f4c84dc7991a4337a6fde9ed33f5c8e5c4f03ac2eb6b994a382b03a0",
6560
},
6661
"10.7.0": {
6762
"urls": "https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.7.0/tars/TensorRT-10.7.0.23.Linux.x86_64-gnu.cuda-12.6.tar.gz",
6863
"strip_prefix": "TensorRT-10.7.0.23",
69-
"sha256": "d7f16520457caaf97ad8a7e94d802f89d77aedf9f361a255f2c216e2a3a40a11",
7064
},
7165
},
7266
}
7367

7468

69+
def check_new_tensorrt_version(
70+
major: int = 10, patch_from: int = 0
71+
) -> tuple[bool, str, str, str, str]:
72+
def check_file_availability(url: str) -> bool:
73+
try:
74+
response = requests.head(url, allow_redirects=True)
75+
if response.status_code == 200:
76+
content_type = response.headers.get("Content-Type", "")
77+
content_disposition = response.headers.get("Content-Disposition", "")
78+
if "application" in content_type or "attachment" in content_disposition:
79+
return True
80+
return False
81+
except requests.RequestException:
82+
return False
83+
84+
trt_linux_release_url = ""
85+
trt_win_release_url = ""
86+
87+
# calculate the next minor version
88+
minor = int(list(TENSORRT_VERSIONS_DICT["linux"].keys())[-1].split(".")[1]) + 1
89+
trt_version = f"{major}.{minor}.0"
90+
for patch in range(patch_from, 50):
91+
for cuda_minor in range(4, 11):
92+
trt_linux_release_url_candidate = f"https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/{trt_version}/tars/TensorRT-{trt_version}.{patch}.Linux.x86_64-gnu.cuda-12.{cuda_minor}.tar.gz"
93+
if check_file_availability(trt_linux_release_url_candidate):
94+
trt_linux_release_url = trt_linux_release_url_candidate
95+
trt_win_release_url = f"https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/{trt_version}/zip/TensorRT-{trt_version}.{patch}.Windows.win10.cuda-12.{cuda_minor}.zip"
96+
return (
97+
True,
98+
trt_version,
99+
str(patch),
100+
trt_linux_release_url,
101+
trt_win_release_url,
102+
)
103+
return False, "", "", "", ""
104+
105+
75106
def main(args: list[str]) -> None:
76107
parser = argparse.ArgumentParser()
77108
parser.add_argument(
@@ -109,6 +140,25 @@ def main(args: list[str]) -> None:
109140
f"{includes[0].validation_runner} is not the supported arch, currently only support windows and linux"
110141
)
111142

143+
(
144+
new_trt_available,
145+
trt_version,
146+
trt_patch,
147+
trt_linux_release_url,
148+
trt_win_release_url,
149+
) = check_new_tensorrt_version(major=10, patch_from=0)
150+
if new_trt_available:
151+
TENSORRT_VERSIONS_DICT["linux"][trt_version] = {}
152+
TENSORRT_VERSIONS_DICT["linux"][trt_version]["urls"] = trt_linux_release_url
153+
TENSORRT_VERSIONS_DICT["linux"][trt_version][
154+
"strip_prefix"
155+
] = f"TensorRT-{trt_version}.{trt_patch}"
156+
TENSORRT_VERSIONS_DICT["windows"][trt_version] = {}
157+
TENSORRT_VERSIONS_DICT["windows"][trt_version]["urls"] = trt_win_release_url
158+
TENSORRT_VERSIONS_DICT["windows"][trt_version][
159+
"strip_prefix"
160+
] = f"TensorRT-{trt_version}.{trt_patch}"
161+
112162
cuda_versions = CUDA_VERSIONS_DICT[channel]
113163
python_versions = PYTHON_VERSIONS_DICT[channel]
114164
tensorrt_versions = TENSORRT_VERSIONS_DICT[arch]

.github/workflows/build-test-tensorrt-linux.yml

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Build and Test Torch-TensorRT on Linux with Future TensorRT Versions
22

33
on:
44
workflow_dispatch:
5+
schedule:
6+
- cron: '0 0 * * 0' # Runs at 00:00 UTC every Sunday (minute hour day-of-month month-of-year day-of-week)
57

68
permissions:
79
id-token: write
@@ -35,6 +37,8 @@ jobs:
3537
id: generate
3638
run: |
3739
set -eou pipefail
40+
python -m pip install --upgrade pip
41+
pip install requests
3842
MATRIX_BLOB=${{ toJSON(needs.generate-matrix.outputs.matrix) }}
3943
MATRIX_BLOB="$(python3 .github/scripts/generate-tensorrt-test-matrix.py --matrix "${MATRIX_BLOB}")"
4044
echo "${MATRIX_BLOB}"

.github/workflows/build-test-tensorrt-windows.yml

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Build and Test Torch-TensorRT on Windows with Future TensorRT Versions
22

33
on:
44
workflow_dispatch:
5+
schedule:
6+
- cron: '0 0 * * 0' # Runs at 00:00 UTC every Sunday (minute hour day-of-month month-of-year day-of-week)
57

68
permissions:
79
id-token: write
@@ -35,6 +37,8 @@ jobs:
3537
id: generate
3638
run: |
3739
set -eou pipefail
40+
python -m pip install --upgrade pip
41+
pip install requests
3842
MATRIX_BLOB=${{ toJSON(needs.generate-matrix.outputs.matrix) }}
3943
MATRIX_BLOB="$(python3 .github/scripts/generate-tensorrt-test-matrix.py --matrix "${MATRIX_BLOB}")"
4044
echo "${MATRIX_BLOB}"

toolchains/ci_workspaces/MODULE_tensorrt.bazel.tmpl

-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ http_archive(
6767
http_archive(
6868
name = "tensorrt",
6969
build_file = "@//third_party/tensorrt/archive:BUILD",
70-
sha256 = "${TENSORRT_SHA256}",
7170
strip_prefix = "${TENSORRT_STRIP_PREFIX}",
7271
urls = [
7372
"${TENSORRT_URLS}",
@@ -77,7 +76,6 @@ http_archive(
7776
http_archive(
7877
name = "tensorrt_win",
7978
build_file = "@//third_party/tensorrt/archive:BUILD",
80-
sha256 = "${TENSORRT_SHA256}",
8179
strip_prefix = "${TENSORRT_STRIP_PREFIX}",
8280
urls = [
8381
"${TENSORRT_URLS}",

0 commit comments

Comments
 (0)