Skip to content

Commit b12ec96

Browse files
committed
test
1 parent 85e4332 commit b12ec96

File tree

3 files changed

+60
-21
lines changed

3 files changed

+60
-21
lines changed

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

Lines changed: 58 additions & 19 deletions
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,69 @@
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",
43-
},
44-
"10.7.0": {
45-
"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",
46-
"strip_prefix": "TensorRT-10.7.0.23",
47-
"sha256": "fbdef004578e7ccd5ee51fe7f846b57422364a743372fd8f9f1d7dbd33f62879",
4842
},
4943
},
5044
"linux": {
5145
"10.4.0": {
5246
"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",
5347
"strip_prefix": "TensorRT-10.4.0.26",
54-
"sha256": "cb0273ecb3ba4db8993a408eedd354712301a6c7f20704c52cdf9f78aa97bbdb",
5548
},
5649
"10.5.0": {
5750
"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",
5851
"strip_prefix": "TensorRT-10.5.0.18",
59-
"sha256": "f404d379d639552a3e026cd5267213bd6df18a4eb899d6e47815bbdb34854958",
6052
},
6153
"10.6.0": {
6254
"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",
6355
"strip_prefix": "TensorRT-10.6.0.26",
64-
"sha256": "33d3c2f3f4c84dc7991a4337a6fde9ed33f5c8e5c4f03ac2eb6b994a382b03a0",
65-
},
66-
"10.7.0": {
67-
"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",
68-
"strip_prefix": "TensorRT-10.7.0.23",
69-
"sha256": "d7f16520457caaf97ad8a7e94d802f89d77aedf9f361a255f2c216e2a3a40a11",
7056
},
7157
},
7258
}
7359

7460

61+
def check_new_tensorrt_version(
62+
major: int, minor_from: int, patch_from: int
63+
) -> tuple[bool, str, str, str, str]:
64+
def check_file_availability(url: str) -> bool:
65+
try:
66+
response = requests.head(url, allow_redirects=True)
67+
if response.status_code == 200:
68+
content_type = response.headers.get("Content-Type", "")
69+
content_disposition = response.headers.get("Content-Disposition", "")
70+
if "application" in content_type or "attachment" in content_disposition:
71+
return True
72+
return False
73+
except requests.RequestException:
74+
return False
75+
76+
trt_linux_release_url = ""
77+
trt_win_release_url = ""
78+
79+
for minor in range(minor_from, minor_from + 3):
80+
trt_version = f"{major}.{minor}.0"
81+
for patch in range(patch_from, 50):
82+
for cuda_minor in range(4, 11):
83+
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"
84+
if check_file_availability(trt_linux_release_url_candidate):
85+
trt_linux_release_url = trt_linux_release_url_candidate
86+
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"
87+
return (
88+
True,
89+
trt_version,
90+
str(patch),
91+
trt_linux_release_url,
92+
trt_win_release_url,
93+
)
94+
return False, "", "", "", ""
95+
96+
7597
def main(args: list[str]) -> None:
7698
parser = argparse.ArgumentParser()
7799
parser.add_argument(
@@ -109,6 +131,23 @@ def main(args: list[str]) -> None:
109131
f"{includes[0].validation_runner} is not the supported arch, currently only support windows and linux"
110132
)
111133

134+
(
135+
new_trt_available,
136+
trt_version,
137+
trt_patch,
138+
trt_linux_release_url,
139+
trt_win_release_url,
140+
) = check_new_tensorrt_version(major=10, minor_from=7, patch_from=0)
141+
if new_trt_available:
142+
TENSORRT_VERSIONS_DICT["linux"][trt_version]["urls"] = trt_linux_release_url
143+
TENSORRT_VERSIONS_DICT["linux"][trt_version][
144+
"strip_prefix"
145+
] = f"TensorRT-{trt_version}.{trt_patch}"
146+
TENSORRT_VERSIONS_DICT["windows"][trt_version]["urls"] = trt_win_release_url
147+
TENSORRT_VERSIONS_DICT["windows"][trt_version][
148+
"strip_prefix"
149+
] = f"TensorRT-{trt_version}.{trt_patch}"
150+
112151
cuda_versions = CUDA_VERSIONS_DICT[channel]
113152
python_versions = PYTHON_VERSIONS_DICT[channel]
114153
tensorrt_versions = TENSORRT_VERSIONS_DICT[arch]

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

Lines changed: 2 additions & 0 deletions
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

toolchains/ci_workspaces/MODULE_tensorrt.bazel.tmpl

Lines changed: 0 additions & 2 deletions
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)