2424 paths :
2525 - backends/nvidia/tensorrt/**
2626 - examples/nvidia/tensorrt/**
27+ - .github/workflows/tensorrt.yml
2728 workflow_dispatch :
2829 schedule :
2930 # Run daily at 3 AM UTC (after CUDA workflow at 2 AM)
6162 echo "::endgroup::"
6263
6364 echo "::group::Build TensorRT Backend"
64- # Build with TensorRT support
6565 cmake -S . -B cmake-out \
6666 -DCMAKE_BUILD_TYPE=Release \
6767 -DEXECUTORCH_BUILD_TENSORRT=ON \
8787 strategy :
8888 fail-fast : false
8989 matrix :
90- model : [add, mul, linear]
90+ model : [add, add_mul, conv1d, dl3, edsr, efficient_sam, emformer_join, emformer_transcribe, ic3, ic4, linear, mul, mv2, mv3, resnet18, resnet50, sdpa, softmax, w2l ]
9191 with :
9292 timeout : 60
9393 runner : linux.g5.4xlarge.nvidia.gpu
@@ -129,7 +129,7 @@ jobs:
129129 strategy :
130130 fail-fast : false
131131 matrix :
132- model : [add, mul, linear]
132+ model : [add, add_mul, conv1d, dl3, edsr, efficient_sam, emformer_join, emformer_transcribe, ic3, ic4, linear, mul, mv2, mv3, resnet18, resnet50, sdpa, softmax, w2l ]
133133 with :
134134 timeout : 60
135135 runner : linux.g5.4xlarge.nvidia.gpu
@@ -202,16 +202,47 @@ jobs:
202202 echo "::endgroup::"
203203
204204 echo "::group::Run TensorRT Backend Unit Tests"
205- # Run all test_*.py files in the backend test directory.
206205 # The -o "addopts=" override prevents pytest.ini from injecting
207206 # flags that would run unrelated test suites.
208- python -m pytest backends/nvidia/tensorrt/test/ -v -o "addopts="
207+ python -m pytest backends/nvidia/tensorrt/test/ \
208+ -v -o "addopts="
209+ echo "::endgroup::"
210+
211+ # ---- Export correctness tests ----
212+ # Exports all supported models and verifies numerical correctness
213+ # against eager PyTorch on GPU via the ExportCorrectnessTest class.
214+ test-export :
215+ name : test-export
216+ uses : pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
217+ permissions :
218+ id-token : write
219+ contents : read
220+ with :
221+ timeout : 120
222+ runner : linux.g5.4xlarge.nvidia.gpu
223+ gpu-arch-type : cuda
224+ gpu-arch-version : " 12.6"
225+ use-custom-docker-registry : false
226+ submodules : recursive
227+ ref : ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
228+ script : |
229+ set -eux
230+
231+ echo "::group::Install TensorRT"
232+ pip install tensorrt onnx
233+ echo "::endgroup::"
234+
235+ echo "::group::Install ExecuTorch"
236+ PYTHON_EXECUTABLE=python ./install_executorch.sh
237+ echo "::endgroup::"
238+
239+ echo "::group::Export all models and verify correctness"
240+ python -m pytest examples/nvidia/tensorrt/tests/test_export.py -v -o "addopts="
209241 echo "::endgroup::"
210242
211243 # Summary job to check all tests passed
212244 check-all-tensorrt-tests :
213- needs : [test-tensorrt-build, test-models-tensorrt-python, test-models-tensorrt-cpp, unittest-tensorrt]
214- # All four jobs must succeed for the overall check to pass.
245+ needs : [test-tensorrt-build, test-models-tensorrt-python, test-models-tensorrt-cpp, unittest-tensorrt, test-export]
215246 runs-on : ubuntu-latest
216247 if : always()
217248 steps :
@@ -233,4 +264,8 @@ jobs:
233264 echo "ERROR: TensorRT unit tests failed!"
234265 exit 1
235266 fi
267+ if [[ "${{ needs.test-export.result }}" != "success" ]]; then
268+ echo "ERROR: TensorRT export correctness tests failed!"
269+ exit 1
270+ fi
236271 echo "SUCCESS: All TensorRT backend tests passed!"
0 commit comments