Skip to content

Commit

Permalink
Merge branch 'main' into fix_grid_sample
Browse files Browse the repository at this point in the history
  • Loading branch information
HolyWu committed Jan 19, 2025
2 parents 32caa07 + eff9b26 commit e58c6f6
Show file tree
Hide file tree
Showing 212 changed files with 9,580 additions and 2,141 deletions.
78 changes: 69 additions & 9 deletions .github/scripts/generate-tensorrt-test-matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
import json
import sys

import requests # type: ignore[import-untyped]

# please update the cuda version you want to test with the future tensorRT version here
# channel: nightly if the future tensorRT version test workflow is triggered from the main branch or your personal branch
# channel: test if the future tensorRT version test workflow is triggered from the release branch(release/2.5 etc....)
CUDA_VERSIONS_DICT = {
"nightly": ["cu124"],
"test": ["cu121", "cu124"],
"release": ["cu121", "cu124"],
"nightly": ["cu126"],
"test": ["cu124", "cu126"],
"release": ["cu124", "cu126"],
}

# please update the python version you want to test with the future tensorRT version here
Expand All @@ -29,39 +31,78 @@
"10.4.0": {
"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",
"strip_prefix": "TensorRT-10.4.0.26",
"sha256": "3a7de83778b9e9f812fd8901e07e0d7d6fc54ce633fcff2e340f994df2c6356c",
},
"10.5.0": {
"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",
"strip_prefix": "TensorRT-10.5.0.18",
"sha256": "e6436f4164db4e44d727354dccf7d93755efb70d6fbfd6fa95bdfeb2e7331b24",
},
"10.6.0": {
"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",
"strip_prefix": "TensorRT-10.6.0.26",
"sha256": "6c6d92c108a1b3368423e8f69f08d31269830f1e4c9da43b37ba34a176797254",
},
"10.7.0": {
"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",
"strip_prefix": "TensorRT-10.7.0.23",
},
},
"linux": {
"10.4.0": {
"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",
"strip_prefix": "TensorRT-10.4.0.26",
"sha256": "cb0273ecb3ba4db8993a408eedd354712301a6c7f20704c52cdf9f78aa97bbdb",
},
"10.5.0": {
"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",
"strip_prefix": "TensorRT-10.5.0.18",
"sha256": "f404d379d639552a3e026cd5267213bd6df18a4eb899d6e47815bbdb34854958",
},
"10.6.0": {
"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",
"strip_prefix": "TensorRT-10.6.0.26",
"sha256": "33d3c2f3f4c84dc7991a4337a6fde9ed33f5c8e5c4f03ac2eb6b994a382b03a0",
},
"10.7.0": {
"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",
"strip_prefix": "TensorRT-10.7.0.23",
},
},
}


def check_new_tensorrt_version(
major: int = 10, patch_from: int = 0
) -> tuple[bool, str, str, str, str]:
def check_file_availability(url: str) -> bool:
try:
response = requests.head(url, allow_redirects=True)
if response.status_code == 200:
content_type = response.headers.get("Content-Type", "")
content_disposition = response.headers.get("Content-Disposition", "")
if "application" in content_type or "attachment" in content_disposition:
return True
return False
except requests.RequestException:
return False

trt_linux_release_url = ""
trt_win_release_url = ""

# calculate the next minor version
minor = int(list(TENSORRT_VERSIONS_DICT["linux"].keys())[-1].split(".")[1]) + 1
trt_version = f"{major}.{minor}.0"
for patch in range(patch_from, 50):
for cuda_minor in range(4, 11):
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"
if check_file_availability(trt_linux_release_url_candidate):
trt_linux_release_url = trt_linux_release_url_candidate
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"
return (
True,
trt_version,
str(patch),
trt_linux_release_url,
trt_win_release_url,
)
return False, "", "", "", ""


def main(args: list[str]) -> None:
parser = argparse.ArgumentParser()
parser.add_argument(
Expand Down Expand Up @@ -99,6 +140,25 @@ def main(args: list[str]) -> None:
f"{includes[0].validation_runner} is not the supported arch, currently only support windows and linux"
)

(
new_trt_available,
trt_version,
trt_patch,
trt_linux_release_url,
trt_win_release_url,
) = check_new_tensorrt_version(major=10, patch_from=0)
if new_trt_available:
TENSORRT_VERSIONS_DICT["linux"][trt_version] = {}
TENSORRT_VERSIONS_DICT["linux"][trt_version]["urls"] = trt_linux_release_url
TENSORRT_VERSIONS_DICT["linux"][trt_version][
"strip_prefix"
] = f"TensorRT-{trt_version}.{trt_patch}"
TENSORRT_VERSIONS_DICT["windows"][trt_version] = {}
TENSORRT_VERSIONS_DICT["windows"][trt_version]["urls"] = trt_win_release_url
TENSORRT_VERSIONS_DICT["windows"][trt_version][
"strip_prefix"
] = f"TensorRT-{trt_version}.{trt_patch}"

cuda_versions = CUDA_VERSIONS_DICT[channel]
python_versions = PYTHON_VERSIONS_DICT[channel]
tensorrt_versions = TENSORRT_VERSIONS_DICT[arch]
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/generate_binary_build_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
XPU = "xpu"


CURRENT_NIGHTLY_VERSION = "2.6.0"
CURRENT_NIGHTLY_VERSION = "2.7.0"
CURRENT_CANDIDATE_VERSION = "2.5.1"
CURRENT_STABLE_VERSION = "2.5.1"
CURRENT_VERSION = CURRENT_STABLE_VERSION
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/assigner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Assign
uses: ./.github/actions/assigner
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-tensorrt-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ jobs:
rm -rf "${RUNNER_TEMP}/*"
fi
echo "::endgroup::"
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# Support the use case where we need to checkout someone's fork
repository: ${{ inputs.test-infra-repository }}
ref: ${{ inputs.test-infra-ref }}
path: test-infra
- uses: actions/checkout@v3
- uses: actions/checkout@v4
if: ${{ env.ARCH == 'aarch64' }}
with:
# Support the use case where we need to checkout someone's fork
Expand Down Expand Up @@ -212,7 +212,7 @@ jobs:
# NB: Only upload to GitHub after passing smoke tests
- name: Upload wheel to GitHub
continue-on-error: true
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.UPLOAD_ARTIFACT_NAME }}
path: ${{ inputs.repository }}/dist
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-tensorrt-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
# to have a conversation
timeout-minutes: 120
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# Support the use case where we need to checkout someone's fork
repository: ${{ inputs.test-infra-repository }}
Expand Down Expand Up @@ -216,7 +216,7 @@ jobs:
# NB: Only upload to GitHub after passing smoke tests
- name: Upload wheel to GitHub
continue-on-error: true
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.UPLOAD_ARTIFACT_NAME }}
path: ${{ inputs.repository }}/dist/
Expand Down
28 changes: 20 additions & 8 deletions .github/workflows/build-test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ jobs:
matrix: ${{ steps.generate.outputs.matrix }}
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: pytorch/tensorrt
- name: Generate release matrix
Expand Down Expand Up @@ -136,7 +136,9 @@ jobs:
export USE_HOST_DEPS=1
export CI_BUILD=1
pushd .
cd tests/py/dynamo
cd tests/py
python -m pip install -r requirements.txt
cd dynamo
python -m pytest -ra --junitxml=${RUNNER_TEST_RESULTS_DIR}/dynamo_converters_test_results.xml -n 4 conversion/
popd
Expand Down Expand Up @@ -165,7 +167,9 @@ jobs:
export USE_HOST_DEPS=1
export CI_BUILD=1
pushd .
cd tests/py/dynamo
cd tests/py
python -m pip install -r requirements.txt
cd dynamo
python -m pytest -ra --junitxml=${RUNNER_TEST_RESULTS_DIR}/dyn_models_export.xml --ir dynamo models/
popd
Expand Down Expand Up @@ -194,7 +198,9 @@ jobs:
export USE_HOST_DEPS=1
export CI_BUILD=1
pushd .
cd tests/py/dynamo
cd tests/py
python -m pip install -r requirements.txt
cd dynamo
python -m pytest -ra --junitxml=${RUNNER_TEST_RESULTS_DIR}/export_serde_test_results.xml --ir dynamo models/test_export_serde.py
python -m pytest -ra --junitxml=${RUNNER_TEST_RESULTS_DIR}/reexport_test_results.xml --ir dynamo models/test_reexport.py
popd
Expand Down Expand Up @@ -224,7 +230,9 @@ jobs:
export USE_HOST_DEPS=1
export CI_BUILD=1
pushd .
cd tests/py/dynamo
cd tests/py
python -m pip install -r requirements.txt
cd dynamo
python -m pytest -ra -n 10 --junitxml=${RUNNER_TEST_RESULTS_DIR}/torch_compile_be_test_results.xml backend/
python -m pytest -ra -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/torch_complete_be_e2e_test_results.xml --ir torch_compile models/test_models.py
python -m pytest -ra --junitxml=${RUNNER_TEST_RESULTS_DIR}/torch_compile_dyn_models_export.xml --ir torch_compile models/test_dyn_models.py
Expand Down Expand Up @@ -255,7 +263,9 @@ jobs:
export USE_HOST_DEPS=1
export CI_BUILD=1
pushd .
cd tests/py/dynamo
cd tests/py
python -m pip install -r requirements.txt
cd dynamo
python -m pytest -ra -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_runtime_test_results.xml --ignore runtime/test_002_cudagraphs_py.py --ignore runtime/test_002_cudagraphs_cpp.py runtime/
python -m pytest -ra -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_partitioning_test_results.xml partitioning/
python -m pytest -ra -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_lowering_test_results.xml lowering/
Expand Down Expand Up @@ -286,7 +296,9 @@ jobs:
export USE_HOST_DEPS=1
export CI_BUILD=1
pushd .
cd tests/py/dynamo
cd tests/py
python -m pip install -r requirements.txt
cd dynamo
nvidia-smi
python -m pytest -ra --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_runtime_cudagraphs_cpp_test_results.xml runtime/test_002_cudagraphs_cpp.py || true
python -m pytest -ra --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_runtime_cudagraphs_py_test_results.xml runtime/test_002_cudagraphs_py.py || true
Expand Down
32 changes: 24 additions & 8 deletions .github/workflows/build-test-tensorrt-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Build and Test Torch-TensorRT on Linux with Future TensorRT Versions

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

permissions:
id-token: write
Expand All @@ -25,16 +27,18 @@ jobs:
matrix: ${{ steps.generate.outputs.matrix }}
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: pytorch/tensorrt
- name: Generate tensorrt matrix
id: generate
run: |
set -eou pipefail
python -m pip install --upgrade pip
pip install requests
MATRIX_BLOB=${{ toJSON(needs.generate-matrix.outputs.matrix) }}
MATRIX_BLOB="$(python3 .github/scripts/generate-tensorrt-test-matrix.py --matrix "${MATRIX_BLOB}")"
echo "${MATRIX_BLOB}"
Expand Down Expand Up @@ -128,7 +132,9 @@ jobs:
export USE_HOST_DEPS=1
export CI_BUILD=1
pushd .
cd tests/py/dynamo
cd tests/py
python -m pip install -r requirements.txt
cd dynamo
python -m pytest -ra --junitxml=${RUNNER_TEST_RESULTS_DIR}/dynamo_converters_test_results.xml -n 4 conversion/
popd
Expand Down Expand Up @@ -157,7 +163,9 @@ jobs:
export USE_HOST_DEPS=1
export CI_BUILD=1
pushd .
cd tests/py/dynamo
cd tests/py
python -m pip install -r requirements.txt
cd dynamo
python -m pytest -ra --junitxml=${RUNNER_TEST_RESULTS_DIR}/dyn_models_export.xml --ir dynamo models/
popd
Expand Down Expand Up @@ -186,7 +194,9 @@ jobs:
export USE_HOST_DEPS=1
export CI_BUILD=1
pushd .
cd tests/py/dynamo
cd tests/py
python -m pip install -r requirements.txt
cd dynamo
python -m pytest -ra --junitxml=${RUNNER_TEST_RESULTS_DIR}/export_serde_test_results.xml --ir dynamo models/test_export_serde.py
popd
Expand Down Expand Up @@ -215,7 +225,9 @@ jobs:
export USE_HOST_DEPS=1
export CI_BUILD=1
pushd .
cd tests/py/dynamo
cd tests/py
python -m pip install -r requirements.txt
cd dynamo
python -m pytest -ra -n 10 --junitxml=${RUNNER_TEST_RESULTS_DIR}/torch_compile_be_test_results.xml backend/
python -m pytest -ra -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/torch_complete_be_e2e_test_results.xml --ir torch_compile models/test_models.py
python -m pytest -ra --junitxml=${RUNNER_TEST_RESULTS_DIR}/torch_compile_dyn_models_export.xml --ir torch_compile models/test_dyn_models.py
Expand Down Expand Up @@ -246,7 +258,9 @@ jobs:
export USE_HOST_DEPS=1
export CI_BUILD=1
pushd .
cd tests/py/dynamo
cd tests/py
python -m pip install -r requirements.txt
cd dynamo
python -m pytest -ra -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_runtime_test_results.xml --ignore runtime/test_002_cudagraphs_py.py --ignore runtime/test_002_cudagraphs_cpp.py runtime/
python -m pytest -ra -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_partitioning_test_results.xml partitioning/
python -m pytest -ra -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_lowering_test_results.xml lowering/
Expand Down Expand Up @@ -277,7 +291,9 @@ jobs:
export USE_HOST_DEPS=1
export CI_BUILD=1
pushd .
cd tests/py/dynamo
cd tests/py
python -m pip install -r requirements.txt
cd dynamo
nvidia-smi
python -m pytest -ra --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_runtime_cudagraphs_cpp_test_results.xml runtime/test_002_cudagraphs_cpp.py || true
python -m pytest -ra --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_runtime_cudagraphs_py_test_results.xml runtime/test_002_cudagraphs_py.py || true
Expand Down
Loading

0 comments on commit e58c6f6

Please sign in to comment.