Skip to content

Commit fcd37f1

Browse files
committed
[ci] Break out test steps for Hexagon / microTVM
Since we gate all tests on all builds currently in Jenkins, the longest running build is a bottleneck for overall runtime. This moves them to their own test steps so that the longer-running GPU/CPU tests can start earlier. This should shave off another 30 minutes or so of CI time. As a follow up we can investigate per-platform parallelism, e.g. the CPU tests only wait on the CPU build, but Jenkins doesn't have good support for this so we might have to work on the UX a bit first.
1 parent 927357a commit fcd37f1

File tree

2 files changed

+107
-71
lines changed

2 files changed

+107
-71
lines changed

Jenkinsfile

Lines changed: 69 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
// 'python3 jenkins/generate.py'
4646
// Note: This timestamp is here to ensure that updates to the Jenkinsfile are
4747
// always rebased on main before merging:
48-
// Generated at 2022-04-11T10:45:26.226802
48+
// Generated at 2022-04-11T11:24:59.043636
4949

5050
import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
5151
// NOTE: these lines are scanned by docker/dev_common.sh. Please update the regex as needed. -->
@@ -85,6 +85,7 @@ tvm_multilib = 'build/libtvm.so, ' +
8585

8686
tvm_multilib_tsim = 'build/libvta_tsim.so, ' +
8787
tvm_multilib
88+
microtvm_lib = 'build/microtvm_template_projects.zip, ' + tvm_lib
8889
upstream_revision = null
8990

9091
// command to start a docker container
@@ -576,23 +577,10 @@ stage('Build') {
576577
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_config_build_qemu.sh build",
577578
label: 'Create QEMU cmake config',
578579
)
579-
try {
580-
make(ci_qemu, 'build', '-j2')
581-
cpp_unittest(ci_qemu)
582-
timeout(time: max_time, unit: 'MINUTES') {
583-
ci_setup(ci_qemu)
584-
sh (
585-
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_python_microtvm.sh",
586-
label: 'Run microTVM tests',
587-
)
588-
sh (
589-
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_demo_microtvm.sh",
590-
label: 'Run microTVM demos',
591-
)
592-
}
593-
} finally {
594-
junit 'build/pytest-results/*.xml'
595-
}
580+
make(ci_qemu, 'build', '-j2')
581+
sh "find ." // todo: debugging only, remove this
582+
sh 'cd build && tar -czvf microtvm_template_projects.tar.gz microtvm_template_projects/'
583+
pack_lib('qemu', microtvm_lib)
596584
}
597585
}
598586
} else {
@@ -608,24 +596,8 @@ stage('Build') {
608596
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_config_build_hexagon.sh build",
609597
label: 'Create Hexagon cmake config',
610598
)
611-
try {
612-
make(ci_hexagon, 'build', '-j2')
613-
cpp_unittest(ci_hexagon)
614-
sh (
615-
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_build_hexagon_api.sh",
616-
label: 'Build Hexagon API',
617-
)
618-
sh (
619-
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
620-
label: 'Run Hexagon tests',
621-
)
622-
sh (
623-
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon_simulator.sh",
624-
label: 'Run Hexagon tests on simulator',
625-
)
626-
} finally {
627-
junit 'build/pytest-results/*.xml'
628-
}
599+
make(ci_hexagon, 'build', '-j2')
600+
pack_lib('hexagon', tvm_lib)
629601
}
630602
}
631603
} else {
@@ -779,6 +751,67 @@ stage('Test') {
779751
Utils.markStageSkippedForConditional('python3: i386')
780752
}
781753
},
754+
'test: Hexagon': {
755+
if (!skip_ci && is_docs_only_build != 1) {
756+
node('CPU') {
757+
ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-hexagon") {
758+
timeout(time: max_time, unit: 'MINUTES') {
759+
try {
760+
init_git()
761+
unpack_lib('hexagon', tvm_lib)
762+
ci_setup(ci_hexagon)
763+
cpp_unittest(ci_hexagon)
764+
sh (
765+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_build_hexagon_api.sh",
766+
label: 'Build Hexagon API',
767+
)
768+
sh (
769+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
770+
label: 'Run Hexagon tests',
771+
)
772+
sh (
773+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon_simulator.sh",
774+
label: 'Run Hexagon tests on simulator',
775+
)
776+
} finally {
777+
junit 'build/pytest-results/*.xml'
778+
}
779+
}
780+
}
781+
}
782+
} else {
783+
Utils.markStageSkippedForConditional('test: Hexagon')
784+
}
785+
},
786+
'test: QEMU': {
787+
if (!skip_ci && is_docs_only_build != 1) {
788+
node('CPU') {
789+
ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-qemu") {
790+
timeout(time: max_time, unit: 'MINUTES') {
791+
try {
792+
init_git()
793+
unpack_lib('qemu', microtvm_lib)
794+
sh "cd build && tar -xzvf microtvm_template_projects.tar.gz"
795+
ci_setup(ci_qemu)
796+
cpp_unittest(ci_qemu)
797+
sh (
798+
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_python_microtvm.sh",
799+
label: 'Run microTVM tests',
800+
)
801+
sh (
802+
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_demo_microtvm.sh",
803+
label: 'Run microTVM demos',
804+
)
805+
} finally {
806+
junit 'build/pytest-results/*.xml'
807+
}
808+
}
809+
}
810+
}
811+
} else {
812+
Utils.markStageSkippedForConditional('test: QEMU')
813+
}
814+
},
782815
'topi: aarch64': {
783816
if (!skip_ci && is_docs_only_build != 1) {
784817
node('ARM') {

jenkins/Jenkinsfile.j2

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ tvm_multilib = 'build/libtvm.so, ' +
8282

8383
tvm_multilib_tsim = 'build/libvta_tsim.so, ' +
8484
tvm_multilib
85+
microtvm_lib = 'build/microtvm_template_projects.zip, ' + tvm_lib
8586
upstream_revision = null
8687

8788
// command to start a docker container
@@ -573,23 +574,10 @@ stage('Build') {
573574
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_config_build_qemu.sh build",
574575
label: 'Create QEMU cmake config',
575576
)
576-
try {
577-
make(ci_qemu, 'build', '-j2')
578-
cpp_unittest(ci_qemu)
579-
timeout(time: max_time, unit: 'MINUTES') {
580-
ci_setup(ci_qemu)
581-
sh (
582-
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_python_microtvm.sh",
583-
label: 'Run microTVM tests',
584-
)
585-
sh (
586-
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_demo_microtvm.sh",
587-
label: 'Run microTVM demos',
588-
)
589-
}
590-
} finally {
591-
junit 'build/pytest-results/*.xml'
592-
}
577+
make(ci_qemu, 'build', '-j2')
578+
sh "find ." // todo: debugging only, remove this
579+
sh 'cd build && tar -czvf microtvm_template_projects.tar.gz microtvm_template_projects/'
580+
pack_lib('qemu', microtvm_lib)
593581
}
594582
}
595583
} else {
@@ -605,24 +593,8 @@ stage('Build') {
605593
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_config_build_hexagon.sh build",
606594
label: 'Create Hexagon cmake config',
607595
)
608-
try {
609-
make(ci_hexagon, 'build', '-j2')
610-
cpp_unittest(ci_hexagon)
611-
sh (
612-
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_build_hexagon_api.sh",
613-
label: 'Build Hexagon API',
614-
)
615-
sh (
616-
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
617-
label: 'Run Hexagon tests',
618-
)
619-
sh (
620-
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon_simulator.sh",
621-
label: 'Run Hexagon tests on simulator',
622-
)
623-
} finally {
624-
junit 'build/pytest-results/*.xml'
625-
}
596+
make(ci_hexagon, 'build', '-j2')
597+
pack_lib('hexagon', tvm_lib)
626598
}
627599
}
628600
} else {
@@ -730,6 +702,37 @@ stage('Test') {
730702
Utils.markStageSkippedForConditional('python3: i386')
731703
}
732704
},
705+
{% call m.test_step(name="test: Hexagon", node="CPU", ws="tvm/test-hexagon") %}
706+
unpack_lib('hexagon', tvm_lib)
707+
ci_setup(ci_hexagon)
708+
cpp_unittest(ci_hexagon)
709+
sh (
710+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_build_hexagon_api.sh",
711+
label: 'Build Hexagon API',
712+
)
713+
sh (
714+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
715+
label: 'Run Hexagon tests',
716+
)
717+
sh (
718+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon_simulator.sh",
719+
label: 'Run Hexagon tests on simulator',
720+
)
721+
{% endcall %}
722+
{% call m.test_step(name="test: QEMU", node="CPU", ws="tvm/test-qemu") %}
723+
unpack_lib('qemu', microtvm_lib)
724+
sh "cd build && tar -xzvf microtvm_template_projects.tar.gz"
725+
ci_setup(ci_qemu)
726+
cpp_unittest(ci_qemu)
727+
sh (
728+
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_python_microtvm.sh",
729+
label: 'Run microTVM tests',
730+
)
731+
sh (
732+
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_demo_microtvm.sh",
733+
label: 'Run microTVM demos',
734+
)
735+
{% endcall %}
733736
{% call m.test_step(name="topi: aarch64", node="ARM", ws="tvm/ut-python-arm") %}
734737
unpack_lib('arm', tvm_multilib)
735738
ci_setup(ci_arm)

0 commit comments

Comments
 (0)