Skip to content

Commit 2646d24

Browse files
committed
Merge branch 'main' of github.com:NVIDIA/TensorRT-Incubator into dev-akhilg-demo-diffusion
2 parents 45e048e + ab9fa85 commit 2646d24

File tree

271 files changed

+12358
-3464
lines changed

Some content is hidden

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

271 files changed

+12358
-3464
lines changed

.github/workflows/mlir-tensorrt-ci.yml

Lines changed: 17 additions & 279 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ env:
1717

1818
jobs:
1919
mlir-tensorrt-test-pr:
20-
if: github.event_name == 'pull_request' && github.event.pull_request.draft == false
20+
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
2121
# `ubuntu-latest` is a CPU runner.
2222
# If selected, tests requiring GPU are not run.
2323
runs-on: ubuntu-latest
@@ -47,6 +47,7 @@ jobs:
4747
fetch-depth: 5
4848

4949
- name: Validate commit message
50+
if: ${{ github.event_name == 'pull_request' }}
5051
env:
5152
PR_HEAD_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
5253
run: |
@@ -83,6 +84,7 @@ jobs:
8384
# Run initial format check
8485
- name: Run python format and clang check
8586
uses: addnab/docker-run-action@v3
87+
if: ${{ github.event_name == 'pull_request' }}
8688
with:
8789
image: ${{ env.DEFAULT_IMAGE }}
8890
options: -v ${{ github.workspace }}:/tensorrt-incubator
@@ -110,320 +112,56 @@ jobs:
110112
- name: Create cache folder
111113
run: |
112114
mkdir -p ${{ github.workspace }}/ccache
113-
mkdir -p ${{ github.workspace }}/.ccache.cpm
115+
mkdir -p ${{ github.workspace }}/.cache.cpm
114116
115117
# Create cache action
116118
- name: Create cache action
117119
id: core-build-cache
118120
uses: actions/cache@v4
119121
with:
120-
key: ${{ runner.os }}-mlir-tensorrt-core-build
122+
key: ${{ runner.os }}-mlir-tensorrt-cache-${{ hashFiles('mlir-tensorrt/**/*.cpp', 'mlir-tensorrt/**/*.h', 'mlir-tensorrt/build_tools/**/*') }}
123+
restore-keys: |
124+
${{ runner.os }}-mlir-tensorrt-cache-
121125
path: |
122126
${{ github.workspace }}/ccache
123-
${{ github.workspace }}/.ccache.cpm
127+
${{ github.workspace }}/.cache.cpm/*
128+
!${{ github.workspace }}/.cache.cpm/tensorrt
124129
125130
# Run LIT tests with TensorRT 10
126131
- name: Run MLIR-TensorRT lit tests with TensorRT 10
127132
uses: addnab/docker-run-action@v3
128133
with:
129134
image: ${{ env.DEFAULT_IMAGE }}
130-
options: -v ${{ github.workspace }}/mlir-tensorrt:/mlir-tensorrt -v ${{ github.workspace }}/ccache:/ccache -v ${{ github.workspace }}/.ccache.cpm:/.ccache.cpm
135+
options: -v ${{ github.workspace }}/mlir-tensorrt:/mlir-tensorrt -v ${{ github.workspace }}/ccache:/ccache -v ${{ github.workspace }}/.cache.cpm:/.cache.cpm
131136
registry: ${{ env.REGISTRY }}
132137
username: ${{ github.actor }}
133138
password: ${{ secrets.GITHUB_TOKEN }}
134139
run: |
135-
export CCACHE_DIR="/ccache"
136-
export CCACHE_MAXSIZE=10G
137-
ccache --zero-stats || true
138-
ccache --show-stats || true
139-
140-
cd mlir-tensorrt
141-
cat > build_and_test.sh <<EOF
142-
#!/bin/bash
143-
set -e
144-
145-
python3 -m pip install -r python/requirements-dev.txt
146-
147-
cmake -B ./build -S . -G Ninja \
148-
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
149-
-DMLIR_TRT_PACKAGE_CACHE_DIR=/.cache.cpm \
150-
-DMLIR_TRT_ENABLE_ASSERTIONS=ON \
151-
-DMLIR_TRT_DOWNLOAD_TENSORRT_VERSION=10.2 \
152-
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
153-
-DMLIR_TRT_USE_LINKER=lld \
154-
-DMLIR_EXECUTOR_ENABLE_GPU_INTEGRATION_TESTS=OFF
155-
156-
ninja -C build all
157-
158-
ninja -C build check-mlir-executor
159-
ninja -C build check-mlir-tensorrt-dialect
160-
ninja -C build check-mlir-tensorrt
161-
162-
cd ..
163-
ccache --show-stats || true
164-
EOF
165-
166-
bash build_and_test.sh
167-
168-
# Run LIT tests with TensorRT 10 & ASAN
169-
- name: Run MLIR-TensorRT lit tests with TensorRT 10, ASAN enabled
170-
uses: addnab/docker-run-action@v3
171-
with:
172-
image: ${{ env.DEFAULT_IMAGE }}
173-
options: -v ${{ github.workspace }}/mlir-tensorrt:/mlir-tensorrt -v ${{ github.workspace }}/ccache:/ccache -v ${{ github.workspace }}/.ccache.cpm:/.ccache.cpm
174-
registry: ${{ env.REGISTRY }}
175-
username: ${{ github.actor }}
176-
password: ${{ secrets.GITHUB_TOKEN }}
177-
run: |
178-
export CCACHE_DIR="/ccache"
179-
export CCACHE_MAXSIZE=10G
180-
ccache --zero-stats || true
181-
ccache --show-stats || true
182-
183-
cd mlir-tensorrt
184-
cat > build_and_test.sh <<EOF
185-
#!/bin/bash
186-
set -e
187-
188-
python3 -m pip install -r python/requirements-dev.txt
189-
190-
cmake -B ./build -S . -G Ninja \
191-
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
192-
-DMLIR_TRT_PACKAGE_CACHE_DIR=/.cache.cpm \
193-
-DMLIR_TRT_ENABLE_ASSERTIONS=ON \
194-
-DMLIR_TRT_DOWNLOAD_TENSORRT_VERSION=10.2 \
195-
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
196-
-DMLIR_TRT_USE_LINKER=lld \
197-
-DMLIR_EXECUTOR_ENABLE_GPU_INTEGRATION_TESTS=OFF \
198-
-DENABLE_ASAN=ON
199-
200-
ninja -C build all
201-
202-
ninja -C build check-mlir-executor
203-
ninja -C build check-mlir-tensorrt-dialect
204-
ninja -C build check-mlir-tensorrt
205-
206-
cd ..
207-
ccache --show-stats || true
208-
EOF
209-
210-
bash build_and_test.sh
211-
212-
# Run LIT tests with TensorRT 9
213-
- name: Run MLIR-TensorRT lit tests with TensorRT 9
214-
uses: addnab/docker-run-action@v3
215-
with:
216-
image: ${{ env.DEFAULT_IMAGE }}
217-
options: -v ${{ github.workspace }}/mlir-tensorrt:/mlir-tensorrt -v ${{ github.workspace }}/ccache:/ccache -v ${{ github.workspace }}/.ccache.cpm:/.ccache.cpm
218-
registry: ${{ env.REGISTRY }}
219-
username: ${{ github.actor }}
220-
password: ${{ secrets.GITHUB_TOKEN }}
221-
run: |
222-
export CCACHE_DIR="/ccache"
223-
export CCACHE_MAXSIZE=10G
224-
ccache --zero-stats || true
225-
ccache --show-stats || true
226-
227-
cd mlir-tensorrt
228-
cat > build_and_test.sh <<EOF
229-
#!/bin/bash
230-
set -e
231-
232-
python3 -m pip install -r python/requirements-dev.txt
233-
234-
cmake -B ./build -S . -G Ninja \
235-
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
236-
-DMLIR_TRT_PACKAGE_CACHE_DIR=/.cache.cpm \
237-
-DMLIR_TRT_ENABLE_ASSERTIONS=ON \
238-
-DMLIR_TRT_DOWNLOAD_TENSORRT_VERSION=9.2.0.5 \
239-
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
240-
-DMLIR_TRT_USE_LINKER=lld \
241-
-DMLIR_EXECUTOR_ENABLE_GPU_INTEGRATION_TESTS=OFF
242-
243-
ninja -C build all
244-
245-
ninja -C build check-mlir-executor
246-
ninja -C build check-mlir-tensorrt-dialect
247-
ninja -C build check-mlir-tensorrt
248-
249-
cd ..
250-
ccache --show-stats || true
251-
EOF
252-
253-
bash build_and_test.sh
254-
255-
mlir-tensorrt-test-main:
256-
if: github.event_name == 'push'
257-
# `ubuntu-latest` is a CPU runner.
258-
# If selected, tests requiring GPU are not run.
259-
runs-on: ubuntu-latest
260-
261-
steps:
262-
# Free some disk space, otherwise we get OOM error.
263-
- name: Free disk space
264-
run: |
265-
sudo rm -rf \
266-
/usr/share/dotnet "$AGENT_TOOLSDIRECTORY" /usr/local/lib/android /opt/ghc \
267-
/usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \
268-
/usr/lib/jvm
269-
270-
sudo apt-get purge microsoft-edge-stable || true
271-
sudo apt-get purge google-cloud-cli || true
272-
sudo apt-get purge dotnet-sdk-* || true
273-
sudo apt-get purge google-chrome-stable || true
274-
275-
sudo apt-get autoremove -y
276-
sudo apt-get autoclean -y
277-
278-
# Value of `github.workspace` is /home/runner/work/{repo_name}/{repo-name}
279-
# i.e. /home/runner/work/TensorRT-Incubator/TensorRT-Incubator in our case.
280-
# After this action, repo is cloned inside above path.
281-
- uses: actions/checkout@v4
282-
with:
283-
fetch-depth: 5
284-
285-
# Create cache folders
286-
- name: Create cache folder
287-
run: |
288-
mkdir -p ${{ github.workspace }}/ccache
289-
mkdir -p ${{ github.workspace }}/.ccache.cpm
290-
291-
# Create cache action
292-
- name: Create cache action
293-
id: core-build-cache
294-
uses: actions/cache@v4
295-
with:
296-
key: ${{ runner.os }}-mlir-tensorrt-core-build
297-
path: |
298-
${{ github.workspace }}/ccache
299-
${{ github.workspace }}/.ccache.cpm
300-
301-
# Run LIT tests with TensorRT 10
302-
- name: Run MLIR-TensorRT lit tests with TensorRT 10
303-
uses: addnab/docker-run-action@v3
304-
with:
305-
image: ${{ env.DEFAULT_IMAGE }}
306-
options: -v ${{ github.workspace }}/mlir-tensorrt:/mlir-tensorrt -v ${{ github.workspace }}/ccache:/ccache -v ${{ github.workspace }}/.ccache.cpm:/.ccache.cpm
307-
registry: ${{ env.REGISTRY }}
308-
username: ${{ github.actor }}
309-
password: ${{ secrets.GITHUB_TOKEN }}
310-
run: |
311-
export CCACHE_DIR="/ccache"
312-
export CCACHE_MAXSIZE=10G
313-
ccache --zero-stats || true
314-
ccache --show-stats || true
315-
316140
cd mlir-tensorrt
317-
cat > build_and_test.sh <<EOF
318-
#!/bin/bash
319-
set -e
320-
321-
python3 -m pip install -r python/requirements-dev.txt
322-
323-
cmake -B ./build -S . -G Ninja \
324-
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
325-
-DMLIR_TRT_PACKAGE_CACHE_DIR=/.cache.cpm \
326-
-DMLIR_TRT_ENABLE_ASSERTIONS=ON \
327-
-DMLIR_TRT_DOWNLOAD_TENSORRT_VERSION=10.2 \
328-
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
329-
-DMLIR_TRT_USE_LINKER=lld \
330-
-DMLIR_EXECUTOR_ENABLE_GPU_INTEGRATION_TESTS=OFF
331-
332-
ninja -C build all
333-
334-
ninja -C build check-mlir-executor
335-
ninja -C build check-mlir-tensorrt-dialect
336-
ninja -C build check-mlir-tensorrt
337-
338-
cd ..
339-
ccache --show-stats || true
340-
EOF
341-
342-
bash build_and_test.sh
141+
./build_tools/scripts/cicd_build.sh
343142
344143
# Run LIT tests with TensorRT 10 & ASAN
345144
- name: Run MLIR-TensorRT lit tests with TensorRT 10, ASAN enabled
346145
uses: addnab/docker-run-action@v3
347146
with:
348147
image: ${{ env.DEFAULT_IMAGE }}
349-
options: -v ${{ github.workspace }}/mlir-tensorrt:/mlir-tensorrt -v ${{ github.workspace }}/ccache:/ccache -v ${{ github.workspace }}/.ccache.cpm:/.ccache.cpm
148+
options: -v ${{ github.workspace }}/mlir-tensorrt:/mlir-tensorrt -v ${{ github.workspace }}/ccache:/ccache -v ${{ github.workspace }}/.cache.cpm:/.cache.cpm
350149
registry: ${{ env.REGISTRY }}
351150
username: ${{ github.actor }}
352151
password: ${{ secrets.GITHUB_TOKEN }}
353152
run: |
354-
export CCACHE_DIR="/ccache"
355-
export CCACHE_MAXSIZE=10G
356-
ccache --zero-stats || true
357-
ccache --show-stats || true
358-
359153
cd mlir-tensorrt
360-
cat > build_and_test.sh <<EOF
361-
#!/bin/bash
362-
set -e
363-
364-
python3 -m pip install -r python/requirements-dev.txt
154+
ENABLE_ASAN=ON ./build_tools/scripts/cicd_build.sh
365155
366-
cmake -B ./build -S . -G Ninja \
367-
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
368-
-DMLIR_TRT_PACKAGE_CACHE_DIR=/.cache.cpm \
369-
-DMLIR_TRT_ENABLE_ASSERTIONS=ON \
370-
-DMLIR_TRT_DOWNLOAD_TENSORRT_VERSION=10.2 \
371-
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
372-
-DMLIR_TRT_USE_LINKER=lld \
373-
-DMLIR_EXECUTOR_ENABLE_GPU_INTEGRATION_TESTS=OFF \
374-
-DENABLE_ASAN=ON
375-
376-
ninja -C build all
377-
378-
ninja -C build check-mlir-executor
379-
ninja -C build check-mlir-tensorrt-dialect
380-
ninja -C build check-mlir-tensorrt
381-
382-
cd ..
383-
ccache --show-stats || true
384-
EOF
385-
386-
bash build_and_test.sh
387-
388-
# Run LIT tests with TensorRT 9
389-
- name: Run MLIR-TensorRT lit tests with TensorRT 9
156+
# Run LIT tests with TensorRT 8
157+
- name: Run MLIR-TensorRT lit tests with TensorRT 8
390158
uses: addnab/docker-run-action@v3
391159
with:
392160
image: ${{ env.DEFAULT_IMAGE }}
393-
options: -v ${{ github.workspace }}/mlir-tensorrt:/mlir-tensorrt -v ${{ github.workspace }}/ccache:/ccache -v ${{ github.workspace }}/.ccache.cpm:/.ccache.cpm
161+
options: -v ${{ github.workspace }}/mlir-tensorrt:/mlir-tensorrt -v ${{ github.workspace }}/ccache:/ccache -v ${{ github.workspace }}/.cache.cpm:/.cache.cpm
394162
registry: ${{ env.REGISTRY }}
395163
username: ${{ github.actor }}
396164
password: ${{ secrets.GITHUB_TOKEN }}
397165
run: |
398-
export CCACHE_DIR="/ccache"
399-
export CCACHE_MAXSIZE=10G
400-
ccache --zero-stats || true
401-
ccache --show-stats || true
402-
403166
cd mlir-tensorrt
404-
cat > build_and_test.sh <<EOF
405-
#!/bin/bash
406-
set -e
407-
408-
python3 -m pip install -r python/requirements-dev.txt
409-
410-
cmake -B ./build -S . -G Ninja \
411-
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
412-
-DMLIR_TRT_PACKAGE_CACHE_DIR=/.cache.cpm \
413-
-DMLIR_TRT_ENABLE_ASSERTIONS=ON \
414-
-DMLIR_TRT_DOWNLOAD_TENSORRT_VERSION=9.2.0.5 \
415-
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
416-
-DMLIR_TRT_USE_LINKER=lld \
417-
-DMLIR_EXECUTOR_ENABLE_GPU_INTEGRATION_TESTS=OFF
418-
419-
ninja -C build all
420-
421-
ninja -C build check-mlir-executor
422-
ninja -C build check-mlir-tensorrt-dialect
423-
ninja -C build check-mlir-tensorrt
424-
425-
cd ..
426-
ccache --show-stats || true
427-
EOF
428-
429-
bash build_and_test.sh
167+
DOWNLOAD_TENSORRT_VERSION="8.6.1.6" ./build_tools/scripts/cicd_build.sh

.github/workflows/tripy-l0.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ jobs:
6969
image: ${{ env.l0_image }}
7070
options: --gpus all -v ${{ github.workspace }}/tripy:/tripy
7171
run: |
72-
pytest --cov=tripy/ --cov-config=.coveragerc tests/ -v -m "not l1 and not manual" -n 4 --durations=15 --ignore tests/performance
72+
pytest --cov=tripy/ --cov-config=.coveragerc tests/ -v -m "not l1" -n 4 --durations=15 --ignore tests/performance
7373
7474
- name: Run performance benchmarks
7575
uses: addnab/docker-run-action@v3
7676
with:
7777
image: ${{ env.l0_image }}
7878
options: --gpus all -v ${{ github.workspace }}/tripy:/tripy
7979
run: |
80-
pytest tests/performance -v -m "not l1 and not manual" --benchmark-warmup=on --benchmark-json benchmark.json
80+
pytest tests/performance -v -m "not l1" --benchmark-warmup=on --benchmark-json benchmark.json
8181
8282
- name: Store benchmark result
8383
uses: benchmark-action/github-action-benchmark@v1

.github/workflows/tripy-l1.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,14 @@ jobs:
3535
- name: l1-test
3636
run: |
3737
cd /tripy/
38-
pytest --cov=tripy/ --cov-config=.coveragerc tests/ -v -m "l1 and not manual" -n 4 --durations=15 --ignore tests/performance
38+
pytest --cov=tripy/ --cov-config=.coveragerc tests/ -v -m "l1" -n 4 --durations=15 --ignore tests/performance
39+
40+
# For some tests, we want to use the public build instead of the latest commit.
41+
- name: l1-test-release-package
42+
run: |
43+
cd /tripy/
44+
unset PYTHONPATH
45+
pip uninstall tripy -y
46+
pip install --no-index -f https://nvidia.github.io/TensorRT-Incubator/packages.html tripy --no-deps
47+
pip install -f https://nvidia.github.io/TensorRT-Incubator/packages.html tripy
48+
pytest --cov=tripy/ --cov-config=.coveragerc tests/ -v -m "l1_release_package" -n 4 --durations=15 --ignore tests/performance

0 commit comments

Comments
 (0)