@@ -32,7 +32,7 @@ import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
3232// NOTE: these lines are scanned by docker/dev_common.sh. Please update the regex as needed. -->
3333ci_lint = ' tlcpack/ci-lint:20221025-182121-e41d0ed6e'
3434ci_gpu = ' tlcpack/ci-gpu:20221128-070141-ae4fd7df7'
35- ci_cpu = ' tlcpack/ci-cpu:20230110-070003-d00168ffb '
35+ ci_cpu = ' tlcpackstaging/ci_cpu:relax-20230217-001605-fcb3d9e71 '
3636ci_wasm = ' tlcpack/ci-wasm:v0.72'
3737ci_i386 = ' tlcpack/ci-i386:v0.75'
3838ci_qemu = ' tlcpack/ci-qemu:v0.11'
@@ -135,9 +135,9 @@ def should_skip_ci(pr_number) {
135135
136136cancel_previous_build()
137137
138- def lint () {
138+ def lint (node_type ) {
139139stage(' Prepare' ) {
140- node(' CPU-SMALL ' ) {
140+ node(node_type ) {
141141 // When something is provided in ci_*_param, use it, otherwise default with ci_*
142142 ci_lint = params. ci_lint_param ?: ci_lint
143143 ci_cpu = params. ci_cpu_param ?: ci_cpu
@@ -161,10 +161,12 @@ stage('Prepare') {
161161 """ , label : ' Docker image names' )
162162 }
163163}
164+ }
164165
166+ def sanity_check (node_type ) {
165167stage(' Sanity Check' ) {
166168 timeout(time : max_time, unit : ' MINUTES' ) {
167- node(' CPU-SMALL ' ) {
169+ node(node_type ) {
168170 ws(per_exec_ws(' tvm/sanity' )) {
169171 init_git()
170172 is_docs_only_build = sh (
@@ -187,8 +189,17 @@ stage('Sanity Check') {
187189 }
188190}
189191}
192+ try {
193+ lint(' CPU-SMALL-SPOT' )
194+ } catch (Exception ex) {
195+ lint(' CPU-SMALL' )
196+ }
190197
191- lint()
198+ try {
199+ sanity_check(' CPU-SPOT' )
200+ } catch (Exception ex) {
201+ sanity_check(' CPU' )
202+ }
192203
193204// Run make. First try to do an incremental make from a previous workspace in hope to
194205// accelerate the compilation. If something is wrong, clean the workspace and then
@@ -308,10 +319,8 @@ def add_hexagon_permissions() {
308319// NOTE: limit tests to relax folder for now to allow us to skip some of the tests
309320// that are mostly related to changes in main.
310321// This helps to speedup CI time and reduce CI cost.
311- stage(' Build and Test' ) {
312- if (is_docs_only_build != 1 ) {
313- parallel ' BUILD: GPU' : {
314- node(' GPU' ) {
322+ def build_test_gpu (node_type ) {
323+ node(node_type) {
315324 ws(per_exec_ws(' tvm/build-gpu' )) {
316325 init_git()
317326 sh " ${ docker_run} ${ ci_gpu} nvidia-smi"
@@ -320,16 +329,34 @@ stage('Build and Test') {
320329 sh " ${ docker_run} ${ ci_gpu} ./tests/scripts/unity/task_python_relax_gpuonly.sh"
321330 }
322331 }
323- },
324- ' BUILD: CPU' : {
325- node(' CPU-SMALL' ) {
332+ }
333+
334+ def build_test_cpu (node_type ) {
335+ node(node_type) {
326336 ws(per_exec_ws(' tvm/build-cpu' )) {
327337 init_git()
328338 sh " ${ docker_run} ${ ci_cpu} ./tests/scripts/task_config_build_cpu.sh build"
329339 make(ci_cpu, ' build' , ' -j2' )
330340 sh " ${ docker_run} ${ ci_cpu} ./tests/scripts/unity/task_python_relax.sh"
331341 }
332342 }
343+ }
344+
345+ stage(' Build and Test' ) {
346+ if (is_docs_only_build != 1 ) {
347+ parallel ' BUILD: GPU' : {
348+ try {
349+ build_test_gpu(' GPU-SPOT' )
350+ } catch (Exception ex) {
351+ build_test_gpu(' GPU' )
352+ }
353+ },
354+ ' BUILD: CPU' : {
355+ try {
356+ build_test_cpu(' CPU-SPOT' )
357+ } catch (Exception ex) {
358+ build_test_cpu(' CPU' )
359+ }
333360 }
334361 } else {
335362 Utils . markStageSkippedForConditional(' BUILD: CPU' )
0 commit comments