|
5 | 5 | import json
|
6 | 6 | import sys
|
7 | 7 |
|
| 8 | +import requests # type: ignore[import-untyped] |
| 9 | + |
8 | 10 | # please update the cuda version you want to test with the future tensorRT version here
|
9 | 11 | # channel: nightly if the future tensorRT version test workflow is triggered from the main branch or your personal branch
|
10 | 12 | # channel: test if the future tensorRT version test workflow is triggered from the release branch(release/2.5 etc....)
|
11 | 13 | 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"], |
15 | 17 | }
|
16 | 18 |
|
17 | 19 | # please update the python version you want to test with the future tensorRT version here
|
|
29 | 31 | "10.4.0": {
|
30 | 32 | "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",
|
31 | 33 | "strip_prefix": "TensorRT-10.4.0.26",
|
32 |
| - "sha256": "3a7de83778b9e9f812fd8901e07e0d7d6fc54ce633fcff2e340f994df2c6356c", |
33 | 34 | },
|
34 | 35 | "10.5.0": {
|
35 | 36 | "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",
|
36 | 37 | "strip_prefix": "TensorRT-10.5.0.18",
|
37 |
| - "sha256": "e6436f4164db4e44d727354dccf7d93755efb70d6fbfd6fa95bdfeb2e7331b24", |
38 | 38 | },
|
39 | 39 | "10.6.0": {
|
40 | 40 | "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",
|
41 | 41 | "strip_prefix": "TensorRT-10.6.0.26",
|
42 |
| - "sha256": "6c6d92c108a1b3368423e8f69f08d31269830f1e4c9da43b37ba34a176797254", |
43 | 42 | },
|
44 | 43 | "10.7.0": {
|
45 | 44 | "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 | 45 | "strip_prefix": "TensorRT-10.7.0.23",
|
47 |
| - "sha256": "fbdef004578e7ccd5ee51fe7f846b57422364a743372fd8f9f1d7dbd33f62879", |
48 | 46 | },
|
49 | 47 | },
|
50 | 48 | "linux": {
|
51 | 49 | "10.4.0": {
|
52 | 50 | "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",
|
53 | 51 | "strip_prefix": "TensorRT-10.4.0.26",
|
54 |
| - "sha256": "cb0273ecb3ba4db8993a408eedd354712301a6c7f20704c52cdf9f78aa97bbdb", |
55 | 52 | },
|
56 | 53 | "10.5.0": {
|
57 | 54 | "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",
|
58 | 55 | "strip_prefix": "TensorRT-10.5.0.18",
|
59 |
| - "sha256": "f404d379d639552a3e026cd5267213bd6df18a4eb899d6e47815bbdb34854958", |
60 | 56 | },
|
61 | 57 | "10.6.0": {
|
62 | 58 | "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",
|
63 | 59 | "strip_prefix": "TensorRT-10.6.0.26",
|
64 |
| - "sha256": "33d3c2f3f4c84dc7991a4337a6fde9ed33f5c8e5c4f03ac2eb6b994a382b03a0", |
65 | 60 | },
|
66 | 61 | "10.7.0": {
|
67 | 62 | "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 | 63 | "strip_prefix": "TensorRT-10.7.0.23",
|
69 |
| - "sha256": "d7f16520457caaf97ad8a7e94d802f89d77aedf9f361a255f2c216e2a3a40a11", |
70 | 64 | },
|
71 | 65 | },
|
72 | 66 | }
|
73 | 67 |
|
74 | 68 |
|
| 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 | + |
75 | 106 | def main(args: list[str]) -> None:
|
76 | 107 | parser = argparse.ArgumentParser()
|
77 | 108 | parser.add_argument(
|
@@ -109,6 +140,25 @@ def main(args: list[str]) -> None:
|
109 | 140 | f"{includes[0].validation_runner} is not the supported arch, currently only support windows and linux"
|
110 | 141 | )
|
111 | 142 |
|
| 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 | + |
112 | 162 | cuda_versions = CUDA_VERSIONS_DICT[channel]
|
113 | 163 | python_versions = PYTHON_VERSIONS_DICT[channel]
|
114 | 164 | tensorrt_versions = TENSORRT_VERSIONS_DICT[arch]
|
|
0 commit comments