@@ -17,10 +17,10 @@ defaults:
1717 shell : bash
1818
1919jobs :
20- mlir-tensorrt-build-test :
21- name : ${{ matrix.arch }}-cu${{ matrix.cuda }}-trt${{ matrix.trt }}-build-test
20+ mlir-tensorrt-basic- build-test :
21+ name : ${{ matrix.arch }}-cu${{ matrix.cuda }}-trt${{ matrix.trt }}-basic- build-test
2222 strategy :
23- fail-fast : true
23+ fail-fast : false
2424 max-parallel : 1
2525 matrix : ${{ fromJSON(inputs.build-matrix) }}
2626 env :
3030 CHANNEL : ${{ inputs.channel }}
3131 ARCH : ${{ matrix.arch }}
3232 CMAKE_PRESET : ${{ matrix.cmake_preset }}
33- CCACHE_DIR : ${{ github.workspace }}/mlir-tensorrt/ccache
34- CPM_SOURCE_CACHE : ${{ github.workspace }}/mlir-tensorrt/.cache.cpm
3533 CCACHE_RESTORE_KEY : mlir-tensorrt-ccache-v1-${{ matrix.arch }}-${{ matrix.cmake_preset }}
3634 CPM_RESTORE_KEY : mlir-tensorrt-cpm-v1
3735 runs-on : ${{ matrix.github_runner }}
@@ -42,162 +40,101 @@ jobs:
4240 --shm-size=1g
4341 timeout-minutes : 120
4442 steps :
45- # Checkout the repository
46- - name : Checkout TensorRT-Incubator
47- uses : actions/checkout@v6
43+ # basic build and test
44+ - name : Basic Build and Test
45+ uses : ./.github/ actions/mlir-tensorrt-build-test
4846 with :
49- fetch-depth : 5
50-
51- # Create cache folders
52- - name : Create Cache Folders
53- run : |
54- set -euo pipefail
55- set -x
56- mkdir -p ${{ env.CCACHE_DIR }}
57- mkdir -p ${{ env.CPM_SOURCE_CACHE }}
58-
59- # Compute ccache key after checkout
60- - name : Compute CCache Key
61- id : ccache-key
62- run : |
63- hash=$( (find mlir-tensorrt/compiler \
64- mlir-tensorrt/common \
65- mlir-tensorrt/kernel \
66- mlir-tensorrt/tensorrt \
67- mlir-tensorrt/integrations \
68- mlir-tensorrt/executor \
69- -type f \( -name '*.cpp' -o -name '*.h' \) \
70- -exec sha256sum {} \; ; \
71- sha256sum mlir-tensorrt/DependencyProvider.cmake \
72- mlir-tensorrt/CMakeLists.txt) \
73- | sort | sha256sum | cut -d' ' -f1)
74- echo "key=${{ env.CCACHE_RESTORE_KEY }}-${hash}" >> $GITHUB_OUTPUT
47+ cpm_cache_restore_flag : true
7548
76- # Compute cpm key after checkout
77- - name : Compute CPM Key
78- id : cpm-key
79- run : |
80- hash=$(sha256sum mlir-tensorrt/DependencyProvider.cmake | cut -d' ' -f1)
81- echo "key=${{ env.CPM_RESTORE_KEY }}-${hash}" >> $GITHUB_OUTPUT
82-
83- # Restore cache, if exists.
84- - name : Restore CCache
85- id : restore-ccache
86- uses : actions/cache/restore@v4
87- with :
88- key : ${{ steps.ccache-key.outputs.key }}
89- restore-keys : |
90- ${{ env.CCACHE_RESTORE_KEY }}
91- path : |
92- ${{ env.CCACHE_DIR }}
93-
94- - name : Restore CPM cache
95- id : restore-cpm
96- uses : actions/cache/restore@v4
49+ mlir-tensorrt-asan-build-test :
50+ name : ${{ matrix.arch }}-cu${{ matrix.cuda }}-trt${{ matrix.trt }}-asan-build-test
51+ # if: ${{ inputs.channel == 'nightly' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
52+ strategy :
53+ fail-fast : false
54+ max-parallel : 1
55+ matrix : ${{ fromJSON(inputs.build-matrix) }}
56+ env :
57+ # eg. TENSORRT_VERSION: 10.12 or 10.13
58+ MLIR_TRT_DOWNLOAD_TENSORRT_VERSION : ${{ matrix.trt }}
59+ # eg. CHANNEL: nightly, test or release
60+ CHANNEL : ${{ inputs.channel }}
61+ ARCH : ${{ matrix.arch }}
62+ CMAKE_PRESET : ${{ matrix.cmake_preset }}-asan
63+ CCACHE_RESTORE_KEY : mlir-tensorrt-ccache-v1-${{ matrix.arch }}-${{ matrix.cmake_preset }}-asan
64+ CPM_RESTORE_KEY : mlir-tensorrt-cpm-v1
65+ runs-on : ${{ matrix.github_runner }}
66+ container :
67+ image : ${{ matrix.docker_image }}
68+ options : >-
69+ --gpus all
70+ --shm-size=1g
71+ timeout-minutes : 120
72+ steps :
73+ # asan build and test
74+ - name : ASAN Build and Test
75+ uses : ./.github/actions/mlir-tensorrt-build-test
9776 with :
98- key : ${{ steps.cpm-key.outputs.key }}
99- enableCrossOsArchive : true
100- restore-keys : |
101- ${{ env.CPM_RESTORE_KEY }}
102- # exclude only works for the relative path pattern
103- # restore must use the exactly same path defined in the save step, cannot ignore the exclude path
104- path : |
105- mlir-tensorrt/.cache.cpm/*
106- !mlir-tensorrt/.cache.cpm/tensorrt
107- !mlir-tensorrt/.cache.cpm/tensorrt/**
108-
109- # Build the project
110- - name : Build With CUDA:${{ matrix.cuda }} + TensorRT:${{ matrix.trt }}
111- env :
112- ENABLE_ASAN : " OFF"
113- ENABLE_NCCL : " OFF"
114- run : |
115- set -euo pipefail
116- set -x
117- cd mlir-tensorrt
118- # build only, skip tests
119- ./build_tools/scripts/cicd-build.sh --build_only
77+ cpm_cache_restore_flag : false
12078
121- # Save ccache when cache is not hit or cache was a fallback(cache-matched is not the same as the cache key)
122- - name : Save CCache
123- uses : actions/cache/save@v4
124- if : ${{ steps.restore-ccache.outputs.cache-hit != 'true' }}
79+ mlir-tensorrt-long-build-test :
80+ name : ${{ matrix.arch }}-cu${{ matrix.cuda }}-trt${{ matrix.trt }}-build-test
81+ # if: ${{ inputs.channel == 'nightly' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
82+ strategy :
83+ fail-fast : false
84+ max-parallel : 1
85+ matrix : ${{ fromJSON(inputs.build-matrix) }}
86+ env :
87+ # eg. TENSORRT_VERSION: 10.12 or 10.13
88+ MLIR_TRT_DOWNLOAD_TENSORRT_VERSION : ${{ matrix.trt }}
89+ # eg. CHANNEL: nightly, test or release
90+ CHANNEL : ${{ inputs.channel }}
91+ ARCH : ${{ matrix.arch }}
92+ CMAKE_PRESET : ${{ matrix.cmake_preset }}-long
93+ CCACHE_RESTORE_KEY : mlir-tensorrt-ccache-v1-${{ matrix.arch }}-${{ matrix.cmake_preset }}-long
94+ CPM_RESTORE_KEY : mlir-tensorrt-cpm-v1
95+ runs-on : ${{ matrix.github_runner }}
96+ container :
97+ image : ${{ matrix.docker_image }}
98+ options : >-
99+ --gpus all
100+ --shm-size=1g
101+ timeout-minutes : 120
102+ steps :
103+ # basic build and test
104+ - name : Basic Build and Test
105+ uses : ./.github/actions/mlir-tensorrt-build-test
125106 with :
126- key : ${{ steps.ccache-key.outputs.key }}
127- path : |
128- ${{ env.CCACHE_DIR }}
107+ cpm_cache_restore_flag : false
129108
130- # Save cpm cache
131- - name : Save CPM Cache
132- # cpm cache is shared across x86_64 and aarch64, we let only x86_64 to save cpm cache when in cache miss case
133- # this is to avoid both x86_64 and aarch64 to save cpm cache when in cache miss case
134- if : ${{ matrix.arch == 'x86_64' && steps.restore-cpm.outputs.cache-hit != 'true' }}
135- uses : actions/cache/save@v4
109+ mlir-tensorrt-nccl-long-build-test :
110+ name : ${{ matrix.arch }}-cu${{ matrix.cuda }}-trt${{ matrix.trt }}-nccl-long-build-test
111+ # if: ${{ inputs.channel == 'nightly' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
112+ strategy :
113+ fail-fast : false
114+ max-parallel : 1
115+ matrix : ${{ fromJSON(inputs.build-matrix) }}
116+ env :
117+ # eg. TENSORRT_VERSION: 10.12 or 10.13
118+ MLIR_TRT_DOWNLOAD_TENSORRT_VERSION : ${{ matrix.trt }}
119+ # eg. CHANNEL: nightly, test or release
120+ CHANNEL : ${{ inputs.channel }}
121+ ARCH : ${{ matrix.arch }}
122+ CMAKE_PRESET : ${{ matrix.cmake_preset }}-nccl-long
123+ CCACHE_RESTORE_KEY : mlir-tensorrt-ccache-v1-${{ matrix.arch }}-${{ matrix.cmake_preset }}-nccl-long
124+ CPM_RESTORE_KEY : mlir-tensorrt-cpm-v1
125+ runs-on : ${{ matrix.github_runner }}
126+ container :
127+ image : ${{ matrix.docker_image }}
128+ options : >-
129+ --gpus all
130+ --shm-size=1g
131+ timeout-minutes : 120
132+ steps :
133+ # nccl long build and test
134+ - name : NCCL Long Build and Test
135+ uses : ./.github/actions/mlir-tensorrt-build-test
136136 with :
137- key : ${{ steps.cpm-key.outputs.key }}
138- enableCrossOsArchive : true
139- # exclude only works for the relative path pattern
140- path : |
141- mlir-tensorrt/.cache.cpm/*
142- !mlir-tensorrt/.cache.cpm/tensorrt
143- !mlir-tensorrt/.cache.cpm/tensorrt/**
144-
145- # Run tests
146- - name : Run Basic Tests With CUDA:${{ matrix.cuda }} + TensorRT:${{ matrix.trt }}
147- id : basic-tests
148- env :
149- ENABLE_ASAN : " OFF"
150- ENABLE_NCCL : " OFF"
151- run : |
152- set -euo pipefail
153- set -x
154- cd mlir-tensorrt
155- # run tests
156- ./build_tools/scripts/cicd-build.sh
157-
158- # Run ASAN tests
159- - name : Run ASAN Tests With CUDA:${{ matrix.cuda }} + TensorRT:${{ matrix.trt }}
160- id : asan-tests
161- if : ${{ inputs.channel == 'nightly' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
162- env :
163- ENABLE_ASAN : " ON"
164- ENABLE_NCCL : " OFF"
165- run : |
166- set -euo pipefail
167- set -x
168- cd mlir-tensorrt
169- # run tests
170- ./build_tools/scripts/cicd-build.sh
171-
172- # Run long tests
173- - name : Run Long Tests With CUDA:${{ matrix.cuda }} + TensorRT:${{ matrix.trt }}
174- id : long-tests
175- if : ${{ inputs.channel == 'nightly' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
176- env :
177- LONG_TESTS : " ON"
178- ENABLE_ASAN : " OFF"
179- ENABLE_NCCL : " OFF"
180- run : |
181- set -euo pipefail
182- set -x
183- cd mlir-tensorrt
184- # run tests
185- ./build_tools/scripts/cicd-build.sh
186-
187- # Run NCCL long tests
188- - name : Run Long Tests With CUDA:${{ matrix.cuda }} + TensorRT:${{ matrix.trt }}
189- id : nccl-long-tests
190- if : ${{ inputs.channel == 'nightly' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
191- env :
192- LONG_TESTS : " ON"
193- ENABLE_ASAN : " OFF"
194- ENABLE_NCCL : " ON"
195- run : |
196- set -euo pipefail
197- set -x
198- cd mlir-tensorrt
199- # run tests
200- ./build_tools/scripts/cicd-build.sh
137+ cpm_cache_restore_flag : false
201138
202139concurrency :
203140 group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-mlir-tensorrt-${{ inputs.channel }}
0 commit comments