Skip to content

Commit 4fd5e11

Browse files
committed
chore: rebase
2 parents 08f1636 + 249280d commit 4fd5e11

File tree

90 files changed

+1041
-552
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+1041
-552
lines changed

.bazelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ build --cxxopt="-fdiagnostics-color=always"
2525
build --cxxopt='-std=c++17'
2626
#build --linkopt="-Wl,--no-as-needed"
2727

28+
build:windows --cxxopt="/GS-" --cxxopt="/std:c++17" --cxxopt="/permissive-"
29+
build:windows --cxxopt="/wd4244" --cxxopt="/wd4267" --cxxopt="/wd4819"
30+
build:windows --features=windows_export_all_symbols
2831

2932
build:python --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0"
3033
build:python --linkopt="-D_GLIBCXX_USE_CXX11_ABI=0"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
set -eou pipefail
2+
source "${BUILD_ENV_FILE}"
3+
4+
# Install test index version of Torch and Torchvision
5+
${CONDA_RUN} ${PIP_INSTALL_TORCH} torchvision
6+
${CONDA_RUN} pip install pyyaml mpmath==1.3.0
7+
8+
# Install TRT 10 from PyPi
9+
${CONDA_RUN} pip install tensorrt==10.0.0b6 tensorrt-${CU_VERSION::4}-bindings==10.0.0b6 tensorrt-${CU_VERSION::4}-libs==10.0.0b6 --extra-index-url https://pypi.nvidia.com
10+
11+
# Install pre-built Torch-TRT
12+
${CONDA_RUN} pip install ${RUNNER_ARTIFACT_DIR}/torch_tensorrt*.whl
13+
14+
echo -e "Running test script";

.github/scripts/install-torch-tensorrt.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ source ${BUILD_ENV_FILE}
55
${CONDA_RUN} ${PIP_INSTALL_TORCH} torchvision
66
${CONDA_RUN} python -m pip install pyyaml mpmath==1.3.0
77
export TRT_VERSION=$(${CONDA_RUN} python -c "import versions; versions.tensorrt_version()")
8-
${CONDA_RUN} python -m pip install /opt/torch-tensorrt-builds/torch_tensorrt*+${CU_VERSION}*.whl tensorrt~=${TRT_VERSION} tensorrt-bindings~=${TRT_VERSION} --extra-index-url=https://pypi.ngc.nvidia.com
8+
9+
# Install TensorRT manually
10+
wget -q -P /opt/torch-tensorrt-builds/ https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.0.1/tars/TensorRT-10.0.1.6.Linux.x86_64-gnu.cuda-12.4.tar.gz
11+
tar -xzf /opt/torch-tensorrt-builds/TensorRT-10.0.1.6.Linux.x86_64-gnu.cuda-12.4.tar.gz -C /opt/torch-tensorrt-builds/
12+
python -m pip install /opt/torch-tensorrt-builds/TensorRT-10.0.1.6/python/tensorrt-10.0.1-cp${PYTHON_VERSION//./}-none-linux_x86_64.whl
13+
14+
# Install Torch-TensorRT
15+
${CONDA_RUN} python -m pip install /opt/torch-tensorrt-builds/torch_tensorrt*+${CU_VERSION}*.whl
916

1017
echo -e "Running test script";
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
name: Build and test Windows wheels
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
- nightly
9+
- release/*
10+
tags:
11+
# NOTE: Binary build pipelines should only get triggered on release candidate builds
12+
# Release candidate tags look like: v1.11.0-rc1
13+
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
14+
workflow_dispatch:
15+
16+
jobs:
17+
generate-matrix:
18+
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
19+
with:
20+
package-type: wheel
21+
os: windows
22+
test-infra-repository: pytorch/test-infra
23+
test-infra-ref: main
24+
with-rocm: false
25+
with-cpu: false
26+
27+
build:
28+
needs: generate-matrix
29+
permissions:
30+
id-token: write
31+
contents: read
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
include:
36+
- repository: pytorch/tensorrt
37+
pre-script: packaging/pre_build_script_windows.sh
38+
smoke-test-script: packaging/smoke_test_windows.py
39+
package-name: torch_tensorrt
40+
name: Build torch-tensorrt whl package
41+
uses: pytorch/test-infra/.github/workflows/build_wheels_windows.yml@main
42+
with:
43+
repository: ${{ matrix.repository }}
44+
ref: ""
45+
test-infra-repository: pytorch/test-infra
46+
test-infra-ref: main
47+
build-matrix: ${{ needs.generate-matrix.outputs.matrix }}
48+
pre-script: ${{ matrix.pre-script }}
49+
smoke-test-script: ${{ matrix.smoke-test-script }}
50+
package-name: ${{ matrix.package-name }}
51+
trigger-event: ${{ github.event_name }}
52+
53+
tests-py-dynamo-converters:
54+
name: Test dynamo converters [Python]
55+
needs: [generate-matrix, build]
56+
strategy:
57+
fail-fast: false
58+
matrix:
59+
include:
60+
- repository: pytorch/tensorrt
61+
package-name: torch_tensorrt
62+
uses: ./.github/workflows/windows-test.yml
63+
with:
64+
job-name: tests-py-dynamo-converters
65+
repository: "pytorch/tensorrt"
66+
ref: ""
67+
test-infra-repository: pytorch/test-infra
68+
test-infra-ref: main
69+
build-matrix: ${{ needs.generate-matrix.outputs.matrix }}
70+
pre-script: packaging/driver_upgrade.bat
71+
script: |
72+
export USE_HOST_DEPS=1
73+
pushd .
74+
cd tests/py/dynamo
75+
${CONDA_RUN} python -m pip install --pre pytest-xdist timm transformers parameterized expecttest==0.1.6 --use-deprecated=legacy-resolver
76+
${CONDA_RUN} python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/dynamo_converters_test_results.xml -n 10 conversion/
77+
popd
78+
79+
tests-py-dynamo-fe:
80+
name: Test dynamo frontend [Python]
81+
needs: [generate-matrix, build]
82+
strategy:
83+
fail-fast: false
84+
matrix:
85+
include:
86+
- repository: pytorch/tensorrt
87+
package-name: torch_tensorrt
88+
uses: ./.github/workflows/windows-test.yml
89+
with:
90+
job-name: tests-py-dynamo-fe
91+
repository: "pytorch/tensorrt"
92+
ref: ""
93+
test-infra-repository: pytorch/test-infra
94+
test-infra-ref: main
95+
build-matrix: ${{ needs.generate-matrix.outputs.matrix }}
96+
pre-script: packaging/driver_upgrade.bat
97+
script: |
98+
export USE_HOST_DEPS=1
99+
pushd .
100+
cd tests/py/dynamo
101+
${CONDA_RUN} python -m pip install --pre pytest-xdist timm transformers parameterized expecttest==0.1.6 --use-deprecated=legacy-resolver
102+
${CONDA_RUN} python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/dynamo_fe_test_results.xml --ir dynamo models/test_models_export.py
103+
${CONDA_RUN} python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/dyn_models_export.xml --ir dynamo models/test_dyn_models.py
104+
popd
105+
106+
tests-py-torch-compile-be:
107+
name: Test torch compile backend [Python]
108+
needs: [generate-matrix, build]
109+
strategy:
110+
fail-fast: false
111+
matrix:
112+
include:
113+
- repository: pytorch/tensorrt
114+
package-name: torch_tensorrt
115+
uses: ./.github/workflows/windows-test.yml
116+
with:
117+
job-name: tests-py-torch-compile-be
118+
repository: ${{ matrix.repository }}
119+
ref: ""
120+
test-infra-repository: pytorch/test-infra
121+
test-infra-ref: main
122+
pre-script: packaging/driver_upgrade.bat
123+
build-matrix: ${{ needs.generate-matrix.outputs.matrix }}
124+
script: |
125+
export USE_HOST_DEPS=1
126+
pushd .
127+
cd tests/py/dynamo
128+
${CONDA_RUN} python -m pip install --pre pytest-xdist timm transformers parameterized expecttest==0.1.6 --use-deprecated=legacy-resolver
129+
${CONDA_RUN} python -m pytest -n 10 --junitxml=${RUNNER_TEST_RESULTS_DIR}/torch_compile_be_test_results.xml backend/
130+
${CONDA_RUN} python -m pytest -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/torch_comple_be_e2e_test_results.xml --ir torch_compile models/test_models.py
131+
popd
132+
133+
tests-py-dynamo-core:
134+
name: Test dynamo core [Python]
135+
needs: [generate-matrix, build]
136+
strategy:
137+
fail-fast: false
138+
matrix:
139+
include:
140+
- repository: pytorch/tensorrt
141+
package-name: torch_tensorrt
142+
uses: ./.github/workflows/windows-test.yml
143+
with:
144+
job-name: tests-py-dynamo-core
145+
repository: "pytorch/tensorrt"
146+
ref: ""
147+
test-infra-repository: pytorch/test-infra
148+
test-infra-ref: main
149+
build-matrix: ${{ needs.generate-matrix.outputs.matrix }}
150+
pre-script: packaging/driver_upgrade.bat
151+
script: |
152+
export USE_HOST_DEPS=1
153+
pushd .
154+
cd tests/py/dynamo
155+
${CONDA_RUN} python -m pip install --pre pytest-xdist timm transformers parameterized expecttest==0.1.6 --use-deprecated=legacy-resolver
156+
${CONDA_RUN} python -m pytest -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_runtime_test_results.xml runtime/
157+
${CONDA_RUN} python -m pytest -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_partitioning_test_results.xml partitioning/
158+
${CONDA_RUN} python -m pytest -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_lowering_test_results.xml lowering/
159+
popd

.github/workflows/build-test.yml

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ on:
1515

1616
jobs:
1717
generate-matrix:
18-
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
18+
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@release/2.3
1919
with:
2020
package-type: wheel
2121
os: linux
2222
test-infra-repository: pytorch/test-infra
2323
test-infra-ref: main
24-
channel: test
24+
channel: release
2525
with-rocm: false
2626
with-cpu: false
2727

@@ -37,11 +37,11 @@ jobs:
3737
- repository: pytorch/tensorrt
3838
pre-script: packaging/pre_build_script.sh
3939
env-var-script: packaging/env_vars.txt
40-
post-script: ""
41-
smoke-test-script: ""
40+
post-script: packaging/post_build_script.sh
41+
smoke-test-script: packaging/smoke_test_script.sh
4242
package-name: torch_tensorrt
4343
name: Build torch-tensorrt whl package
44-
uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main
44+
uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@release/2.3
4545
with:
4646
repository: ${{ matrix.repository }}
4747
ref: ""
@@ -65,7 +65,8 @@ jobs:
6565
- repository: pytorch/tensorrt
6666
package-name: torch_tensorrt
6767
pre-script: packaging/pre_build_script.sh
68-
uses: pytorch/tensorrt/.github/workflows/linux-test.yml@main
68+
post-script: packaging/post_build_script.sh
69+
uses: pytorch/tensorrt/.github/workflows/linux-test.yml@release/2.3
6970
with:
7071
job-name: tests-py-torchscript-fe
7172
repository: "pytorch/tensorrt"
@@ -77,9 +78,11 @@ jobs:
7778
script: |
7879
export USE_HOST_DEPS=1
7980
export LD_LIBRARY_PATH=/usr/lib64:$LD_LIBRARY_PATH
81+
export LD_LIBRARY_PATH=/opt/torch-tensorrt-builds/TensorRT-10.0.1.6/lib:$LD_LIBRARY_PATH
8082
pushd .
8183
cd tests/modules
82-
${CONDA_RUN} python -m pip install --pre -r requirements.txt --use-deprecated=legacy-resolver
84+
# Don't use requirements.txt here as it contains tensorrt and torch which should have been installed by now.
85+
${CONDA_RUN} python -m pip install numpy packaging pyyaml transformers timm pybind11==2.6.2
8386
${CONDA_RUN} python hub.py
8487
popd
8588
pushd .
@@ -100,7 +103,8 @@ jobs:
100103
- repository: pytorch/tensorrt
101104
package-name: torch_tensorrt
102105
pre-script: packaging/pre_build_script.sh
103-
uses: pytorch/tensorrt/.github/workflows/linux-test.yml@main
106+
post-script: packaging/post_build_script.sh
107+
uses: pytorch/tensorrt/.github/workflows/linux-test.yml@release/2.3
104108
with:
105109
job-name: tests-py-dynamo-converters
106110
repository: "pytorch/tensorrt"
@@ -111,6 +115,7 @@ jobs:
111115
pre-script: ${{ matrix.pre-script }}
112116
script: |
113117
export USE_HOST_DEPS=1
118+
export LD_LIBRARY_PATH=/opt/torch-tensorrt-builds/TensorRT-10.0.1.6/lib:$LD_LIBRARY_PATH
114119
pushd .
115120
cd tests/py/dynamo
116121
${CONDA_RUN} python -m pip install --pre pytest-xdist timm transformers parameterized expecttest==0.1.6 --use-deprecated=legacy-resolver
@@ -127,7 +132,8 @@ jobs:
127132
- repository: pytorch/tensorrt
128133
package-name: torch_tensorrt
129134
pre-script: packaging/pre_build_script.sh
130-
uses: pytorch/tensorrt/.github/workflows/linux-test.yml@main
135+
post-script: packaging/post_build_script.sh
136+
uses: pytorch/tensorrt/.github/workflows/linux-test.yml@release/2.3
131137
with:
132138
job-name: tests-py-dynamo-fe
133139
repository: "pytorch/tensorrt"
@@ -138,6 +144,7 @@ jobs:
138144
pre-script: ${{ matrix.pre-script }}
139145
script: |
140146
export USE_HOST_DEPS=1
147+
export LD_LIBRARY_PATH=/opt/torch-tensorrt-builds/TensorRT-10.0.1.6/lib:$LD_LIBRARY_PATH
141148
pushd .
142149
cd tests/py/dynamo
143150
${CONDA_RUN} python -m pip install --pre pytest timm transformers parameterized expecttest==0.1.6 --use-deprecated=legacy-resolver
@@ -155,7 +162,8 @@ jobs:
155162
- repository: pytorch/tensorrt
156163
package-name: torch_tensorrt
157164
pre-script: packaging/pre_build_script.sh
158-
uses: pytorch/tensorrt/.github/workflows/linux-test.yml@main
165+
post-script: packaging/post_build_script.sh
166+
uses: pytorch/tensorrt/.github/workflows/linux-test.yml@release/2.3
159167
with:
160168
job-name: tests-py-dynamo-serde
161169
repository: "pytorch/tensorrt"
@@ -166,6 +174,7 @@ jobs:
166174
pre-script: ${{ matrix.pre-script }}
167175
script: |
168176
export USE_HOST_DEPS=1
177+
export LD_LIBRARY_PATH=/opt/torch-tensorrt-builds/TensorRT-10.0.1.6/lib:$LD_LIBRARY_PATH
169178
pushd .
170179
cd tests/py/dynamo
171180
${CONDA_RUN} python -m pip install --pre pytest timm transformers parameterized expecttest==0.1.6 --use-deprecated=legacy-resolver
@@ -182,7 +191,8 @@ jobs:
182191
- repository: pytorch/tensorrt
183192
package-name: torch_tensorrt
184193
pre-script: packaging/pre_build_script.sh
185-
uses: pytorch/tensorrt/.github/workflows/linux-test.yml@main
194+
post-script: packaging/post_build_script.sh
195+
uses: pytorch/tensorrt/.github/workflows/linux-test.yml@release/2.3
186196
with:
187197
job-name: tests-py-torch-compile-be
188198
repository: "pytorch/tensorrt"
@@ -193,6 +203,7 @@ jobs:
193203
pre-script: ${{ matrix.pre-script }}
194204
script: |
195205
export USE_HOST_DEPS=1
206+
export LD_LIBRARY_PATH=/opt/torch-tensorrt-builds/TensorRT-10.0.1.6/lib:$LD_LIBRARY_PATH
196207
pushd .
197208
cd tests/py/dynamo
198209
${CONDA_RUN} python -m pip install --pre pytest-xdist timm transformers parameterized expecttest==0.1.6 --use-deprecated=legacy-resolver
@@ -211,7 +222,8 @@ jobs:
211222
- repository: pytorch/tensorrt
212223
package-name: torch_tensorrt
213224
pre-script: packaging/pre_build_script.sh
214-
uses: pytorch/tensorrt/.github/workflows/linux-test.yml@main
225+
post-script: packaging/post_build_script.sh
226+
uses: pytorch/tensorrt/.github/workflows/linux-test.yml@release/2.3
215227
with:
216228
job-name: tests-py-dynamo-core
217229
repository: "pytorch/tensorrt"
@@ -222,6 +234,7 @@ jobs:
222234
pre-script: ${{ matrix.pre-script }}
223235
script: |
224236
export USE_HOST_DEPS=1
237+
export LD_LIBRARY_PATH=/opt/torch-tensorrt-builds/TensorRT-10.0.1.6/lib:$LD_LIBRARY_PATH
225238
pushd .
226239
cd tests/py/dynamo
227240
${CONDA_RUN} python -m pip install --pre pytest-xdist timm transformers parameterized expecttest==0.1.6 --use-deprecated=legacy-resolver
@@ -251,6 +264,7 @@ jobs:
251264
pre-script: ${{ matrix.pre-script }}
252265
script: |
253266
export USE_HOST_DEPS=1
267+
export LD_LIBRARY_PATH=/opt/torch-tensorrt-builds/TensorRT-10.0.1.6/lib:$LD_LIBRARY_PATH
254268
pushd .
255269
cd tests/py/core
256270
${CONDA_RUN} python -m pip install --pre pytest-xdist timm transformers parameterized expecttest==0.1.6 --use-deprecated=legacy-resolver

0 commit comments

Comments
 (0)